Controller Status Functions
The Automation1 controller allows for the retrieval of various status items at runtime. These items provide useful information about the current state of the controller. Many of the status items are dependent on the current units of the controller. Refer to UnitsName Parameter for more information.
Status items can be retrieved from these areas of the controller:
- Axis - configures the behavior of axes and motors
- Task - configures the behavior of tasks and program execution
- System - configures global behaviors of the controller
Each status item function has an overload that contains an additional data argument. For some data items, this argument is used to provide context. See the data items in the tables that follow for more information.
While the motion engine of the controller runs at a rate of 1KHz, it is possible to collect data at an increased rate by using the Fast functions. These functions return an array of values that are proportional to the supplied sample rate. To see the supported motion rates, refer to Motion Functions.
Axis
function StatusGetAxisItem($axis as axis, $statusItem as AxisStatusItem) as real
Gets the specified status item value from the specified axis.
Arguments
$axis The axis from which to retrieve the status item value.
$statusItem The status item to retrieve.
Returns
The value of the specified axis status item.
function StatusGetAxisItem($axis as axis, $statusItem as AxisStatusItem, $additionalData as integer) as real
Gets the specified status item value from the specified axis.
Arguments
$axis The axis from which to retrieve the status item value.
$statusItem The status item to retrieve.
$additionalData Additional data for the specified status item. This argument is required by some status items.
Returns
The value of the specified axis status item.
function StatusGetAxisItemFast($axis as axis, $statusItem as AxisStatusItem, $additionalData as integer, $sampleRate as integer, ref $values[] as real)
Gets the specified status item value from the specified axis at a rate that is faster than 1 kHz.
Arguments
$axis The axis from which to retrieve the status item value.
$statusItem The status item to retrieve.
$additionalData Additional data for the specified status item. This argument is required by some status items. If additional data is not required, specify a value of 0 for this argument.
$sampleRate The number of samples to collect. This must be 1, 10, 20, 50, or 100.
ref $values An array variable in which to retrieve the data. The length of the variable must be sufficient to store the number of samples that are specified by the $sampleRate argument.
enum AxisStatusItem
PositionFeedback = 0 PositionCommand = 1 PositionError = 2 VelocityFeedback = 3 VelocityCommand = 4 VelocityError = 5 AccelerationCommand = 6 CurrentFeedback = 7 CurrentCommand = 8 CurrentError = 9 AnalogInput0 = 10 AnalogInput1 = 11 PositionCommandRaw = 12 VelocityCommandRaw = 13 AuxiliaryFeedback = 14 DigitalInput = 15 DigitalOutput = 16 WorkOffsetValue = 18 AnalogInput2 = 23 AnalogInput3 = 24 AnalogOutput0 = 31 AnalogOutput1 = 32 AnalogOutput2 = 33 AnalogOutput3 = 34 PsoStatus = 38 CoordinatedPositionTarget = 41 DriveStatus = 42 AxisStatus = 43 AxisFault = 44 AccelerationCommandRaw = 45 PositionCalibrationAll = 50 PositionFeedbackRollover = 63 PositionCommandRollover = 64 VelocityFeedbackAverage = 65 CurrentFeedbackAverage = 66 AxisParameter = 68 Backlash = 72 HomeState = 73 PositionCalibration2D = 74 NormalcyDebug = 75 TotalMoveTime = 76 PositionFeedbackDrive = 77 JerkCommandRaw = 78 ProgramPositionCommand = 79 PositionOffset = 80 PositionCommandRawBackwardsDiff = 82 VelocityCommandRawBackwardsDiffDelta = 83 PositionCommandDrive = 84 DriveStatusActual = 85 WorkOffsetIndex = 88 ProgramPositionFeedback = 89 JogTrajectoryStatus = 94 PingTest = 95 AccelerationTime = 109 DecelerationTime = 110 AccelerationRate = 111 DecelerationRate = 112 AccelerationType = 113 DecelerationType = 114 AccelerationMode = 115 DecelerationMode = 116 ProgramPosition = 124 SpeedTarget = 128 PositionCommandPacket = 131 DriveSmcMotionState = 132 PositionCommandRawCal = 140 VelocityCommandRawCal = 141 VelocityCommandDrive = 142 AccelerationCommandDrive = 143 GalvoLaserOutputRaw = 144 DriveInterfacePacketInt32 = 147 DriveInterfacePacketInt16 = 148 DriveInterfacePacketInt8 = 149 DriveInterfacePacketDouble = 150 DriveInterfacePacketFloat = 151 DriveInterfaceCommandCode = 152 AccelerationFeedback = 153 AccelerationCommandRawCal = 154 PositionCalibrationAllDrive = 155 BacklashTarget = 156 DriveMotionRate = 158 DriveMotionDelay = 159 CalibrationAdjustmentValue = 160 ServoLoopFeedforwardControlEffortRaw = 162 DriveInterfacePacketInfoBitValue = 164 AccelerationError = 165 SuppressedFaults = 167 DriveInterfacePacketStreamingData = 168 PositionCommandRawUnfiltered = 169 TransitionOffsetErrors = 170 FreezeVelocityCommand = 179 FreezeVelocityFeedback = 180 InternalPositionOffsets = 181 StatusHighLevelOffsetsLastMsec = 182 ProgramVelocityCommand = 183 ProgramVelocityFeedback = 184 DriveMotionDelayLive = 185 DriveCommunicationDelay = 186 DriveCommunicationDelayLive = 187 DriveInterfacePacketResponseInt32 = 189 DriveInterfacePacketResponseInt16 = 190 DriveInterfacePacketResponseInt8 = 191 DriveInterfacePacketResponseDouble = 192 DriveInterfacePacketResponseFloat = 193 DriveInterfacePacketBit = 194 DriveInterfacePacketResponseBit = 195 SpeedTargetActual = 196 CoordinatedDistanceRemaining = 199 AmplifierPeakCurrent = 211 ServoUpdateRate = 220 SafeZoneState = 230 PositionErrorGalvo = 235 MoveReferencePosition = 237 MoveReferenceOffsetCutterRadius = 250 MoveReferenceOffsetCornerRounding = 251 MoveReferenceOffsetTotal = 252 PiezoVoltageCommand = 262 PiezoVoltageFeedback = 263 DistanceLog = 264 MaximumVoltage = 274 CommandOutputType = 275 GalvoLaserOutputRawAdvance = 296 GalvoLaserOnDelay = 297 GalvoLaserOffDelay = 298 CalibrationAdjustmentState = 301 AccuracyCorrectionStartingPosition = 302 AccuracyCorrectionEndingPosition = 303 DriveCommandsDelayed = 309 DriveCommandsLost = 310 StoStatus = 327 DriveAssert = 336 PrimaryFeedback = 366 AccelerationSCurvePercentage = 371 DecelerationSCurvePercentage = 372 DriveArraySize = 388 GantryMarkerDifference = 390 PrimaryFeedbackStatus = 392 HomeTargetPosition = 398 GantryRealignmentMoveTargetPosition = 399 GantryDriveControlRealignmentState = 400 DriveInterfacePositionCommandPhysical = 434 DriveControlReason = 435 SyncPortAPosition = 444 SyncPortBPosition = 445 AnalogOutput4 = 467 AnalogOutput5 = 468 MoveReferenceOffsetCutterOffset = 471 end |
How to Use Axis Status Functions
Program Example: Determine if an Axis is Enabled
// Determine if the Enabled bit of the DriveStatus item is set on axis X. var $isEnabled $isEnabled = (StatusGetAxisItem(X, AxisStatusItem.DriveStatus, DriveStatus.Enabled) == DriveStatus.Enabled)
Program Example: Determine if an Axis is Homed
// Determine if the Homed bit of the AxisStatus item is set on axis X. var $isHomed $isHomed = (StatusGetAxisItem(X, AxisStatusItem.AxisStatus, AxisStatus.Homed) == AxisStatus.Homed)
Example: Determine if motion is done being commanded on an axis
// Determine if the MotionDone bit of the AxisStatus item is set on axis X. var $isMotionDone $isMotionDone = (StatusGetAxisItem(X, AxisStatusItem.AxisStatus, AxisStatus.MotionDone) == AxisStatus.MotionDone)
Read the Position Command of an axis
// Retrieve the Position Command on axis X. var $positionCommand $positionCommand = StatusGetAxisItem(X, AxisStatusItem.PositionCommand)
Example: Read the Position Feedback of an axis
// Retrieve the Position Feedback on axis X. var $positionFeedback $positionFeedback = StatusGetAxisItem(X, AxisStatusItem.PositionFeedback)
Example: Read the Program Position of an axis
// Retrieve the Program Position on axis X. var $programPosition $programPosition = StatusGetAxisItem(X, AxisStatusItem.ProgramPosition)
Task
function StatusGetTaskItem($taskIndex as integer, $statusItem as TaskStatusItem) as real
Gets the specified status item value from the specified task.
Arguments
$taskIndex The task from which to retrieve the status item value.
$statusItem The status item to retrieve.
Returns
The value of the specified task status item.
function StatusGetTaskItem($taskIndex as integer, $statusItem as TaskStatusItem, $additionalData as integer) as real
Gets the specified status item value from the specified task.
Arguments
$taskIndex The task from which to retrieve the status item value.
$statusItem The status item to retrieve.
$additionalData Additional data for the specified status item. This argument is required by some status items.
Returns
The value of the specified task status item.
function StatusGetTaskItemFast($taskIndex as integer, $statusItem as TaskStatusItem, $additionalData as integer, $sampleRate as integer, ref $values[] as real)
Gets the specified status item value from the specified task at a rate that is faster than 1 kHz.
Arguments
$taskIndex The task from which to retrieve the status item value.
$statusItem The status item to retrieve.
$additionalData Additional data for the specified status item. This argument is required by some status items. If additional data is not required, specify a value of 0 for this argument.
$sampleRate The number of samples to collect. This must be 1, 10, 20, 50, or 100.
ref $values An array variable in which to retrieve the data. The length of the variable must be sufficient to store the number of samples that are specified by the $sampleRate argument.
enum TaskStatusItem
ProgramLineNumber = 17 CoordinatedFlags = 40 CoordinatedArcStartAngle = 53 CoordinatedArcEndAngle = 54 CoordinatedArcRadius = 55 CoordinatedArcRadiusError = 56 CoordinatedPositionCommand = 57 CoordinatedSpeedCommand = 58 CoordinatedAccelerationCommand = 59 CoordinatedTotalDistance = 60 CoordinatedPercentDone = 61 CoordinatedPositionCommandBackwardsDiff = 62 TaskParameter = 69 TaskError = 70 TaskWarning = 71 CoordinatedSpeedTargetActual = 86 DependentCoordinatedSpeedTargetActual = 87 TaskStatus0 = 90 TaskStatus1 = 91 TaskStatus2 = 92 SpindleSpeedTarget = 93 CoordinateSystem1I = 96 CoordinateSystem1J = 97 CoordinateSystem1K = 98 CoordinateSystem1Plane = 99 Mfo = 101 CoordinatedSpeedTarget = 102 DependentCoordinatedSpeedTarget = 103 CoordinatedAccelerationRate = 104 CoordinatedDecelerationRate = 105 CoordinatedAccelerationTime = 106 CoordinatedDecelerationTime = 107 TaskMode = 108 TaskState = 117 TaskStateInternal = 118 ExecutionMode = 121 EnableAlignmentAxes = 127 CoordinatedGalvoLaserOutput = 133 CoordinatedMotionRate = 145 CoordinatedTaskCommand = 146 EnableState = 166 LookaheadMovesExamined = 200 ProfileControlMask = 231 CoordinatedArcRadiusReciprocal = 253 MotionEngineStage = 254 CoordinatedTimeScale = 256 CoordinatedTimeScaleDerivative = 257 IfovSpeedScale = 266 IfovSpeedScaleAverage = 267 IfovGenerationFrameCounter = 268 IfovGenerationTimeOriginal = 269 IfovGenerationTimeModified = 270 IfovCoordinatedPositionCommand = 271 IfovCoordinatedSpeedCommand = 272 IfovCenterPointH = 276 IfovCenterPointV = 277 IfovTrajectoryCount = 278 IfovTrajectoryIndex = 279 IfovAttemptCode = 280 IfovGenerationFrameIndex = 281 IfovMaximumVelocity = 282 IfovIdealVelocity = 283 TaskInternalDebug = 284 IfovCoordinatedAccelerationCommand = 285 IfovFovPositionH = 286 IfovFovPositionV = 287 IfovFovDimensionH = 288 IfovFovDimensionV = 289 MotionBufferElements = 311 MotionBufferMoves = 312 MotionLineNumber = 313 MotionBufferRetraceMoves = 314 MotionBufferRetraceElements = 315 MotionBufferIndex = 316 MotionBufferIndexLookahead = 317 MotionBufferProcessingBlocked = 318 ActiveMoveValid = 319 TaskExecutionLines = 320 SchedulerTaskHolds = 321 SchedulerProgramLoopRuns = 322 SchedulerTaskBlocked = 323 CriticalSectionsActive = 324 AxesSlowdownReason = 331 TaskExecutionTime = 333 TaskExecutionTimeMaximum = 334 TaskExecutionLinesMaximum = 335 LookaheadDecelReason = 338 LookaheadDecelMoves = 339 LookaheadDecelDistance = 340 ProgramCounter = 341 StackPointer = 342 FramePointer = 343 StringStackPointer = 344 ProgramLineNumberSourceFileId = 349 MotionLineNumberSourceFileId = 350 ProgramLineNumberSourcePathId = 351 MotionLineNumberSourcePathId = 352 StringArgumentStackPointer = 354 CoordinatedAccelerationSCurvePercentage = 369 CoordinatedDecelerationSCurvePercentage = 370 DependentCoordinatedAccelerationRate = 373 DependentCoordinatedDecelerationRate = 374 CriticalSectionTimeout = 375 CommandQueueCapacity = 421 CommandQueueUnexecutedCount = 422 CommandQueueTimesEmptied = 423 CommandQueueExecutedCount = 424 CommandQueueLineNumber = 452 TaskReal = 469 TaskInteger = 470 end |
How to Use Task Status Functions
The examples that follow show you how to retrieve some task status items.
Example: Read the Task State of an AeroScript task
// Read the Task State of Task 2. See the TaskState enum for more information. var $programLineNumber $programLineNumber = StatusGetTaskItem(2, TaskStatusItem.TaskState)
Example: Read the Program Line Number of an AeroScript program
// Read the Program Line Number of the currently running task. var $programLineNumber $programLineNumber = StatusGetTaskItem(TaskGetIndex(), TaskStatusItem.ProgramLineNumber)
System
function StatusGetSystemItem($statusItem as SystemStatusItem) as real
Gets the specified system status item value.
Arguments
$statusItem The status item to retrieve.
Returns
The value of the specified system status item.
function StatusGetSystemItem($statusItem as SystemStatusItem, $additionalData as integer) as real
Gets the specified system status item value.
Arguments
$statusItem The status item to retrieve.
$additionalData Additional data for the specified status item. This argument is required by some status items.
Returns
The value of the specified system status item.
enum SystemStatusItem
VirtualBinaryInput = 46 VirtualBinaryOutput = 47 VirtualRegisterInput = 48 VirtualRegisterOutput = 49 Timer = 51 TimerPerformance = 52 GlobalReal = 67 CommunicationRealTimeErrors = 81 LibraryCommand = 119 DataCollectionSampleTime = 120 DataCollectionSampleIndex = 129 ModbusClientConnected = 134 ModbusServerConnected = 135 ModbusClientError = 136 ModbusServerError = 137 StopWatchTimer = 157 ScopetrigId = 163 EstimatedProcessorUsage = 177 DataCollectionStatus = 188 SignalLogState = 198 SafeZoneViolationMask = 207 SafeZoneActiveMask = 229 ModbusClientInputWords = 240 ModbusClientOutputWords = 241 ModbusClientInputBits = 242 ModbusClientOutputBits = 243 ModbusClientOutputBitsStatus = 244 ModbusClientOutputWordsStatus = 245 ModbusServerInputWords = 246 ModbusServerOutputWords = 247 ModbusServerInputBits = 248 ModbusServerOutputBits = 249 SystemParameter = 265 ThermoCompSensorTemperature = 305 ThermoCompControllingTemperature = 306 ThermoCompCompensatingTemperature = 307 ThermoCompStatus = 308 GlobalInteger = 345 AliveAxesMask = 348 SignalLogPointsStored = 377 ControllerInitializationWarning = 379 StopWatchTimerMin = 416 StopWatchTimerMax = 417 StopWatchTimerAvg = 418 EthercatEnabled = 428 EthercatError = 429 EthercatTxPdo = 430 EthercatTxPdoSize = 431 EthercatRxPdo = 432 EthercatRxPdoSize = 433 EthercatState = 437 ModbusClientEnabled = 438 ModbusServerEnabled = 439 HyperWireExternalSynchronizationActive = 440 HyperWireExternalSynchronizationFrequency = 441 HyperWireExternalSynchronizationLagging = 442 HyperWireExternalSynchronizationAdjustmentNanoseconds = 443 CallbackSlotProcessingState = 453 ControllerAssertCount = 457 VirtualBinaryInputBit = 472 VirtualBinaryOutputBit = 473 EtherNetIpAdapterEnabled = 474 EtherNetIpAdapterConnected = 475 EtherNetIpAdapterError = 476 EtherNetIpAdapterInputIntegerSize = 477 EtherNetIpAdapterInputFloatSize = 478 EtherNetIpAdapterOutputIntegerSize = 479 EtherNetIpAdapterOutputFloatSize = 480 end |
How to Use System Status Functions
The example that follows shows you how to retrieve a system status item.
Example: Get the value of a Timer
// Read the value of Timer 0 using a system status item instead of TimerRead(). var $timer as real $timer = StatusGetSystemItem(SystemStatusItem.Timer, 0)