DAINCUBE DTP10-L Api Manual - Page 9
Browse online or download pdf Api Manual for Controller DAINCUBE DTP10-L. DAINCUBE DTP10-L 13 pages. Embedded-based teach pendant optimized for industrial robots, arm cortex-a9 linux system
{
char LED_Packet[10] = {0, };
unsigned int crc_buf;
unsigned long dwBytes = 0;
LED_Packet[0] = STX;
LED_Packet[1] = MOD_SET;
LED_Packet[2] = SEL_LED;
LED_Packet[5] = DATA_RESERVED;
LED_Packet[8] = ETX;
LED_Packet[9] = '\0';
switch(sel) {
case RIGHT_LED1:
LED_Packet[3] = RIGHT_LED1;
break;
case RIGHT_LED2:
LED_Packet[3] = RIGHT_LED2;
break;
case RIGHT_LED3:
LED_Packet[3] = RIGHT_LED3;
break;
case LED_ALL:
LED_Packet[3] = LED_ALL;
}
if (data & 0x1) {
LED_Packet[4] = LED_BLUE;
} else if (data & 0x2) {
LED_Packet[4] = LED_RED;
} else if (data & 0x4) {
LED_Packet[4] = LED_ALL_ON;
} else {
LED_Packet[4] = LED_OFF;
}
crc_buf = crc16_append(LED_Packet,6);
LED_Packet[6] = (char)(crc_buf>>8)&0xff;
LED_Packet[7] = (char)crc_buf&0xff;
dwBytes = strlen(LED_Packet);
write( fd, LED_Packet, dwBytes );
usleep(1000);
}
4.2. Examples using Buzzer
Control the Buzzer of DTP10-L by using serial daemon program provided by Daincube.
- Serial COM port open
- Packet buffer create.
- CRC create and fill in the packet buffer
- Transmit serial packet
- Serial COM port close
You can control Buzzer of DTP10-L by transmit serial packet as below.
STX
MOD
0x02
0x11
// STX
// MOD (get : 0x10, set : 0x11)
// SEL (LED : 0x3A)
// Data3 (Reserved : 0x20)
// ETX
// Blue color
// Red color
// All color
// LED Off
SEL
DATA1
0x3B
0x31
DATA2
DATA3
0x20
0x20
CRC_H
CRC_L
0xXX
0xXX
ETX
0x03