IOF_LB_BreakLocationTest
The function block IOF_LB_BreakLocationTest can be used to carry out a test for a break location in a Beckhoff Lightbus optical fibre ring, and to locate any break that may be found. Internally, an instance of the ADSREAD function block is called. If no break location is detected during the test, the output variable BOXNO returns the current number of Lightbus modules in the ring. If a break location is detected before the Nth module in front of the receiver input, the BREAK flag is set and the module number is provided via the output variable BOXNO. If the BOXNO variable returns a value of 0xFF the break location is situated immediately in front of the receiver input, and can not be located.
VAR_INPUT
VAR_INPUT
NETID : T_AmsNetId;
DEVICEID : UDINT;
START : BOOL;
TMOUT : TIME;
END_VAR
NETID: It is possible here to provide the AmsNetId of the TwinCAT computer on which the function to be executed. If it is to be run on the local computer, an empty string can be entered.
DEVICEID: DeviceId specifies the device on which the function is to be executed. The device Ids are specified by the TwinCAT System Manager during the hardware configuration.
START: The function block is activated by a positive edge at this input.
TMOUT: States the length of the timeout that may not be exceeded by execution of the ADS command.
VAR_OUTPUT
VAR_OUTPUT
BUSY : BOOL;
ERR : BOOL;
ERRID : UDINT;
BREAK : BOOL;
BOXNO : WORD;
END_VAR
BUSY: When the function block is activated this output is set. It remains set until an acknowledgement is received.
ERR: If an ADS error should occur during the transfer of the command, then this output is set once the BUSY output is reset.
ERRID: Supplies the ADS error number when the ERR output is set.
BREAK: This flag is set if a break location is detected in the optical fibre ring.
BOXNO: The module number before the receiver input in front of which the break location has been detected.
Requirements
Development environment | Target system type | IO hardware | PLC libraries to include |
---|---|---|---|
TwinCAT v2.7.0 | PC (i386) | Beckhoff Lightbus Master: C1220 ISA; FC200x PCI | Standard.Lib; PLCSystem.Lib; TcPLCAds.Lib; TcPlcIoFunctions.Lib |
TwinCAT v2.8.0 | PC (i386) | Beckhoff Lightbus Master: C1220 ISA; FC200x PCI | TcIoFunctions.Lib ( Standard.Lib; TcBase.Lib; TcSystem.Lib; TcUtilities.Lib are included automatically ) |