• 沒有找到結果。

2-1-2 Axis Variables

The variable names of the system-defined Axis Variables are _MC_AX[0..255], _MC1_AX[0..255], and _MC2_AX[0..255]. The data type is _sAXIS_REF, which is a structure.

This section describes the configuration of the Axis Variables and provides details on the members us-ing _MC_AX[0..255] as an example. The same information applies to _MC1_AX[0..255] and

_MC2_AX[0..255].

Name Data type Meaning Function

_MC_AX[0..255] _sAXIS_REF Axis Variable

Status _sAXIS_REF_STA Axis Status

Ready BOOL Axis

Ready-to-exe-cute

TRUE when preparations for axis execution are finished and the axis is stopped.

This variable gives the same status as

_MC_AX[*].Status.Standstill (TRUE: standstill).

Disabled BOOL Axis Disabled TRUE while the Servo is OFF for the axis.

The following axis status are mutually exclu-sive. Only one of them can be TRUE at a time.

Disabled, Standstill, Discrete, Continuous, Synchronized, Homing, Stopping, ErrorStop, or Coordinated

Standstill BOOL Standstill TRUE while the Servo is ON for the axis.

Discrete BOOL Discrete Motion TRUE while position control is executed toward the target position.

This includes when the velocity is 0 because the override factor was set to 0 during a dis-crete motion.

Continuous BOOL Continuous Motion TRUE during continuous motion without a tar-get position.

This state exists during velocity control and tor-que control.

This includes when the velocity is 0 because the target velocity is set to 0 and when the ve-locity is 0 due to an override factor set to 0 dur-ing continuous motion.

Synchronized BOOL Synchronized Motion TRUE during execution of synchronized con-trol.

This includes waiting for synchronization after changing to synchronized control instructions.

Homing BOOL Homing TRUE when homing for the MC_Home or

MC_HomeWithParameter instruction.

Stopping BOOL Deceleration

Stop-ping

TRUE until the axis stops for a MC_Stop or MC_TouchProbe instruction.

This includes when Execute is TRUE after the axis stops for an MC_Stop instruction.

Axis motion instructions are not executed while decelerating to a stop.

(CommandAborted is TRUE)

ErrorStop BOOL Error Deceleration

Stopping

This status exists when the axis is stopping or stopped for execution of the MC_Imdediate-Stop instruction or a minor fault (while

_MC_AX[*].MFaultLvl.Active is TRUE (Axis Mi-nor Fault Occurrence).

Axis motion instructions are not executed in this state.

(CommandAborted is TRUE)

Coordinated BOOL Coordinated Motion TRUE when an axes group is enabled by a multi-axes coordinated control instruction.

Details _sAXIS_REF_DET Axis Control Status*1

2-1 Variables

2

2-1-2 Axis Variables

Name Data type Meaning Function

Idle BOOL Idle TRUE when processing is not currently

per-formed for the command value, except when waiting for in-position state.*2

Idle and InPosWaiting are mutually exclusive.

They cannot both be TRUE at the same time.

InPosWaiting BOOL In-position Waiting TRUE when waiting for in-position state.

The in-position check is performed when posi-tioning for the in-position check.

Homed BOOL Home Defined TRUE when home is defined.*3

TRUE: Home defined FALSE: Home not defined

InHome BOOL In Home Position TRUE when the axis is in the range for home.

It gives an AND of the following conditions.

Home defined

The actual current position is in the zero po-sition range with home as the center.

TRUE also when the zero position is passed by while the axis is moving in command status.

VelLimit*4 BOOL Command Velocity

Saturation

TRUE while the axis velocity is held to the max-imum velocity during synchronized control.

Dir _sAXIS_REF_DIR Command Direction*5

Posi BOOL Positive Direction TRUE when there is a command in the positive

direction.

Nega BOOL Negative Direction TRUE when there is a command in the

nega-tive direction.

DrvStatus

_sAX-IS_REF_STA_DRV Servo Drive Status*6

ServoOn BOOL Servo ON TRUE when the Servomotor is powered.

Ready BOOL Servo Ready TRUE when the Servo is ready.

MainPower BOOL Main Power TRUE when the Servo Drive main power is ON.

P_OT BOOL Positive Limit Input TRUE when the positive limit input is enabled.

N_OT BOOL Negative Limit Input TRUE when the negative limit input is enabled.

HomeSw BOOL Home Proximity Input TRUE when the home proximity input is ena-bled.

Home BOOL Home Input TRUE when the home input is enabled.*7

ImdStop BOOL Immediate Stop Input TRUE when the immediate stop input is ena-bled.

Latch1 BOOL External Latch Input

1

TRUE when latch input 1 is enabled.

Latch2 BOOL External Latch Input

2

TRUE when latch input 2 is enabled.

DrvAlarm BOOL Drive Error Input TRUE while there is a Servo Drive error.

DrvWarning BOOL Drive Warning Input TRUE while there is a Servo Drive warning.

ILA BOOL Drive Internal

Limit-ing

TRUE when the Servo Drive limiting function actually limits the axis.*8

CSP BOOL Cyclic Synchronous

Position (CSP) Con-trol Mode

TRUE when the Servo is ON at the Servo Drive and the current mode is CSP Mode.*9

Name Data type Meaning Function

CSV BOOL Cyclic Synchronous

Velocity (CSV) Con-trol Mode

TRUE when the Servo is ON at the Servo Drive and the current mode is CSV Mode.*9

CST BOOL Cyclic Synchronous

Torque (CST) Control Mode

TRUE when the Servo is ON at the Servo Drive and the current mode is CST Mode.*9

Cmd _sAXIS_REF_CMD_

DATA

Axis Command Value

Pos LREAL Command Current

Position

Contains the current value of the command po-sition. (Unit: command units)

When the Servo is OFF and the mode is not position control mode, this variable contains the actual current position.*10

Vel LREAL Command Current

Velocity

Contains the current value of the command ve-locity. (Unit: command units/s)

A plus sign is added when traveling in the posi-tive direction, and a minus sign when traveling in the negative direction.

The velocity is calculated from the difference with the command current position. When the Servo is OFF and the mode is not the position control mode, the velocity is calculated based on the actual current position.

AccDec LREAL Command Current

Acceleration/Deceler-ation

Contains the current value of the command ac-celeration/deceleration rate. (Unit: command units/s2)

The acceleration/deceleration rate is calculated from the difference with the command current velocity. A plus sign is added for acceleration, and a minus sign is added for deceleration.

Zero when the command acceleration/deceler-ation rate of the instruction under execution is 0.

Jerk LREAL Command Current

Jerk

Contains the current value of the command jerk. (Unit: command units/s3)

A plus sign is added when the absolute value of acceleration/deceleration is increasing, and a minus sign is added when it is decreasing.

Zero when the command acceleration/deceler-ation rate and command jerk of the instruction under execution is 0.

Trq LREAL Command Current

Torque

Contains the current value of the command tor-que. (Unit: %)

A plus sign is added when traveling in the posi-tive direction, and a minus sign when traveling in the negative direction.

Contains the same value as the actual current torque except in torque control mode.

Act _sAXIS_REF_ACT_

DATA

Axis Current Value

Pos LREAL Actual Current

Posi-tion

Contains the actual current position. (Unit: com-mand units)*10

2-1 Variables

2

2-1-2 Axis Variables

Name Data type Meaning Function

Vel LREAL Actual Current

Veloc-ity

Contains the actual current velocity. (Unit: com-mand units/s)

A plus sign is added when traveling in the posi-tive direction, and a minus sign when traveling in the negative direction.

Trq LREAL Actual Current

Tor-que

Contains the current value of the actual torque.

(Unit: %)

A plus sign is added when traveling in the posi-tive direction, and a minus sign when traveling in the negative direction.

TimeStamp*11 ULINT Time Stamp Contains the time when the current position of the axis was updated. This variable is valid for an axis for which time stamping is operating.

(Unit: ns) MFaultLvl _sMC_REF_EVENT Axis Minor Fault

Active BOOL Axis Minor Fault

Oc-currence

TRUE while there is an axis minor fault.

Code WORD Axis Minor Fault

Code

Contains the code for an axis minor fault.

The upper four digits of the event code have the same value.

Obsr _sMC_REF_EVENT Axis Observation

Active BOOL Axis Observation

Oc-currence

TRUE while there is an axis observation.

Code WORD Axis Observation

Code

Contains the code for an axis observation.

The upper four digits of the event code have the same value.

Cfg _sAXIS_REF_CFG Axis Basic Settings*12

AxNo UINT Axis Number Contains the logical number of the axis.

This number is accessed to recognize the axis number when accessing _sAXIS_REF.

AxEnable _eMC_AXIS_USE Axis Use Shows if the axis is enabled or disabled.

0: _mcNoneAxis (Undefined Axis) 1: _mcUnusedAxis (Unused Axis) 2: _mcUsedAxis (Used Axis)

AxType _eMC_AXIS_TYPE Axis Type Contains the axis type.

I/O wiring is not required for virtual axes.

0: _mcServo (Servo Axis) 1: _mcEncdr (Encoder Axis) 2: _mcVirServo (Virtual Servo Axis) 3: _mcVirEncdr (Virtual Encoder Axis) NodeAddress UINT Node Address Contains the EtherCAT slave address.*13

A value of 16#FFFF indicates that there is no address.

ExecID*14 UINT Execution ID Contains the task execution ID.

0: Not assigned to task (undefined axis) 1: Assigned to primary periodic task 2: Assigned to priority-5 periodic task Scale _sAXIS_REF_SCALE Unit Conversion Settings*15

Name Data type Meaning Function

Num UDINT Command Pulse

Count Per Motor Ro-tation

Contains the number of pulses per motor rota-tion for command posirota-tions.

The command value is converted to a number of pulses based on the electronic gear ratio.

Den LREAL Work Travel Distance

Per Motor Rotation

Contains the workpiece travel distance per mo-tor rotation for command positions.*16

Units _eMC_UNITS Unit of Display Contains the display unit for command posi-tions.

0: _mcPls(pulse) 1: _mcMm(mm) 2: _mcUm(μm) 3: _mcNm(nm) 4: _mcDeg(degree) 5: _mcInch(inch)

CountMode*14 _eMC_COUNT_MODE Count Mode Contains the count mode.

0: _mcCountModeLinear (Linear Mode) 1: _mcCountModeRotary (Rotary Mode)

MaxPos*14 LREAL Maximum current

po-sition

Contains the maximum value of the current po-sition indication.*17

MinPos*14 LREAL Minimum current

po-sition

Contains the minimum value of the current po-sition indication.*18

*1. Gives the control status of the command.

*2. This also includes states where processing is performed while in motion at velocity 0, during following error counter resets, during synchronized control, and during multi-axes coordinated control motion.

*3. Even if the variable is TRUE, the home must be defined again in the following cases.

When you make a change in the position count settings or the unit conversion settings.

If an error or erroneous operation occurs on the Servo Drive, which leads to loss of absolute position data. Exam-ples of errors and erroneous operations include breaks of encoder cables and clear of absolute encoder data.

*4. Use VelLimit only for a slave axis that is currently in synchronized control.

*5. Gives the command travel direction.

*6. Gives the status of the Servo Drive or other device.

*7. This variable shows the status of the signal that is set for Encoder Z-Phase Search of Digital inputs in the Detailed Settings Area of the Axis Basic Settings Display of the Sysmac Studio. You may not be able to map this signal to a PDO for a servo driver from another manufacturer. Refer to the manual for the servo driver.

*8. This variable shows the status of bit 11(internal limit active) of the Status word (6041 hex) mapped to a PDO. The con-dition for it to change to TRUE depends on the specifications of the Servo Drive. Refer to the manual for the servo driver. For the OMRON 1S-series Servo Drive or G5-series Servo Drive, this variable gives one of the following limits:

torque limits, velocity limit, drive prohibit inputs, and software limits.

*9. These variables are based on the value of the Modes of operation display (6061 hex) mapped to a PDO. The condi-tions for CSP, CSV, and CST to change to TRUE depend on the specificacondi-tions of the Servo Drive. Refer to the manual for the servo driver.

If the Modes of Operation Display (6061 hex) is not mapped to a PDO, the values of these variables depend on the unit version of the CPU Unit as follows:

For a CPU Unit with unit version 1.10 or later, they are TRUE when the status of the Statusword (6041 hex) that was mapped to a PDO is Operation Enabled.

For a CPU Unit with unit version 1.09 or earlier, they are always FALSE.

*10. Operation when process data communications is not established between the CPU Unit and an EtherCAT slave as-signed to an axis or between the CPU Unit and an NX Unit depends on the version of the CPU Unit as follows:

For CPU Unit version 1.10 or later, the actual current position and command current position in the Axis Variable will be the actual current position from just before process data communications changed to a non-established state.

For CPU Unit version 1.09 or earlier, the actual current position and command current position in the Axis Variable will be either 0 or the lower limit value. The lower limit value is used when the Count Mode is set to Rotary Mode and 0 is not included in the positioning range.

2-1 Variables

2

2-1-2 Axis Variables

*11. A CPU Unit with unit version 1.06 or later and Sysmac Studio version 1.07 or higher are required to use this variable.

*12. This variable shows the settings in the Axis Basic Settings.

*13. For an NX-series Position Interface Unit, this is the node address of the EtherCAT Coupler Unit under which the Posi-tion Interface Unit is mounted.

*14. A CPU Unit with unit version 1.10 or later and Sysmac Studio version 1.12 or higher are required to use this variable.

*15. This variable shows the settings of the electronic gear ratio.

*16. The parameter is disabled if you set to use a reducer in the unit conversion settings, which is the function added for CPU Units with unit version 1.11 or later. To confirm alternatively enabled parameters, i.e. Work Travel Distance Per Rotation, Work Gear Ratio, and Motor Gear Ratio, use the MC_ReadAxisParameter (Read Axis Parameters) in-struction.

*17. If the Count Mode is set to Linear Mode, the position just before an overflow is given. In Rotary Mode, the modulo maximum position is given.

*18. If the Count Mode is set to Linear Mode, the position just before an underflow is given. In Rotary Mode, the modulo minimum position is given.