SM-Applications Modules & Motion Processors User Guide 83
Issue Number: 4
Safety
Information
Introduction Installation
Getting
Started
Parameters
DPL
Programming
Communications
Freeze and
Marker
CTSync
Inter-option
Synchronization
Diagnostics
Migration
Guide
Quick
Reference
Index
7.3.8 Bit addressing of variables
All integer variables and arrays may be bit-addressed. This means that each individual
bit within the variable may be separately read or written. After the variable name, place
a decimal point (.) followed by the bit number between 0 and 31.
Example 1 (simple variable):
Example 2 (arrays):
Note: The bit number must be a constant number - variables are not allowed.
7.3.9 PLC Registers
The 'PLC' area is a special range of pre-defined 32-bit registers. The PLC registers are
split into 6 sets of 100 parameters numbered 00 to 99. The registers can also be
accessed from within a user DPL program by a special variable name or array name.
Four of the register sets are also saveable in the Second Processor Flash memory.
See section 5.4 Menus 70-75 - PLC Registers on page 43 for further information on
PLC registers.
7.3.10 RAM files
RAM files enable the user to store ‘files’ in the user RAM of the Second Processor.
These can be uploaded and downloaded using DPL commands. They have an
advantage in that you can retrieve or write an array of numbers in one go rather than
each element of the array individually.
7.4 Parameters
Parameters are categorized into two sets:
• Drive Parameters
• Second Processor Parameters
Drive parameters are ones which reside in the host drive. The majority of them affect the
operation of the drive, however a few are set aside as “application parameters”. These
are menus 18, 19 and 20.
Flags% = 0 // initialise all 32 bits to 0
Flags%.0 = 1 // set bit 0 to 1
// now test to see if bit 0 AND bit 1 are set to 1.
IF Flags%.0 & Flags%.1 = 1 THEN
PRINT "Test satisfied."
ENDIF
DIM MyArray%[10]
...
IF MyArray%.1[4] = 1 THEN;test bit 1 of element #4.
PRINT "Test satisfied."
ENDIF
For further information on RAM files, including example programs, please refer to the on-
line help.