FB_ASI_SlaveDiag
Inputs
VAR_INPUT
iSlaveaddress : BYTE;
iCounter : INT;
bReadLES : BOOL;
bReadLAS : BOOL;
bCyleMode : BOOL;
bStart : BOOL;
END_VAR
Name | Type | Description |
---|---|---|
iSlaveaddress | BYTE | Slave address |
iCounter | INT | 1:PhysicalFaultCounter, 2:TimeoutCounter, 3:ResponseCounter, |
bCounterReset | BOOL | Resetting of the current counter. |
bReadLES | BOOL | List of the identified ASI slaves (LES). |
bReadLAS | BOOL | List of the activated ASI slaves (LAS). |
bCycleMode | BOOL | 0=continuous reading, 1= reading once. |
bStart | BOOL | The corresponding order is executed with a positive edge at this Boolean input. |
Inputs/outputs
VAR_IN_OUT
stParameterBuffer : ST_ParameterBuffer;
END_VAR
Name | Type | Description |
---|---|---|
stParameterBuffer | Data buffer for background communication. |
Outputs
VAR_OUTPUT
bBusy : BOOL;
bErr : BOOL;
iErrornumber : DWORD;(* Error code of ASI-Master *)
iCounterValue : WORD;(*Counter of a slave*)
iSlaveList : DWORD;(*LES or LAS of all Slaves*)
END_VAR
Name | Type | Description |
---|---|---|
bBusy | BOOL | This output remains TRUE until the function block has executed a command. While Busy = TRUE, no new command will be accepted at the inputs. Note that it is not the execution of the service that is monitored in terms of time, but only its acceptance. |
bErr | BOOL | This output shows the error state. |
bErrornumber | DWORD | Contains the command-specific error code of the most recently executed command. Is reset to 0 by the execution of a command at the inputs. |
Command-specific error code (decimal) | Description |
---|---|
1 | Communication timeout |
2 | ASI slave address not available |
3 - 10 | Reserved |
11 | ASI slave is not activated (slave is not in LAS). |
12 | An error occurred during communication. |
13 | Data exchange bit (CN.4) not set |
Name | Type | Description |
---|---|---|
iCountervalue | WORD | Counter value |
iSlaveList | DWORD | LES or LAS |
Requirements
Development environment | Target platform | IO hardware | PLC libraries to be integrated (category group) |
---|---|---|---|
TwinCAT v3.1.0 | PC or CX (x86) | ASI master terminal | Tc2_IoFunctions (IO) |