beautypg.com

Internal variables & keywords, Examples – Yaskawa SMC–4000 User Manual

Page 335

background image

325

SMC–4000 User Manual

Internal Variables & Keywords

Internal variables allow motion or status parameters from SMC–4000 commands to be incorporated into
programmable variables and expressions. Internal variables are designated by adding an underscore (_)
prior to the SMC–4000 command. SMC–4000 commands which can be used as internal variables are
listed in the Command Reference as "Used as an Operand".

Most SMC–4000 commands can be used as internal variables. Status commands such as Tell Position
return actual values, whereas action commands such as GN or SP return the values in the SMC–4000
registers. The X,Y,Z or W or A,B,C,D,E,F,G,H for the SMC–4000, axis designation is required following
the command.

Examples:

Internal variables can be used in an expression and assigned to a programmable variable, but they cannot
be assigned a value. For example: _KDX=2 is invalid.

The SMC–4000 also provides a few keywords which give access to internal variables that are not
accessible by standard SMC–4000 commands.

Examples:

POSX=_TPX

Assigns value from Tell Position X to the variable POSX.

JP #LOOP,_TEX>5

Jump to #LOOP if the position error of X is greater than 5

JP #ERROR,_TC=1

Jump to #ERROR if the error code equals 1.

Keyword

Function

_BGX or _BGY or _BGW

Motion Done if 1. Moving if 0.

_LFX or _LFY or _LFZ or_LFW

Forward Limit (equals 0 or 1)

_LRX or _LRY or _LRZ or LRW

Reverse Limit (equals 0 or 1)

TIME

Free-Running Real Time Clock* (off by 2.4% - Reset

on power-on). Note: TIME does not use _.

_HMX or _HMY or _HMZ or HMW

Home Switch (equals 0 or 1)

V1=_LFX

Assign V1 the logical state of the Forward Limit Switch on the X-axis

V3=TIME

Assign V3 the current value of the time clock

V4=_HMW

Assign V4 the logical state of the Home input on the W-axis