FB_CrestronReadBoolArray

FB_CrestronReadBoolArray 1:

This function block enables several signals to be read from a Crestron controller and written to a bool array of the PLC.

The communication for this takes place via an instance of FB_CrestronCommunication. The desired instance of FB_CrestronCommunication is specified when declaring FB_CrestronReadBoolArray.

Sample:

VAR
    fbCrestronReadBoolArray  : FB_CrestronReadBoolArray(Communication.fbCrestronCommunication);
END_VAR

VAR_INPUT

bStart        : BOOL;
pData         : POINTER TO BOOL;
nElements     : INT;
nReadOffset   : INT;

bStart: The read command is sent by a rising edge.

pData: Pointer to a bool array in which the values read are deposited. The programmer is responsible for dimensioning the bool array to a size that can accept the entire data.

nElements: Specifies the number of elements that are to be read from the SIMPL+ macro TwinCAT 3 Communication of the Crestron controller. The pointer pData thus points to a bool array that has at least as many elements as specified by nElements (1–500).

nReadOffsets: Specifies the position from which the data are to be read from the SIMPL+ macro TwinCAT 3 Communication of the Crestron controller (1–500).

VAR_OUTPUT

bBusy        : BOOL;
bError       : BOOL;
nErrorId     : UDINT;

bBusy: During the writing procedure the output bBusy is set to TRUE and remains TRUE until writing is completed. During this time no further commands can be activated via this function block.

bError: The output is TRUE as soon as an error occurs during the execution of the command.

nErrorId: Contains the error code that may occur during execution of the function block. The value is 0 if no error has occurred.