MC-Basic:IDNSTATE

From SoftMC-Wiki
Revision as of 09:24, 22 May 2014 by Miborich (talk | contribs) (Text replace - "Axystems:" to "")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This function returns the state of a specified procedure command from a specified drive. It is used when executing a procedure command to determine progress of that procedure’s execution. Common procedures are 99 (clear faults) and 148 (drive-controlled homing). The value returned indicates the state of the procedure, as:
       0: Finished or Not started
       3: Done
       5: Interrupted
       7: Running
       15: Error

After starting a procedure, wait until the state has changed. This can be checked via drive status bit 5 or <axis>.PROCEDURECHANGEBIT. Check the state of the procedure to know whether it is done or whether an error has occurred. A procedure is interrupted only if it is cancelled during execution.

Short form

Istat

Syntax

?IdnState (<drive address>, <IDN>)

Availability

All versions

Range

<drive address>: 1 to 254
<IDN>: 1 to 65535

Scope

Task or Terminal

Limitations

  • Read only.
  • May be executed only in SERCOS communication phases 2, 3 and 4.
  • The IDN must be defined.
  • Not supported in EtherCAT system

Examples

WriteIdnValue Drive = A1.Dadd Idn = 99 Value = 3           ‘Start Procedure

While A1.PCB = 0                                      ‘Wait for procedure to terminate

End While

If IdnState(a1.dadd, 99) <> 3 then               ‘Check how procedure terminated
       Print “Reset Faults procedure failed

End If

WriteIdnValue Drive = A1.Dadd Idn = 99 Value = 0           ‘Cancel Procedure

See Also