2-707
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Communications Instructions
2
CIPUCMMRead
The CIPUCMMRead instruction reads the value of the network variable specified with source variable
name SrcDat from another Controller on a CIP network. The other Controller is specified with route
path RoutePath.
The read data value is stored in DstDat.
Size specifies the number of elements to read. If SrcDat is an array, specify the number of elements to
read with Size. If SrcDat is not an array, always specify 1 for Size. If the value of Size is 0, nothing is
read regardless of whether SrcDat is an array or not.
When the read operation is completed, the number of bytes of the data that was read is assigned to
read data size RcvSize. You can read a maximum of 496 bytes of data.
TimeOut specifies the timeout time. If a response does not return within the timeout time, it is assumed
that communications failed.
If the value of ErrorID is WORD#16#1C00, the CIP message error code is stored in ErrorIDEx.
The following example reads the value of variable abc. The read data is stored in variable def and the
value of variable vwx changes to UINT#1.
To read array data, pass a subscripted array element to ScrDat as the parameter. Also pass a sub-
scripted array element to DstDat as the parameter. The following example reads the four array variable
elements abc[3] to abc[6] and stores the results in array variable elements def[10] to def[13]. The value
of variable vwx will be UINT#4.
Function
Reading Arrays
CIPUCMMRead_instance(A, ‘2\192.168.250.2’,
UINT#0, ‘abc’, UINT#1,
def, ghi, jkl, mno, pqr,
stu, vwx);
LD
ST
jkl
mno
pqr
stu
vwx
ghi
‘abc’
UINT#1
def def
UINT#0
A
‘02\192.168.250.2’
CIPUCMMRead
CIPUCMMRead_instance
Execute Done
RoutePath Busy
TimeOut Error
SrcDat ErrorID
Size ErrorIDEx
DstDat
RcvSize
CIPUCMMRead_instance(A, ‘2\192.168.250.2’,
UINT#0, ‘abc[3]’, UINT#4,
def[10], ghi, jkl, mno, pqr,
stu, vwx);
LD
ST
jkl
mno
pqr
stu
vwx
ghi
‘abc[3]’
UINT#4
def[10] def[10]
UINT#0
A
‘02\192.168.250.2’
CIPUCMMRead
CIPUCMMRead_instance
Execute Done
RoutePath Busy
TimeOut Error
SrcDat ErrorID
Size ErrorIDEx
DstDat
RcvSize