Usage

Initial setup

Before Piper can be used the library must be included and Machine Control package added. Machine Control package will add gMachine variable which will provide machine state status information, and a machine command interface that can be used by the rest of the system.

Adding substates

Substates can be added in the Machine Control package by editing the MachineControl.typ file. Substates will always flow in order so add and order substates as needed for the application.

Integrating with tasks

To interface with Piper a task requires two files. (1) A variable file where the Module and ModuleInferace is decalared and (2) the action file either in ST or C depending on the task which the interface is added. Once these two files are added, call the action in task cyclic code. Templatese can be found here.

Controlling machine state

Machine will remain in a Wait state until an action is commanded via gMachine or a Module responds with MACH_ST_ERROR. Each command is only valid in some states. See a list of commands here. While in an Acting state, Machine will wait in state until all Modules reply with “done”. Within each state Machine will cycle through substates as requested.

HMI Interface with Piper

For ease of use provided in the Machine Control package is a task used for machine control via HMI. The local machine commands and command status should be linked to the HMI instead of gMachine commands directly.

Example

Example can be downloaded here.