6 system variables and flags, 7 system variables storage organization, 1 ram file for user’s data storage – Lenze PM94P01C User Manual

Page 40: Programming

Advertising
background image

PM94P01C

38

Programming

2.6

System Variables and Flags

System variables are variables that have a predefined meaning. They give the programmer/user access to drive
parameters and functions. Some of these variables can also be set via the parameters in MotionView. In most cases
the value of these variables can be read and set in your program or via a Host Interface. Variables are either read only,
write only or read and write. Read only variables can only be read and can’t be set. For example, INPUTS = 5, is an
illegal action because you can not set an input. Conversely, write-only variables cannot be read. Reading a write-only
variable by either the variable watch window or network communications can result in erroneous data.

System Flags are System Variables that can only have values of 0 or 1. For example, IN_A1 is the system flag that
reflects the state of digital input A1. Since inputs can only be ON or OFF, then the value of IN_A1 can only be 0 or 1.

2.7

System Variables Storage Organization

All system variables are located in drive’s RAM memory and therefore are volatile. However, values for some of these
system variables are also stored in EPM. When a system variable is changed in MotionView, its value changes in both
RAM and EPM. When a system variable is changed from the user’s program, its value is changed in RAM only and will
be lost on power down.

Host interfaces have the capability to change the variable value in both the EPM and RAM. The user has a choice in
memory to change a variable in RAM and EPM or in RAM only.

2.7.1 RAM File for User’s Data Storage

In addition to the standard user variables (V0-V31 & NV0-NV31) PositionServo drives have a section of RAM memory
(256k) allocated as data storage space and available to the programmer for storage of program data.

The RAM file data storage is often required in systems where it is desirable to store large amounts of data prepared by
a host controller ( PLC, HMI, PC, etc). This data might represent more complex Pick and Place coordinates, complicated
trajectory coordinates, or sets of gains/limits specific for given motion segments.

RAM memory is also utilized in applications that require data collection during system operation. At the end of a period
of time the collected data can be acquired by the host controller for analysis. For example, position errors and phase
currents collected during the move are then analyzed by the host PLC/PC to qualify system tolerance to error free
operation.

Implementation

There are 256K (262,144) bytes provided as RAM file for data storage. Since the basic data type in the drive is 64 bit
(8 bytes) 32,768 data elements can be stored in the RAM file. The file is accessible from within the User’s program
or through any external communications interface (Ethernet, ModBUs, CAN etc.). Two statements and three system
variables are provided for accessing the RAM file memory. The RAM file is volatile storage and is intended for “per
session” usage. The data saved in the RAM file will be lost when the drive is powered off.

The three system variables provided to support file access are:
VAR_MEM_VALUE

(PID = 4)

VAR_MEM_INDEX

(PID = 5)

VAR_MEM_INDEX_INCREMENT

(PID = 6)

In addition, two statements are provided to to allow access and storage to the RAM file direct from convenient statements
within the user program. The statements MEMSET, MEMGET are described in paragraph 2.7.3 and Tables 44 & 45.

Advertising