Download Print this page

Omron NS Reference Manual page 11

Hide thumbs Also See for NS:

Advertisement

Section 1 Outline of Macro Function
NS series Macro Reference
Programming Terms
This section describes terms used in this function.
Variable
The following variables can be used in macro program.
Item
Host
address
PT Memory
Index
Qualifier of Variable
Qualifiers set for variables must be used as shown below.
Qualifiers are used when performing 32-bit data processing and numeral processing for bit.
Item
Long Access
(32bit) of
Word (16bit)
Numeral
Access of Bit
Use functions (READCMEM and WRITECMEM) for communication when
accessing to the address in the host.
Enclose address in [ ]
Example:
READCMEM($W100,[HOST1:DM00000],100);
'Read HOST1:DM00000 to DM00099 to $W100 to $W199
Bit
Internal memory: $B
Internal Holding memory: $HB
System Memory: $SB
Word
Internal memory: $W
Internal Holding memory: $HW $HW0 to $HW 8191 (16bit per 1point)
System Memory: $SW
Example:
$W100=$W0+1; 'Set the value $W0 and 1 added to $W100
Index is used for processing bit and word in the PT memory.
Add index to the end of the address and it will processed as [specified
address + index value]
There are 10 index points (I0 to I9).
Set I0 to I9 for the value of $SW27 to $SW36.
Example:
$SW27 = H20;
$W0I0 = 123; '$W0I0 is regarded as $W20 added $W0 and 20
'$W20 = 123
Put "L" at the end of variable. Uses 2 words.
$W0L=1000000;
'Accesses regarding $W0, $W1 as 32-bit
$W100L=1000*1000; 'Accesses regarding $W100, $W101 as 32-bit
Put ":n" at the end of variable. Specify the value of bit address (up to 32
by 4-bit unit) for "n".
Exceptions: If n=16, input "W".
If n=32, input "L".
$B0:4 = 3;
'Sets 3(0011) for 4-bit from $B0 to $B3
$B0W = 12345; 'Sets 12345(0011000000111001) for 16-bit from $B0 to
'$B15
Explanation
$B0 to $B32767 (1bit per 1point)
$HB0 to $HB8191 (1bit per 1point)
$SB0 to $SB 63 (1bit per 1point)
$W to $W32767(16bit per 1point)
$SW0 to $SW39 (16bit per 1point)
Explanation
1-9

Advertisement

loading

This manual is also suitable for:

Ns-series