Structures
Atn_typ
Director type used to command actions.
director
| Name | Type | Description |
|---|---|---|
| in | AtnIn_typ | Structure containing all inputs for director |
| out | AtnOut_typ | Structure containing all outputs for director |
director.in
| Name | Type | Description |
|---|---|---|
| cmd | AtnInCmd_typ | Commands for director |
| par | AtnInPar_typ | Parameters for director |
director.in.cmd
| Name | Type | Description |
|---|---|---|
| abort | BOOL | Aborts current action |
| forceQuit | BOOL | Quits a current action, forcing director back into idle and skipping the abort state |
director.in.par
| Name | Type | Description |
|---|---|---|
| namespace | STRING | Namespace to be used to run actions |
| ID | USINT | ID provided to actions when blocked by busy action |
director.out
| Name | Type | Description |
|---|---|---|
| activeThreads | AtnActiveThread_typ[] | Status information on active threads |
| blocked | BOOL | Director is blocked by action |
| busy | BOOL | Action in progress |
| done | BOOL | Action completed, this will stay true for 1 fn call |
| error | BOOL | Error during operation |
director.out.activeThreads
| Name | Type | Description |
|---|---|---|
| name | STRING | Name of action, max length of ATN_ACTION_NAME_LEN |
| busyModule | UDINT[] | An array of pointers to modules (AtnAPI_typ) that are reporting busy |
| errorModule | UDINT[] | An array of pointers to modules (AtnAPI_typ) that are reporting error |
| status | AtnOutStatus_typ | Status of Thread |
director.out.activeThreads.status
| Name | Type | Description |
|---|---|---|
| busy | BOOL | Action in progress |
| done | BOOL | Action completed, this will stay true for 1 fn call |
| error | BOOL | Error during operation |
AtnApiStatus_typ
Status type used for feedback for action calls.
| Name | Type | Description |
|---|---|---|
| active | BOOL | |
| busy | BOOL | Action in progress |
| done | BOOL | Action completed, this will stay true for 1 fn call |
| aborted | BOOL | Action aborted |
| error | BOOL | Action had an error |
AtnAPI_typ
Module type used for registered actions.
| Name | Type | Description |
|---|---|---|
| moduleName | STRING[80] | Name of module, for debug |
| moduleStatus | STRING[80] | Description of current status of module, for debug |
| request | STRING | Name of action calling module |
| state | ATN_ST_enum | Current state of action |
| response | ATN_ST_enum | Response of module. When response is equal to state, module is done |
| moduleBypass | BOOL | Sets module to be bypassed |
| moduleIsBypassed | BOOL | Feedback from director that module is being bypassed |
AtnActionData_typ
Used internally to store registered actions.
| Name | Type | Description |
|---|---|---|
| name | STRING | Name of action, max length of ATN_ACTION_NAME_LEN |
| pParameters | UDINT | Pointer location of where parameters should be passed to action |
| parameterSize | UDINT | Size of location for parameters |
| pAction | atnAPI_typ* | Pointer module |
ATN_ST_enum
States used by Modules and Actions.
| Name | Value | Description |
|---|---|---|
| ATN_IDLE | Action is idle and ready for next command | |
| ATN_EXECUTE | Action is being executed | |
| ATN_ABORT | Action is being aborted | |
| ATN_ERROR | An error occurred | |
| ATN_BYPASSED | Action is being bypassed |
ATN_ERROR_enum
Status enum for ATN functions.
| Name | Value | Description |
|---|---|---|
| ATN_ERROR_OK | No error | |
| ATN_ERROR_ACTIVE | Active | |
| ATN_ERROR_ABORTED | Aborted | |
| ATN_ERROR_ACTIONS_FULL | Action list is full | |
| ATN_ERROR_BUSY | Busy |
ATN_RESPONSE_ST
Internal responses between Threads and Directors.
| Name | Value | Description |
|---|---|---|
| ATN_RESPONSE_ST_NONE | None | |
| ATN_RESPONSE_ST_ERROR | Error | |
| ATN_RESPONSE_ST_STEP_DONE | Step completed | |
| ATN_RESPONSE_ST_NEXT_STEP | Next step | |
| ATN_RESPONSE_ST_BUSY | State busy | |
| ATN_RESPONSE_ST_STATE_DONE | Busy |
Constants
Library constants.
| Name | Value | Description |
|---|---|---|
| MAI_ATN_ACTIONS | 99 | Default mai number of actions in action list (max-1) |
| MAI_ATN_ACT_ACTIONS | 10 | Mai number of active Actions per a thread |
| MAI_ATN_ACT_THREADS | 0 | Mai number of active Threads per a director |
| ATN_ACTION_NAME_LEN | 20 | Max length of action names |
| ATN_NAMESPACE_LEN | 20 | Max length of namespaces |