3-7
3 Data Exchange with the CPU Unit
CJ-series User Defined CAN Unit Operation Manual for NJ-series CPU Unit (W517)
3-1 Dat
a Exch
ang
e with t
h
e C
P
U
Unit
3
3-
1-2 Accessing Fr
om the User Pr
ogram
Use the Sysmac Studio to register user-defined variables to the variable table. Use user-defined vari-
ables to specify the AT specification of the memory used for CJ-series Unit to which buffer and trigger
areas are allocated.
Generally, array variables are created.
Below is an example of allocation to user-defined variables. See
for more
information.
•
Configuration of the User Defined CAN unit using the message command 2902
•
1 send buffer, 1 receive buffer
One send or receive buffer occupies 5 words of CPU memory (Data Length Code (DLC) and the 8
bytes of data). One send trigger or receive flag occupies one bit of CPU memory. The number of words
occupied by all triggers or flags equals the number of send or receive messages divided by 16, rounded
up. Trailing padding bits are ignored (see section
4-2-1 Configure Memory Areas (2902)
for more infor-
mation).
In this case, buffer and trigger data are allocated as follows:
Allocate the I/O data to the user-defined variables as shown in the example below.
This example uses the following data types.
•
ARRAY[..]OF WORD
•
ARRAY[..]OF BOOL
•
BOOL
Use this data type or multiple data types to create user-defined variables according to the user pro-
gram.
Additional Information
For details on memory used for CJ-series Unit, variable allocation, and user-defined variable
registration, refer to the
Sysmac Studio Version 1 Operation Manual
(Cat. No. W504).
How to Create User-defined Variables
Words
allocated
I/O data
W0000 to W0004
Send Buffer starting word
W100
Send Trigger starting word
EM Bank 0, 000000 to 000004
Receve Buffer starting word
W110
Receive Trigger starting word
Summary of Contents for CJ1W-CORT21
Page 2: ......
Page 140: ...Appendices A 6 CJ series User Defined CAN Unit Operation Manual for NJ series CPU Unit W517...
Page 141: ...Index 1 CJ series User Defined CAN Unit Operation Manual for NJ series CPU Unit W517 I Index...
Page 144: ...Index 4 CJ series User Defined CAN Unit Operation Manual for NJ series CPU Unit W517 Index...