![background image](http://html1.mh-extra.com/html/omron/cj1w-scu22/cj1w-scu22_operation-manual_742498087.webp)
2-13
2 Initial Settings and Allocations of Device Variable for CJ-series Unit
CJ-series Serial Communications Units Operation Manual for NJ-series CPU Unit(W494)
2-2
Data Exc
h
ang
e
with
the C
P
U Un
it
2
2-2-2 H
o
w to Specify and
Create
V
ar
iab
les
User-defined variables are required in the following situations.
•
To specify the send/receive data of Serial Port I/O instructions in No-protocol Mode
•
To specify the send/receive data with a Protocol Macro instruction in Protocol Macro Mode
•
To specify the allocation area in Modbus-RTU Slave Mode
In general, user-defined variables create array variables.
An example of allocation to a user-defined variable is explained below.
Example) The Holding Registers allocation area is set in DM within the memory area for the CJ-series
Unit in the Modbus-RTU Slave Mode, and allocated to the array variable, RegData, to update
the 10 words, DM1000 to DM1009. Each of these 10 words can be updated separately.
The user can use any desired name for the array variable names.
Set the array data type to WORD as it is set for each word.
Array elements are required for 10 words. Therefore, the array variable will be WORD RegData [10].
Allocate this array to the area starting from D1000 by using Sysmac Studio.
Use the variables that are pre-defined.
For details, refer to 2-4 System-defined Variable.
How to Create User-defined Variables
How to Specify System-defined Variables
Word address 15 bits
0 bit
+0
RegData [0]
RegData [1]
RegData [2]
:
RegData [9]
+1
+2
:
+9
Set the starting
address to D1000
For 10 words
AAA status
BBB status
:
:
:
:
YYY status
ZZZ status
RegData [0]
RegData [1]
RegData [8]
RegData [9]
D1000
D1009
10 words
Содержание 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...