Component: DMX 512 Slave (Comms: System)

From Flowcode Help
Jump to navigationJump to search


Author MatrixTSL
Version 1.0 (Release)
Category Comms: System


Image DMX_512 Slave component

A serial based communications protocol designed for controlling theatrical equipment such as dimmers, fog machines and intelligent lights. DMX-512 Slave devices are daisy chained together with a final 180R terminating resistor at the end of the chail. DMX requires the signal to be level shifted from VCC and GND to +2.5V and -2.5V.

Examples

DMX Master Example, reads the value of two ports using switch arrays to set the values and then transmits the data in a DMX packet. FC6 Icon.png DMX Master Example1 DMX Slave Example, captures the first DMX data channel sent from the Master and outputs the value onto a Port using the LED array component. FC6 Icon.png DMX Slave Example1

Downloadable macro reference

GetDataChannel

Gets the data byte from a data channel

Parameters

UINT Channel


Return value

BYTE


ReceiveDataChain

Waits for a BREAK, MAB and StartCode followed by the contents of the data channels.

Returns 0 to indicate a timeout and 1 to indicate succesful reception.

Parameters

BYTE Timeout
0 = Don't wait, 1 - 254 = 1ms - 254ms, 255 = Wait forever


Return value

BYTE


Initialise

Configures the UART serial interface.

Parameters

This macro has no parameters


Return value

This call does not return a value


Simulation macro reference

This component does not contain any simulation macros


Property reference

Channel

This property is of type Fixed list of ints and can be referenced with the variable name CHANNEL.

No additional information


TX Pin

This property is of type Single digital pin and can be referenced with the variable name tx_pin.

No additional information


RX Pin

This property is of type Single digital pin and can be referenced with the variable name rx_pin.

No additional information


Data Channels

This property is of type Unsigned integer and can be referenced with the variable name DataChannels.

Number of data bytes used by the DMX chain, Max 512 bytes per transmission.

24 Bytes minimum to match minimum 1204us timing requirements, not all channels need to be used.

Start Channel

This property is of type Unsigned integer and can be referenced with the variable name StartChannel.

Channel from the master which we want to start taking our data channels

Start Code

This property is of type Unsigned integer and can be referenced with the variable name StartCode.

Start code value to listen out for, range 0-255

Injector

This property is of type Fixed list of ints and can be referenced with the variable name Injector.

No additional information