EasyManua.ls Logo

Mitsubishi Electric CR800 Series - Page 141

Mitsubishi Electric CR800 Series
146 pages
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...
4 Appendix
4-21
memset(&MXTrecv, 0, sizeof(MXTrecv));
// Transmission data creation
if(loop==1) { // Only first time
MXTsend.Command = MXT_CMD_NULL;
MXTsend.SendType = MXT_TYP_NULL;
MXTsend.RecvType = type;
MXTsend.SendIOType = MXT_IO_NULL;
MXTsend.RecvIOType = IOSendType;
MXTsend.CCount = counter = 0;
}
else { // Second and following times
MXTsend.Command = MXT_CMD_MOVE;
MXTsend.SendType = type;
MXTsend.RecvType = type_mon[0];
MXTsend.RecvType1= type_mon[1];
MXTsend.RecvType2= type_mon[2];
MXTsend.RecvType3= type_mon[3];
switch(type) {
case MXT_TYP_JOINT:
memcpy(&MXTsend.dat.jnt, &jnt_now, sizeof(JOINT));
MXTsend.dat.jnt.j1 += (float)(delta*ratio*3.141592/180.0);
break;
case MXT_TYP_POSE:
memcpy(&MXTsend.dat.pos, &pos_now, sizeof(POSE));
MXTsend.dat.pos.w.x += (delta*ratio);
break;
case MXT_TYP_PULSE:
memcpy(&MXTsend.dat.pls, &pls_now, sizeof(PULSE));
MXTsend.dat.pls.p1 += (long)((delta*ratio)*10);
break;
default:
break;
}
MXTsend.SendIOType = IOSendType;
MXTsend.RecvIOType = IORecvType;
MXTsend.BitTop = IOBitTop;
MXTsend.BitMask =IOBitMask;
MXTsend.IoData = IOBitData;
MXTsend.CCount = counter;
}
// Keyboard input
// [Enter]=End / [d]= Display the monitor data, or none / [0/1/2/3]= Change of monitor data display
// [z/x]=Increment/decrement first command data transmitted by the delta amount
while(_kbhit()!=0) {
ch=_getch();
switch(ch) {
case 0x0d:
MXTsend.Command = MXT_CMD_END;
loop = 0;
break;
case 'Z':
case 'z':
delta += (float)0.1;
break;
case 'X':
case 'x':
delta -= (float)0.1;
break;
case 'C':

Table of Contents

Other manuals for Mitsubishi Electric CR800 Series

Related product manuals