FB_CrestronWriteByteArray

FB_CrestronWriteByteArray 1:

This function block enables a byte 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_CrestronWriteByteArray.

Sample:

VAR
    fbCrestronWriteByteArray : FB_CrestronWriteByteArray(Communication.fbCrestronCommunication);\
END_VAR

VAR_INPUT

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

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

pData: Pointer to a byte array containing the values to be written. The programmer is responsible for dimensioning the Byte 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 byte 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.