FB_DMXGetDMX512StartAddress

FB_DMXGetDMX512StartAddress 1:

This function block queries the DMX512 start address. This lies within the range from 1 – 512. If the DMX device does not occupy any DMX slot, then the DMX512 start address is 0xFFFF (65535). Each sub-device and the root device occupy different DMX512 start addresses.

Applying a positive edge to the bStart input starts the block, and the bBusy output goes TRUE. The wDestinationManufacturerId and dwDestinationDeviceId inputs address the DMX device. The byPortId input defines the channel within the addressed DMX device. If the execution of the command has been completed, the bBusy output goes back to FALSE. The bError, udiErrorId and iDMX512StartAddress outputs can now be processed. Further positive edges at the bStart input will be ignored as long as the block is active (bBusy is TRUE).

VAR_INPUT

bStart                      : BOOL;
wDestinationManufacturerId  : WORD;
dwDestinationDeviceId       : DWORD;
byPortId                    : BYTE;
dwOptions                   : DWORD := 0;

bStart: The command is started by a positive edge at this input.

wDestinationManufacturerId: Unique manufacturer ID of the DMX device.

dwDestinationDeviceId: Unique device ID of the DMX device.

byPortId: Channel within the addressed DMX device. Sub-devices are addressed through the Port ID. The root device always has the Port ID 0.

dwOptions: Options (currently not used).

VAR_OUTPUT

bBusy                : BOOL;
bError               : BOOL;
udiErrorId           : UDINT;
iDMX512StartAddress  : INT;

bBusy: When the block is activated the output is set, and it remains active until execution of the command has been completed.

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. Only valid if bBusy is FALSE.

udiErrorId: Contains the command-specific error code of the most recently executed command. Only valid if bBusy is FALSE. See Error codes.

iDMX512StartAddress: If the execution of the command has been completed (bBusy is FALSE), then the DMX512 start address of the DMX device will be sent to this output.

VAR_IN_OUT

stCommandBuffer          : ST_DMXCommandBuffer;

stCommandBuffer: A reference to the structure for communication (the buffer) with the FB_EL6851CommunicationEx() block.