FB_CrestronWriteBoolArray

FB_CrestronWriteBoolArray 1:

This function block enables a bool array of the PLC to be written to a Crestron controller.

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

Sample:

VAR
    fbCrestronWriteBoolArray : FB_CrestronWriteBoolArray(Communication.fbCrestronCommunication);
END_VAR

VAR_INPUT

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

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

pData: Pointer to a bool array containing the values to be written. The programmer is responsible for dimensioning the UInt array to a size that can contain the entire data.

nElements: Specifies the number of elements that are to be written to 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–50).

nWriteOffsets: Specifies the position from which the data are to be written to 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.