Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
21
Добавлен:
11.10.2020
Размер:
901.63 Кб
Скачать

4.Systemdiagnostic

4.1.Busdiagnostic of iOdrivers

All IOdrivers are called to fill a diagnostic structure, each time an IECtask completed its IO-update. TYPE GETBUSSTATE:

STRUCT

BOLDENABLE : BOOL;

ENABLE: BOOL;

DRIVERNAME:POINTER TO STRING;

DEVICENUMBER:INT;

READY:BYTE;

STATE:INT;

EXTENDEDINFO:ARRAY[0..129] OF BYTE;

END_STRUCT

END_TYPE

The structure is defined in the library BusDiag.lib.

The IO-drivers write to the address specified for each busmaster in CoDeSys configuration. The function is only active for masters which are configured with CoDeSys.

For each busmember a byte in EXTENDEDINFO is reserved, where the first 3 bits are used:

Bit 0: Busmember exists in configuration.

Bit 1: Busmember is available on the bus.

Bit 2: Busmember signalizes an errorstate.

If a busmember is signalizing an errorstate, the specific diagnosticdata can be retrieved by using the functionblock DiagGetState (also defined in BusDiag.lib).

The FB DiagGetState is called for a specific busmember.

FUNCTION_BLOCK DiagGetState

VAR_INPUT

ENABLE:BOOL ;

DRIVERNAME:POINTER TO STRING ;

DEVICENUMBER:INT ;

BUSMEMBERID:DWORD ;

END_VAR

VAR_OUTPUT

READY: BOOL ;

STATE:INT ;

EXTENDEDINFO:ARRAY[0..99] OF BYTE ;

END_VAR

The FB starts its work with a rising edge on its ENABLE-input.

DRIVERNAME is the name of the IOdriver, which is responsible for the master of the busmember. If 0 is specified here, the diagnosisjob is deliverred to all eexisting drivers.

DEVICENUMBER identifies the bus, managed by the driver. (For example, the Hilschercarddriver can manage up to 5 cards (busses).) The index is 0-based.

BUSMEMBERID identifies the busmember. When using a CANopen-card, the BUSMEMBERID is the nodeID, using a PB-card the stationadress is used to identify the busmember

READY is set by the FB, to signalize, the job has been done.Then the STATE-member is valid and contains a value from

VAR_GLOBAL CONSTANT

NDSTATE_INVALID_INPUTPARAM:INT:=-1;

NDSTATE_NOTENABLED:INT:=0;

NDSTATE_GETDIAG_INFO:INT:=1;

NDSTATE_DIAGINFO_AVAILABLE:INT:=2;

NDSTATE_DIAGINFO_NOTAVAILABLE:INT:=3;

END_VAR

In the bytearray EXTENDEDINFO up to 100 bytes of manufacturer-specific diagnosticdata of the busmember are available now.

4.2.„System diagnostic“ in the „System...“-menu

Within the servicemenu you can get through „System ...“ to the dialog with some systemsettings. Here exists the button „System diagnostics“.

Some essential settings and errormessages can be read here.

T he currently used IO-drivers, some information about their devices and initialization- and runtimeerrors are displayed.

The progressbar „Current PLC-load“ shows the current usage of the PLC, in percent. Remember: The PLC uses the CPU of the PC max. „MaxPLCTime“-Percent (see the description of the registry entries above. This timeslice is 100% here.)

3S – Smart Software Solutions

Page 7 of 7

Соседние файлы в папке IODriver ToolKit