- ページ 5

コントローラー DAINCUBE DTP10-LのPDF 手動火災をオンラインで閲覧またはダウンロードできます。DAINCUBE DTP10-L 13 ページ。 Embedded-based teach pendant optimized for industrial robots, arm cortex-a9 linux system

1. Introduction

Thank you very much for purchasing our products.
This document describes an example program for controlling Key, LED and Buzzer on DTP10-L.
If you will control Key, LED and Buzzer, you need to develop serial communication program. However, if it is
difficult to develop serial communication program, refer to the event filter function in this document.
filter function can only control LED and Buzzer.)
modify it for your application.

2. How to use Serial Daemon

2.1. COM port open

Key, LED and Buzzer use ttyACM0 COM port on DTP10-L. Therefore ttyACM0 port must be opened and
function used are as follows.
fd= open ( SERPORT, 0_RDWR | O_NOCTTY);
if( fd < 0 ) {
// Serial Port Open Fail
} else {
// Serial Port Open Success
}
If the serial port is successfully opened, set additional settings for serial communication.
Example )
/*
* Function name : Serial_Port_Open
* Description
: Open serial port (ttyACM0) and initialize of serial port.
*/
void Serial_Daemon::Serial_Port_Open()
{
struct termios newtio;
/* Serial port open */
fd = open( SERPORT, O_RDWR | O_NOCTTY);
if ( fd < 0 )
{
/* Serial port open fail */
g_com_flag = 0;
ui->Btn_Open->setText("OPEN");
ui->Btn_Open->setEnabled(1);
return;
}
else
{
/* Serial port init */
memset(&newtio, 0, sizeof(newtio));
newtio.c_iflag = IGNPAR; // non-parity
newtio.c_oflag = 0;
newtio.c_cflag = CS8 | CLOCAL | CREAD | BAUD_RATE; // NO-RTS/CTS
/* Set input mode (non-canonical, no echo,.....) */
newtio.c_lflag = 0;
newtio.c_cc[VTIME] = TIME;
newtio.c_cc[VMIN] = MIN;
This program is only sample program.
(Event
So, you must to