FB_GENIbusSet
This function block writes a value in a GENIbus device or executes a command (Class-3 IDs).
VAR_INPUT
bStart : BOOL;
byAddr : BYTE := 0;
byClass : BYTE := 2;
byIDCode : BYTE := 0;
byValue : BYTE;
eCommandPriority : E_GENIbusCommandPriority := eGENIbusCommandPriorityMiddle;
bStart: A rising edge at this input starts the setting process.
byAdress : 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 (see GENIbus standard), takes place internally in the function block.
byClass/byIDCode: Class and ID code of the memory location to be written. 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: Value to be written. In the case of Class-3 IDs this entry is ignored.
eCommandPriority: Priority (high, medium or low) with which the command is processed by the PLC library.
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
udiErrorId : UDINT;
udiErrorArg : UDINT;
bBusy: Starting with the edge at bStart, this output remains TRUE until the command has been processed.
bError: 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: Contains the command-specific error code of the most recently executed command. It is set back to 0 by the reactivation of the function block via the bStart input. See Error codes.
udiErrorArg: If applicable, contains an extended description of the error code.
VAR_IN_OUT
stCommandBuffer : ST_GENIbusCommandBuffer;
stCommandBuffer: Reference to the structure for communication (buffer) with the FB_GENIbusCommunication() function block.
Requirements
Development environment | Target platform | Required libraries |
---|---|---|
TwinCAT v2.11 R3/x64 from Build 2253 | PC / CX | TcGENIbus library from V1.0.0 |