FB_DMXDiscovery

FB_DMXDiscovery 1:

This function block searches for up to 50 DMX devices and optionally sets the start address automatically. The most important information for the devices found is displayed in a structure.

VAR_INPUT

bStart           : BOOL;
dwOptions        : DWORD;

bStart: The block is activated by a positive edge at this input.

dwOptions: Options (see table). The individual constants must be linked with OR operators.

Constant

Description

DMX_OPTION_COMPLETE_NEW_DISCOVERY

All DMX devices are taken into account.

DMX_OPTION_SET_START_ADDRESS

The start address is set for all DMX devices found consecutively, starting from 1.

DMX_OPTION_OPTICAL_FEEDBACK

After a DMX device has been found, the IDENTIFY_DEVICE function is called for two seconds.

VAR_OUTPUT

bBusy                    : BOOL;
bError                   : BOOL;
udiErrorId               : UDINT;
uliLowerBoundSearchUID   : T_ULARGE_INTEGER;
uliUpperBoundSearchUID   : T_ULARGE_INTEGER;
arrDMXDeviceInfoList     : ARRAY[1..50] OF ST_DMXDeviceInfo;
uiNextDMX512StartAddress : UINT;
iFoundedDevices          : 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.

uliLowerBoundSearchUID: During the search, the lower search address is sent to this output.

uliUpperBoundSearchUID: During the search, the upper search address is sent to this output.

arrDMXDeviceInfoList: Array with the most important information of the DMX devices found.

uiNextDMX512StartAddress: If the DMX_OPTION_SET_START_ADDRESS option is activated, then the start address that will be assigned to the next DMX device will be displayed at this output.

iFoundedDevices: During the search, the current number of devices found 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.