
4 Exchanging Data with CPU
4-10
CJ-series High-speed Counter Units Operation Manual for NJ-series CPU Unit(W492)
For an overview of all addresses related to Comparison Data refer to 4-2-6 Memory Allocation for
Comparison data.
With Sysmac Studio, you can specify an AT (allocation destination) for the DM/EM area that you
secured for ranges or comparison data by specifying indirect addresses (see page 4-8). With user-
defined variables, it is possible to specify an arbitrary variable name. Once it is allocated, the ranges
and comparison data can be read and written from Sysmac Studio or from a user program.
An actual example of allocation to user-defined variables is explained below.
Example: The 12 range data items shown below are allocated for Counter 1 using the structure data
type "_sCJCT021_Ex_RngLin" pre-defined for user-defined variable CmpData.
Setting the Device Variables for CJ-series Unit (for setting)
Note After this setting, reset the Controller or restart this Unit.
Data type definition
Register the structure data type for High-speed Counter Units beforehand on the CPU/Expansion
Racks screen in Configuration and Setup of Sysmac Studio.
With the Unit selected on the CPU/Expansion Racks screen in Configuration and Setup, right click, then
select Register Data Types for Units. The data type is registered and becomes usable.
Allocation to User-defined Variable
Device variable for CJ-series Unit
Data type
Name
Set value
*_Ch1_NumRngCmpCfg
WORD
Number of Ranges/Comparison data
(BCD)
16#0012
*_Ch1_MemAreaCfg
UINT
Memory Area
1 (DM)
*_Ch1_MemAdrCfg
DWORD
Memory Address (BCD)
16#00001850
Structure data type name
Member
Data type
Name
_sCJCT021_Ex_RngLin
LowLmt
DINT
Lower Limit Range
UpLmt
DINT
Upper Limit Range
OutPat
DWORD
Output Pattern
Comparison Value
+Set Pattern
+Reset Pattern
EM520
5 x 10 words =
50 words
EM:
EM530
EM540
EM550
EM520
EM521
EM522
EM523
EM524
EM525
Comparison data 0:
Comparison
Comparison
Comparison
Comparison
Comparison
EM560
-Set Pattern
-Reset Pattern
EM526
EM527
EM528
EM529
data
data
data
data
data
0
1
2
3
4