GetFBusStatus

GetFBusStatus 1:

The PLC Controller can be connected to a fieldbus as a participating device. The status of the fieldbus can be determined with the function "GetFBusStatus".

FUNCTION GetFBusStatus : WORD

VAR_INPUT

VAR_INPUT
    bDummy  : BOOL
END_VAR

At least one input is required for functions.

The fieldbus status is encoded in the return parameter as follows:

Controller type

Value

Description

BC2000

0

Fieldbus OK

Bit 0 set

Fieldbus errors

Bit 1 - 15

reserved

BC3100

0

Fieldbus OK

Bit 0 set

Fieldbus errors

Bit 1 - 3

reserved

Bit  4 - 5

DP-State:

0: Slave in WAIT-PRM (no connection to master)
1: Slave in WAIT-CFG (start-up)
2: Slave in DATA-EXCH (OK)

Bit 6 - 7

WD-State:

0: Baud rate is searched
1: Baud rate found
2: Communication monitoring activated

Bit 8 - 11

Baud rate:

0: 12 Mbaud
1: 6 Mbaud
2: 3 Mbaud
3: 1.5 Mbaud
4: 500 kbaud
5: 187.5 kbaud
6: 93.75 kbaud
7: 45.45 kbaud
8: 19.2 kbaud
9: 9.6 kbaud

Bit 12 - 15

reserved

BC9000

Bit 0 set

Error in AMS/ADS communication

Bit 1 set

Error MODBUS/TCP

Bit 2 - 14

reserved

Bit 15 set

No LINK (no communication with the fieldbus)

 

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v2.7.0 and above

BCxxxx (165)

PlcSystemBC.Lb6