# Interaction of the FB with the FBSD and error handling

The "FB state behaviour" state engine described in the PLCopen specification always refers to one axis. This is why it makes sense to keep this axis state in the PLC's axis-specific working data and to make it available to all FBs via the AXIS_REF structure. The index of the corresponding Ax-HLI interface is also noted in the AXIS_REF structure.

As the axis state is kept in the axis-specific working data of the PLC, it is obvious that this FBSD can initially only contain the command issuing state.

This is also expressed in the following PLCopen rule:

The axis is always in one of the defined states (see diagram below). Any motion job is a transition that changes the state of the axis …

When an FB receives a command, it must check the command's admissibility on the basis of the FBSD's current state.

## Additional information

- Error handling at the FBSD level
- Error handling at the FB level
- Defined errors at the FB level
- Axis errors from the motion controller