Internal state variables are special assignments for variables that give the user access to important motor specific data. The following tables list available state variables
Motor Status Variables
|
Name |
Description |
R/W |
Unit |
||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
"Ux"
|
Status
A complete list of status values can be found at Status and Error States |
RO |
- |
||||||||||||||
"Px"
|
Position
It is recommended a write only occurs when the motor is stationary.
|
R/W |
Pulses |
||||||||||||||
"Sx"
|
Speed
|
RO |
Pulses/second |
||||||||||||||
"Ix"
|
Current
The current limit depends on the motor size. The following table shows the range for each motor
|
RO |
- |
||||||||||||||
"Tx"
|
Target Current
See "Ix" for each motors value range |
RO |
- |
||||||||||||||
"Ex"
|
Error Status
This variable differs from "Ux" in that it will only include status values that indicate a motor error/alarm/fault |
RO |
- |
||||||||||||||
"Pe"
|
Position Error
|
RO |
Pulses |
Inputs and Outputs
General Variables
|
Name |
Description |
R/W |
Unit |
|---|---|---|---|
"AIN4"
|
Analog Input Value Read the value of the analog on input 4 Range: 0 to 1023 |
RO |
- |
"Fx"
|
INPUT2 Frequency Read the frequency of the signal on input 2 Range: 0 to 2000 |
RO |
1KHz |
"Cx"
|
INPUT2 High Speed Counter Count rising edge triggers in IN2. This counter uses the processor's high speed
Write to the counter to set a clear/set a starting value. This counter is very sensitive and will pick up noise and bounce in the signal |
R/W |
- |
"Cx2"
|
INPUT2 Counter Counts pulses every 1ms on IN2. Useful on counting inputs use with relays or mechanical switches.
|
R/W |
- |
"Cx3"
|
INPUT3 Counter Counts pulses every 1ms on IN3. Useful on counting inputs use with relays or mechanical switches.
|
R/W |
- |
"Cx4"
|
INPUT4 Counter Counts pulses every 1ms on IN4. Useful on counting inputs use with relays or mechanical switches.
|
R/W |
- |
"AO2"
|
Analog Output Value Set the analog value on OUT2. K34 and K34 must be set correctly to use. Range: 0 to 255 (0V to 4.5V) |
R/W |
- |
Digital Inputs
|
Name |
Description |
R/W |
Unit |
|---|---|---|---|
"IN"
|
Input Value Read the combined value of the inputs. Value is calculated as a binary combination IN1=1
Example: IN1 and IN4 are ON, IN2 and ON3 are off IN=9
|
RO |
- |
"INMK"
|
Input Mask Mask the inputs so only the required inputs return a value in IN |
R/W |
- |
"IN1F"
|
IN falling edge Read the falling edge for the given input. The variable returns the number of falling edges since the last read. The value is set to 0 on a read. |
RO |
- |
"IN1R"
|
IN rising edge Read the rising edge for the given input. The variable returns the number of rising edges since the last read. The value is set to 0 on a read. |
RO |
- |
Timers and Counters
|
Name |
Description |
R/W |
Unit |
|---|---|---|---|
"Tmr"
|
1ms count down timer Writing a value into the countdown timer will start the count down. The count down timer will decrement every 1ms
Range: 0 to +32,767 |
R/W |
1ms |
"Cnt"
|
1ms up counter The "Cnt" counter is a free running up counter. The counter can be set to any +ve value by writing to it.
Range: 0 to +2,147,783,647 |
R/W |
1ms |
Pushmode Variables
|
Name |
Description |
R/W |
Unit |
|---|---|---|---|
"PTmr"
|
Set the pushmode timer
|
R/W |
1ms |
"PV%"
|
Set the pushmode value
Range: 0 to 800 |
R/W |
0.1% of peak torque |
"PVal"
|
This variable has been deprecated. It is recommended to use "PV%" in new designs
|
R/W |
- |
Motion Variables
|
Name |
Description |
R/W |
Unit |
||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
"DPos"
|
Switch on/off dynamic positioning This function has been deprecated. It is recommended to use Direct Control for changing the target position during motion. When using the direct mode positioning command (^) the target position is not updated when a new P0 is set. "DPos" sets the behavior of the ^ function
|
R/W |
- |
||||||||||
"MOP"
|
Writing to "MOP" enables the direct control modes of operation
See Direct Control in the CM1-T user guide for information on how to use the modes. |
R/W |
- |
The motor controller uses an internal motion generator that calculates the 1ms position target. Writing to the variables will overwrite the next 1ms target. Caution should be taken if it cannot be guaranteed to write every 1ms as this could cause intermittent motion
|
Name |
Description |
R/W |
Unit |
|---|---|---|---|
"Pt"
|
Read the 1ms position target generated by the motion generator |
RO |
pulses |
"Dx"
|
Set the next position target
It is not recommended to use this variable unless it is guaranteed the value can be updated every 1ms.
|
R/W |
pulses |
"St"
|
Set the next speed target.
It is not recommended to use this variable unless it is guaranteed the value can be updated every 1ms.
|
R/W |
pulses |
Random Number
The "RND" variable provides a pseudo-random number generator that can be used anywhere a random value is required, for example randomised delays, dither, or test sequences.
|
Name |
Description |
R/W |
Unit |
|---|---|---|---|
"RND"
|
Random number
To produce a range that does not start at 0, set the range to (max - min) and subtract the offset. For example a span of 10 offset by -5 gives a value from -5 to +5. The variable must first be bound to the "RND" register as a setup step, outside any bank (for example V1="RND"). Reading or writing the bound variable then only works inside a program bank (B) or logic bank (L); it has no effect from the direct command line. Logic bank example - bind outside the banks, set the range once in an initialisation bank (L1), then read the value in a continuously running bank (L2):
V2 holds a fresh random number from -5 to +5 on every scan of L2. Program bank example - bind outside the bank, then set the range and read within it:
"RND" is automatically seeded at each power-up from internal hardware signals (a free-running timing counter and the analog inputs), so the sequence normally differs on every power cycle. No manual seeding is required. The seed entropy depends on the motor's analog state at power-up. If the motor is powered but de-energised and the shaft is held at the same position across power cycles, the starting value may repeat. "RND" is a statistical generator intended for general use and is not cryptographically secure. |
R/W |
- |
Data Retention
Two variables can be used to save data to non-volatile memory. Data will be written on a change.
|
Name |
Description |
R/W |
Unit |
|---|---|---|---|
"EEP1"
|
Memory 1 32 bit |
R/W |
- |
"EEP2"
|
Memory 2 32 bit |
R/W |
- |
The memory has a limited amount of writes. Caution should be taken to not excessively write to memory