ID : 3576
Data Communication
Data communication is a function enables you to communicate data with external devices in PacScript.
Task and Line
In Data communication, task opens a line and data communication will be performed through the line.
Once a task opens the line, the task acquires a communication permission of the line and the line cannot be opened by the other tasks. Task can open multiple lines, but a line cannot be opened by the multiple tasks concurrently. The line which has already opened cannot be accessed by the other tasks.*
Regardless of task status or running mode, the COBOTTA retains the information about line number and which task opens until the power supply turns OFF.
In Data communication function, the task can close the line which is not opened by the task when only designating "-1" for argument in Comm.Close method. This is a process to close the entire lines forcedly in case of when a system freezes with the line opened by the task. This should be used for error processing routine etc, not for regular task.
Communication Method
The data communication of COBOTTA uses Ethernet.
The communication method should be assigned according to the line number.
Line numbers of Ethernet are 4 to 15.
Ethernet data communication sends/receives data after surely establishing the line connection.
In Ethernet data communication, the communication will be established by "client" line connection to "server" line. "Server" and "Client" communication will be established in one-to-one basis.
Process of establishing Ethernet line communication is as follows.
- Open the server side line.
- Open the client side line. An error message will be displayed when the server line is not opened.
- Send/receive data.
Selection of Data Type
You can select the following two types of data for communication.
- Text
- Send/receive text data.
- Binary
- Send/receive binary data. Refer to "data communication in binary mode."
Commands Used in Data Communication
You can use the following commands for data communication.
Command name | Function |
---|---|
Comm.Open | Open the line for data communication. |
Comm.Close | Close the specified line for data communication. |
Comm.Output | Send data through data communication function. |
Comm.Input | Receive data through data communication function. |
Comm.Clear | Clear the receive buffer of data communication. |
Comm.Count | Return the number of bytes for data which can be read from receive buffer of data communication function. |
Comm.State | Return port status of data communication function. |
ID : 3576
- Related Information
- Line Number