FB_DMXDiscUniqueBranch
This function block queries whether DMX devices are located within a certain address range. This command is used for the discovery of the connected DMX devices.
Applying a positive edge to the bStart input starts the block, and the bBusy output goes TRUE. The wLowerBoundManufacturerId, dwLowerBoundDeviceId, wUpperBoundManufacturerId and dwUpperBoundDeviceId inputs define the address range which is searched for DMX devices. 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, wReceivedManufacturerId and dwReceivedDeviceId outputs can now be evaluated. Further positive edges at the bStart input will be ignored as long as the block is active (bBusy is TRUE).
If there is only one DMX device in the defined address range, then the 48-bit UID of the DMX device will be returned via the wReceivedManufacturerId and dwReceivedDeviceId outputs. If there are no DMX devices in this range, then the bError output is TRUE and udiErrorId is 0x8002 (no reply from the DMX device). If there are two or more DMX devices in the address range, then bError is TRUE and udiErrorId contains a 0x8006 (checksum error).
VAR_INPUT
bStart : BOOL;
byPortId : BYTE;
wLowerBoundManufacturerId : WORD;
dwLowerBoundDeviceId : DWORD;
wUpperBoundManufacturerId : WORD;
dwUpperBoundDeviceId : DWORD;
dwOptions : DWORD := 0;
bStart: The command is started by a positive edge at this input.
byPortId: Channel within the addressed DMX device. Sub-devices are addressed through the Port ID. The root device always has the Port ID 0.
wLowerBoundManufacturerId: Unique manufacturer ID from the lower address range.
dwLowerBoundDeviceId: Unique device ID from the lower address range.
wUpperBoundManufacturerId: Unique manufacturer ID from the upper address range.
dwUpperBoundDeviceId: Unique device ID from the upper address range.
dwOptions: Options (currently not used).
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
udiErrorId : UDINT;
wReceivedManufacturerId : WORD;
dwReceivedDeviceId : DWORD;
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.
wReceivedManufacturerId: If the execution of the command has been completed (bBusy is FALSE), then the state of identification of the DMX device is displayed at this output.
dwReceivedDeviceId: If the execution of the command has been completed (bBusy is FALSE), then the state of identification of the DMX device is displayed at this output.
VAR_IN_OUT
stCommandBuffer : ST_DMXCommandBuffer;
stCommandBuffer: A reference to the structure for communication (the buffer) with the FB_EL6851CommunicationEx() block.