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 function block, and the bBusy output goes TRUE. The inputs wLowerBoundManufacturerId, dwLowerBoundDeviceId, wUpperBoundManufacturerId and dwUpperBoundDeviceId define the address range in which DMX devices are searched. 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 outputs bError, udiErrorId, wReceivedManufacturerId and dwReceivedDeviceId can now be evaluated. Further positive edges at the bStart input will be ignored as long as the function 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 outputs wReceivedManufacturerId and dwReceivedDeviceId. If no DMX devices are found in this range, the output bError is TRUE and udiErrorId is 0x8002 (no response from DMX device). If there are two or more DMX devices in the address range, bError is TRUE and udiError contains a 0x8006 (checksum error).
Inputs
VAR_INPUT
bStart : BOOL;
byPortId : BYTE;
wLowerBoundManufacturerId : WORD;
dwLowerBoundDeviceId : DWORD;
wUpperBoundManufacturerId : WORD;
dwUpperBoundDeviceId : DWORD;
dwOptions : DWORD := 0;
END_VAR
Name | Type | Description |
---|---|---|
bStart | BOOL | The function block is activated by a positive edge at this input. |
byPortId | BYTE | Channel within the addressed DMX device. Sub-devices are addressed through the Port Id. The root device always has the Port Id 0. |
wLowerBoundManufacturerId | WORD | Unique manufacturer Id from the lower address range. |
dwLowerBoundDeviceId | DWORD | Unique device Id from the lower address range. |
wUpperBoundManufacturerId | WORD | Unique manufacturer Id from the upper address range. |
dwUpperBoundDeviceId | DWORD | Unique device Id from upper address range. |
dwOptions | DWORD | Options (currently not used). |
Inputs/outputs
VAR_IN_OUT
stCommandBuffer : ST_DMXCommandBuffer;
END_VAR
Name | Type | Description |
---|---|---|
stCommandBuffer | Reference to the structure for communication (buffer) with the function block FB_EL6851Communication() |
Outputs
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
udiErrorId : UDINT;
wReceivedManufacturerId : WORD;
dwReceivedDeviceId : DWORD;
END_VAR
Name | Type | Description |
---|---|---|
bBusy | BOOL | When the function block is activated the output is set, and it remains active until execution of the command has been completed. |
bError | BOOL | 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 | UDINT | Contains the command-specific error code of the most recently executed command. Only valid if bBusy is FALSE (see error codes). |
wReceivedManufacturerId | WORD | 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 | DWORD | 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. |
Requirements
Development environment | required TC3 PLC library |
---|---|
TwinCAT from v3.1.4020.14 | Tc2_DMX from 3.5.3.0 |