DAINCUBE DTP10-L Manuelles Feuer - Seite 10
Blättern Sie online oder laden Sie pdf Manuelles Feuer für Touch Panel DAINCUBE DTP10-L herunter. DAINCUBE DTP10-L 13 Seiten. Embedded-based teach pendant optimized for industrial robots, arm cortex-a9 linux system
1BYTE
1BYTE
MOD : MOD_GET = 0x10, MOD_SET = 0x11
SEL : SEL_BUZZ = 0x3B
DATA1 : BUZZ_OFF = 0x30, BUZZ_ON = 0x31
DATA2 : 0x20 = DATA_RESERVED
DATA3 : 0x20 = DATA_RESERVED
/*
* Function name : BUZ_Set
* Description
: This function is control of Buzzer and Buzzer on,off has its own value.
*
*/
void Serial_Daemon::BUZ_Set(char data)
{
char buf_printf[10] = {0, };
unsigned int crc_buf;
unsigned long dwBytes = 0;
buf_printf[0] = STX;
buf_printf[1] = MOD_SET;
buf_printf[2] = SEL_BUZZ;
if ( data == BUZZ_ON )
buf_printf[3] = BUZZ_ON;
else if ( data == BUZZ_OFF )
buf_printf[3] = BUZZ_OFF;
buf_printf[4] = DATA_RESERVED;
buf_printf[5] = DATA_RESERVED;
crc_buf = crc16_append(buf_printf,6);
buf_printf[6] = (char)(crc_buf>>8)&0xff;
buf_printf[7] = (char)crc_buf&0xff;
buf_printf[8] = ETX;
buf_printf[9] = '\0';
dwBytes = strlen(buf_printf);
write( fd, buf_printf, dwBytes );
usleep(1000);
}
4.3. Examples using Keypad
Receive keypad event 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
- Receive serial packet
- Receive packet check and parsing
- Serial COM port close
You can check the keypad status of DTP10-L by transmit/receive serial packet as below.
STX
MOD
0x02
0x10
1BYTE
1BYTE
MOD : MOD_GET = 0x10
SEL : SEL_KEYPAD = 0x3D
1BYTE
1BYTE
If you control Buzzer, using this function.
// STX
// MOD (get : 0x10, set : 0x11)
// SEL (BUZZ : 0x3B)
// Data1 (on : 0x31, off : 0x30)
// ETX
SEL
DATA1
0x3D
0x30
1BYTE
1BYTE
1BYTE
1BYTE
// Data2 (Reserved : 0x20)
// Data3 (Reserved : 0x20)
DATA2
DATA3
0x33
0x30
1BYTE
1BYTE
1BYTE
1BYTE
CRC_H
CRC_L
0xXX
0xXX
1BYTE
1BYTE
1BYTE
ETX
0x03
1BYTE