EasyManua.ls Logo

DMM DYN4 Series - Page 70

DMM DYN4 Series
82 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
70
DMM Technology Corp.
DYN4 AC Servo Drive Instruction Manual
REV. ZM7-A10A
CT1
void DlgRun::Make_CRC_Send(unsigned char Plength,unsigned char B[8])
{
unsigned char Error_Check = 0;
for(int i=0;i<Plength-1;i++)
{
OutputBuffer[OutBfTopPointer] = B[i];
OutBfTopPointer++;
Error_Check += B[i];
}
Error_Check = Error_Check|0x80;
OutputBuffer[OutBfTopPointer] = Error_Check;
OutBfTopPointer++;
while(OutBfBtmPointer != OutBfTopPointer)
{
RS232_HardwareShiftRegister = OutputBuffer[OutBfBtmPointer];
SendRS232Port(); // Include customer code to send to RS232 port
OutBfBtmPointer++; // Change to next byte in OutputBuffer to send
}
}
void DlgRun::ReadMotorTorqueCurrent(void)
{/*Below are the codes for reading the motor torque current */
//Read motor torque current
char ID = 0; //Suppose read 0 axis motor
Global_Func = General_Read;
Send_Package(ID , Is_TrqCurrent);
//Function code is General_Read, but one byte data is : Is_TrqCurrent
//Then the drive will return a packet, Function code is Is_TrqCurrent
//and the data is 16bits Motor torque current.
MotorTorqueCurrentReady_Flag = 0xff;
While(MotorTorqueCurrentReady_Flag != 0x00)
ReadPackage();
//MotorTorqueCurrentReady_Flag is cleared inside ReadPackage() or inside
//Get_Function() exactly after the MotorTorqueCurrent is updated.
}
C++ Code for Serial Communication - Page 4
7.9A Appendix : C++ Code for Serial Communication Protocol

Table of Contents