2-711
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Communications Instructions
2
CIPUCMMWrite
The CIPUCMMWrite instruction writes the value of the network variable specified with destination vari-
able name DstDat at another Controller on a CIP network. The other Controller is specified with route
path RoutePath.
The content of source data ScrDat is written.
Size specifies the number of elements to write. If DstDat is an array, specify the number of elements to
write with Size. If DstDat is not an array, always specify 1 for Size. If the value of Size is 0, nothing is
written regardless of whether DstDat is an array or not.
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 writes variable abc. The contents of variable def is written to variable abc.
]
To write array data, pass a subscripted array element to DstDat as the parameter. Also pass a sub-
scripted array element to SrcDat as the parameter. The following example stores the contents of array
variable elements def[10] to def[13] in the four array variable elements abc[3] to abc[6].
]
The maximum size of the data that you can write depends on the data type and variable name that are
specified for DstDat and the route path, as given in the following table.
Maximum write data size [bytes] = Base size − Size of variable name of DstDat − Path information size
Function
Writing Arrays
Maximum Write Data Size
Item in above formula Meaning
Base size • Data type of variable specified for DstDat is a structure or STRING: 494
bytes
• Other data types: 496 bytes
CIPUCMMWrite_instance(A, ‘2\192.168.250.2’,
UINT#0, ‘abc’, UINT#1,
def, ghi, jkl, mno, pqr,
stu);
LD
ST
jkl
mno
pqr
stu
ghi
def
‘abc’
UINT#1
UINT#0
A
‘02\192.168.250.2’
CIPUCMMWrite
CIPUCMMWrite_instance
Execute Done
RoutePath Busy
TimeOut Error
DstDat ErrorID
Size ErrorIDEx
SrcDat
CIPUCMMWrite_instance(A, ‘2\192.168.250.2’,
UINT#0, ‘abc[3]’, UINT#4,
def[10], ghi, jkl, mno, pqr,
stu);
LD
ST
jkl
mno
pqr
stu
ghi
def[10]
‘abc[3]’
UINT#4
UINT#0
A
‘02\192.168.250.2’
CIPUCMMWrite
CIPUCMMWrite_instance
Execute Done
RoutePath Busy
TimeOut Error
DstDat ErrorID
Size ErrorIDEx
SrcDat