2-659
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Communications Instructions
2
SerialSend
The SerialSend instruction sends data in No-protocol Mode from the port and the Serial Communica-
tions Unit specified with Port. The data that is sent is contained in send data array SrcDat[]. The number
of array elements to send is specified in number of send data elements SendSize.
To attach start and end codes to the send data, set them in the DM Area words that are assigned to the
Special Unit.
If you add start and end codes, the maximum number of bytes to send is 259 (1-byte start code, 2-byte
end code (for CR+LF specification), and 256 bytes of send data).
The data type of destination port Port is the structure _sPORT. The specifications are as follows:
The following figure shows a timing chart. Communications is performed to the end after the value of
Done changes to TRUE.
Function
Name Meaning Description Data type Valid range Unit Default
Port Destination
port
Destination port _sPORT
--- --- ---
UnitNo Unit number Unit number of Serial
Communications Unit
_eUnitNo _CBU_No00 to
_CBU_No15
---
_CBU_
No00
PhysicPortNo Serial port
number
Serial port number on
Serial Communications
Unit
USINT 1 or 2 1
Execute
Busy
Done
Error
SrcDat[]
TRUE
FALSE
Prepare SrcDat[] before Execute
changes to TRUE.
SerialSend Instruction Execution
Flag
Data transmission started.
SerialSend Instruction Execution Flag changes to TRUE.
Data transmission ended.
SerialSend Instruction Execution Flag changes to FALSE.
TRUE
FALSE
TRUE
FALSE
TRUE
FALSE
TRUE
FALSE