KL6WriteRegisters
The function block KL6WriteRegisters writes data to one or several registers of a serial KL6xxx Bus Terminal.
Interface
VAR_INPUT
Execute : BOOL;
Mode : ComSerialLineMode_t;
pComIn : POINTER TO ARRAY[0..65] OF BYTE; (* for universal register communication *)
pComOut : POINTER TO ARRAY[0..65] OF BYTE; (* for universal register communication *)
SizeComIn : UINT;
pRegisterList : POINTER TO ARRAY[0..63] OF ComRegisterData_t;
SizeRegisterList: UINT;
END_VAR
VAR_OUTPUT
Done : BOOL;
Busy : BOOL;
Error : BOOL;
ErrorId : ComError_t;
END_VAR
Execute: A rising edge at the Execute input resets the connected serial hardware.
The register list must be initialised before the block is triggered. This means the register numbers and register content must be entered in the list.
Mode: The Mode input specifies unambiguously which serial hardware is being used. (ComSerialLineMode_t).
pComIn: Universal pointer to the input variable of the process data for the serial hardware (data types KL6inData, KL6inData5b, KL6inData22b, PcComInData). The pointer is assigned with the ADR() function.
pComOut: Universal pointer to the output variable of the process data for the serial hardware (data types KL6outData, KL6outData5b, KL6outData22b, PcComOutData). The pointer is assigned with the ADR() function.
SizeComIn: Size of the input process image of the serial hardware being used. The size is determined and assigned with the SIZEOF() function.
pRegisterList : Start address of a register list of type ComRegisterData_t. The start address can be determined with ADR(register list). The register list must be initialised before the block is triggered. This means the register numbers and register content must be entered in the list.
SizeRegisterList : Size of the register list in bytes. The size can be determined via SIZE(register list). The list may have between 1 and 64 entries.
Done: The Done output becomes TRUE when the function has been carried out without error.
Busy: The Busy output becomes TRUE in response to rising edge at Execute, and remains TRUE for as long as the block is performing its function.
Error: The Error output becomes TRUE as soon as an error occurs.
ErrorID: The ErrorID output provides an error code when an error occurs.