
4-43
4 Using Protocol Macros
CJ-series Serial Communications Units Operation Manual for NJ-series CPU Unit(W494)
4-3 Usin
g Pr
otoco
l Macr
o
s
4
4-3-2 U
s
er Prog
ram Example
Send data Word data array
Receive data Word data array
z
Operand Settings for the ExecPMCR Instruction
Reading and storing the present value of the node No. 03 E5
@
N.
Variable
Item
Description of this
example
Value
SendData[0]
Number of send data words Data of 5 words of Send-
Data[0] to SendData[4] are
sent.
WORD#16#0005
SendData[1]
Node No.
Node No. 3.
WORD#16#0003
SendData[2]
Variable type + higher 1
byte of read start address
In this Present Value Read,
the variable type is
BYTE#16#C0 and read start
address is WORD#16#00.
WORD#16#C000
SendData[3]
Lower 1 byte of read start
a fixed value of
BYTE#16#00
WORD#16#0000
SendData[4]
Number of elements
The number of element is 1.
WORD#16#0001
Variable
Item
Description of this
example
Value
RecvData[0]
Number of receive data
words
Data of 4 words of Recv-
Data[0] to RecvData[3] are
received.
WORD#16#0004
RecvData[1]
Response code
WORD#16#0000 is returned
for normal end.
---
RecvData[2]
Receive data
The lower 2 bytes of the
present values of the tem-
perature controller are
returned.
---
RecvData[3]
The higher 2 bytes of the
present values of the tem-
perature controller are
returned.
---
Execute
Port
SeqNo
SrcDat
DstDat
InPort
0
SendData[0]
RecvData[0]
ExecPMCR
Done
Busy
Error
ErrorID
ErrorIDEx
DstDat
Input variable
Function
Setting value
Execute
The operation SendCmd is exe-
cuted when 1 is set.
---
Port
The destination is specified by
using the Unit number and serial
port number.
InPort.UnitNo =
_eUnitNo#_CBU_No02
InPort.PhysicPortNo =
USINT#1
SeqNo
Communications sequence No.
0
SrcDat
The starting element of the
user-defined variable (array)
that store the command data to
be sent is specified.
SendData[0]
DstDat
The starting element of the
user-defined variable (array)
that store the data to be
received is specified.
RecvData[0]
Содержание CJ1W-SCU22
Страница 192: ...4 Using Protocol Macros 4 56 CJ series Serial Communications Units Operation Manual for NJ series CPU Unit W494...
Страница 250: ...6 No protocol Mode 6 22 CJ series Serial Communications Units Operation Manual for NJ series CPU Unit W494...
Страница 460: ...A Standard System Protocol R 126 CJ series Serial Communications Units Operation Manual for NJ series CPU Unit W494...
Страница 473: ...Index 1 CJ series Serial Communications Units Operation Manual for NJ series CPU Unit W494 I Index...