2-675
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Communications Instructions
2
SendCmd
The SendCmd instruction sends the contents of command array CmdDat[] to the destination specified
with destination network address DstNetAdr and destination serial port CommPort. The command data
size CmdSize specifies how many elements of CmdDat[] contain the command. The response that is
returned is stored in response storage array RespDat[].
The data type of DstNetAdr is structure _sDNET_ADR. The specifications are as follows:
The destination node is found with routing tables. If the value of DstNetAdr.NetNo is 0, the data is
routed through the built-in EtherNet/IP port. If the value of DstNetAdr.NodeNo is 255, the data is broad-
cast to all nodes with the specified network address.
The data type of CommPort is enumerated type _ePORT. The meanings of the enumerators of enumer-
ated type _ePORT are as follows:
The data type of Option is structure _sRESPONSE. The specifications are as follows:
If the value of the Response Not Necessary Flag (Option.isNonResp) is FALSE and the response does
not return within the value set for the Timeout Time (Option.TimeOut), the command is resent until
there is a response. Option.Retry specifies the number of retries. The timeout time is Option.TimeOut
multiplied by 0.1 s. However, if the value of Option.TimeOut is 0, the timeout time is 2.0 s. The default
value of Option.TimeOut is 2.0 s. No responses are received for broadcast data. Also, the command is
not resent.
Function
Name Meaning Description Data type Valid range Unit Default
DstNetAdr Destination
network
address
Destination network
address
_sDNET_ADR --- --- ---
NetNo Network
address
Network address USINT
0
---
0
NodeNo Node address Node address USINT
UnitNo Unit address Unit address BYTE Depends on
data type.
16#00
Enumerators Meaning
_NONE The destination is not a serial port in Host Link Mode.
Name Meaning Description Data type Valid range Unit Default
Option Response Response monitoring
and retry specifications
_sRESPONSE --- --- ---
isNonResp No response
TRUE:Response is not
required.
FALSE:Response is
required.
BOOL
Depends on
data type.
--- FALSE
TimeOut Timeout time Timeout time
0: 2.0 s
UINT 0.1 s 20
(2.0 s)
Retry Retry count Retry count USINT 0 to 15 Times 0