FC_InitCmdTable - General Information
Type: |
Function |
Available as of: |
V1.1.0.0 |
Support for: |
PacDrive pilot template architecture |
Function for initialization of an axis that is controlled by the function block AXM.FB_AxisModuleTpi.
This function is used to assign a number and text name to a command table and to place the table into the command table list. Commands tell an axis or a group of axes what to do such as “start homing”. A command table is an ordered list of commands that the FB_ModuleControllerTpi function block uses to command an axis or a group of axes. A command table list holds the command tables. It is easier to pass a list of command tables to the FB_ModuleControllerTpi function block than passing individual tables.
Via the i_adiTables input an array is transferred that holds the ordered list of commands and the axes associated with the commands. The array was previously set up using the functions FC_InitCmdTableCmd and FC_InitCmdTableModule as shown below.
A text name is assigned to the table with the i_sCmdTitle input and a table number is assigned with the i_diCmd input. The AXM.FB_AxisModuleController POU executes a command table by using a table number. Within the enumeration type ET_Cmd specific command names are assigned to a table number as follows:
oET_Cmd.NoCmd := 0,
oET_Cmd.DriveEnableOn := 25999,
oET_Cmd.DriveEnableOff := 25998,
oET_Cmd.Init := 25997,
oET_Cmd.Prepare := 25996,
oET_Cmd.Production := 25995,
oET_Cmd.Auto := 25994,
oET_Cmd.BrakeRelease := 25993,
oET_Cmd.Abort := 25992,
oET_Cmd.StandBy := 25991,
oET_Cmd.Manual := 25990,
oET_Cmd.Jogging := 25989,
oET_Cmd.Hold := 25988,
oET_Cmd.Stop := 25987,
oET_Cmd.Start := 25986,
oET_Cmd.HoldJm := 25985
The ET_Cmd is declared an enumeration type in the data type area to allow users to add their own command tables. The value of a command table number has to be greater than 25,000.
The watch dog time of each command step (timTimeOut) is set to zero by this function block.
The value of the function is TRUE after the command table is added to the command table list.
Input |
Data type |
Description |
---|---|---|
i_adiTables |
ARRAY[1..34] OF DINT |
Specifies which list of ordered commands with associated axes to use |
i_sCmdTitle |
STRING(80) |
Specifies a text name for the command table |
i_diCmd |
DINT |
Specifies a number for the command table |
Output |
Data type |
Description |
---|---|---|
q_etDiag |
General, library-independent statement on the diagnostic. A value unequal to GD.ET_Diag.Ok corresponds to a diagnostic message. |
|
q_etDiagExt |
POU-specific output on the diagnostic. q_etDiag = GD.ET_Diag.Ok -> status message q_etDiag <> GD.ET_Diag.Ok -> diagnostic message |
Input/Output |
Data type |
Description |
---|---|---|
iq_stCmdTable |
ST_CmdTableTpi |
Specifies the structure used to hold all the command tables |
Data type |
Description |
---|---|
BOOL |
|
q_etDiag |
q_etDiagExt |
Enumeration value |
Description |
---|---|---|---|
OK |
0 |
Ok |
|
InputParameterInvalid |
147 |
An unexpected detected error occurred during the execution. |
Enumeration name: |
Ok |
Enumeration value: |
0 |
Description: |
Ok |
Enumeration name: |
UnexpectedDiagExt |
Enumeration value: |
147 |
Description: |
An unexpected detected error occurred during the execution. |
Issue |
Cause |
Solution |
---|---|---|
- |
Input parameter invalid. A value in the array i_adiTables is invalid. |
Change the values in the array i_adiTables so that the following applies: If a value in i_adiTables[1..17] is <> 0, then the associated position in the array i_adiTables[X+17] has to be <> 0 also. |