FB_GENIbusSet

FB_GENIbusSet 1:

This function block writes a value in a GENIbus device or executes a command (Class-3 IDs).

FB_GENIbusSet 2: Inputs

VAR_INPUT
  bStart            : BOOL;
  byAddr            : BYTE := 0;
  byClass           : BYTE := 2;
  byIDCode          : BYTE := 0;
  byValue           : BYTE;
  eCommandPriority  : E_GENIbusCommandPriority := eGENIbusCommandPriorityMiddle;
END_VAR

Name

Type

Description

bStart

BOOL

A rising edge at this input starts the setting process.

byAdress

BYTE

Address of the GENIbus device to be addressed: valid entries: 1 - 200. This corresponds to the setting as is made directly on the GENIbus device. Conversion to the actual address range 32 - 231 takes place within the function block (see GENIbus standard).

byClass/byIDCode

BYTE

Class and ID code of the storage space to be read. SET commands are permissible only for classes 3, 4 and 5 – an error is output for all other entries. Conversely, there is no restriction of the ID code entry, since these ranges are not without gaps and may possibly be extended.

byValue

BYTE

Value to be written. In the case of Class-3 command IDs this entry is ignored.

eCommandPriority

E_GENIbusCommandPriority

Priority (high, medium or low) with which the command is processed by the PLC library.

FB_GENIbusSet 3: Inputs/outputs

VAR_IN_OUT
  stCommandBuffer   : ST_GENIbusCommandBuffer;
END_VAR

Name

Type

Description

stCommandBuffer

ST_GENIbusCommandBuffer

Reference to the structure for communication (buffer) with the FB_GENIbusCommunication() function block

FB_GENIbusSet 4: Outputs

VAR_OUTPUT
  bBusy             : BOOL;
  bError            : BOOL;
  udiErrorId        : UDINT;
  udiErrorArg       : UDINT;
END_VAR

Name

Type

Description

bBusy

BOOL

Starting with the edge at bStart, this output remains TRUE until the command has been processed.

bError

BOOL

This output is switched to TRUE as soon as an error occurs during the execution of a command. The command-specific error code is contained in udiErrorId.

udiErrorId

UDINT

Contains the command-specific error code of the most recently executed command (see error codes). It is set back to 0 by the reactivation of the function block via the bStart input.

udiErrorArg

UDINT

If applicable, contains an extended description of the error code.

Requirements

Development environment

PLC library to include

TwinCAT from v3.1.4020.14

Tc2_GENIbus from v3.3.0.0