FB_ASI_SlaveDiag
VAR_IN_OUT
VAR_IN_OUT
stParameterBuffer : ST_ParameterBuffer;
END_VAR
stParameterBuffer: Data buffer for the background communication (type: ST_ParameterBuffer).
VAR_INPUT
VAR_INPUT
iSlaveaddress : BYTE;
iCounter : INT;(*1:PhysicalFaultCounter, 2:TimeoutCounter, 3:ResponseCounter, 4:Leave-DataExchCounter, 5:DataExch-FailedCounter *)
bCounterReset : BOOL;
bReadLES : BOOL;(*Read List of all detected Slaves*)
bReadLAS : BOOL;(*Read List of all activated Slaves*)
bStart : BOOL;
END_VAR
iSlaveaddress: slave address
iCounter: 1:PhysicalFaultCounter, 2:TimeoutCounter, 3:ResponseCounter, 4:Leave-DataExchCounter, 5:DataExch-FailedCounter
bCounterReset: resetting of the current counter.
bReadLES: List of the identified ASI Slaves (LES).
bReadWrite: 0=READ, 1=WRITE.
bReadLAS: List of the activated ASI Slaves (LAS).
bStart: The respective task is carried out via a rising edge at this boolean input.
bCycleMode: 0=continuous reading 1= reading once.
VAR_OUTPUT
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
bBusy: This output remains TRUE until the block has executed a command. While Busy = TRUE, no new command will be accepted at the inputs. Please note that it is not the execution of the service but its acceptance whose time is monitored.
bErr: This output shows the error status.
iErrornumber: 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 does not exist |
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 |
iCountervalue: Counter value.
iSlaveList: 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) |