FB_DMXDiscovery512

FB_DMXDiscovery512 1:

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

FB_DMXDiscovery512 2: Inputs

VAR_INPUT
  bStart    : BOOL;
  dwOptions : DWORD;
END_VAR

Name

Type

Description

bStart

BOOL

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

dwOptions

DWORD

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 that are found. Consecutive, starting with 1.

DMX_OPTION_OPTICAL_FEEDBACK

When a DMX device is found, the function IDENTIFY_DEVICE is called for two seconds.

FB_DMXDiscovery512 3: Inputs/outputs

VAR_IN_OUT
  stCommandBuffer : ST_DMXCommandBuffer;
END_VAR

Name

Type

Description

stCommandBuffer

ST_DMXCommandBuffer

Reference to the structure for communication (buffer) with the function block FB_EL6851Communication()

FB_DMXDiscovery512 4: Outputs

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

uliLowerBoundSearchUID

T_ULARGE_INTEGER

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

uliUpperBoundSearchUID

T_ULARGE_INTEGER

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

arrDMXDeviceInfoList

ARRAY OF ST_DMXDeviceInfo

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

uiNextDMX512StartAddress

UINT

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.

iFoundDevices

INT

During the search, the current number of devices found will be available at this output.

Requirements

Development environment

required TC3 PLC library

TwinCAT from v3.1.4020.14

Tc2_DMX from 3.5.3.0