Author
|
MatrixTSL
|
Version
|
2.0
|
Category
|
Comms: System
|
DMX-512 Master 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.
Detailed description
No detailed description exists yet for this component
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.
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.
DMX Slave Example1
Downloadable macro reference
|
SetDataChannel
|
Sets the data byte in a data channel
|
- UINT
|
Channel
|
|
- BYTE
|
DataValue
|
|
- VOID
|
Return
|
|
SendDataChain
|
Transmits the BREAK, MAB and StartCode followed by the contents of the data channels.
|
- BYTE
|
StartCode
|
|
- VOID
|
Return
|
|
Initialise
|
Configures the UART serial interface.
|
- VOID
|
Return
|
|
GetError
|
Checks for any errors and returns the error code. 1=ModuleBusy, 2=SleepMode, 3=SerialError, 4=ChecksumError, 5=TrackOutOfScope, 6=TrackNotFound, 7=InsertionError, 8=SDFail, 10=Sleep
|
- BYTE
|
Return
|
|
WhilePlaying
|
Blocking function that waits for module to stop being busy. Returns true if the module is still busy and the timeout period has passed.
|
- UINT
|
Timeout
|
Number of milliseconds to wait, 0=WaitForever
|
[[File:]] -
|
Return
|
|
IsPlaying
|
Checks to see if the last played track is still playing
|
[[File:]] -
|
Return
|
|
GetReplyByte
|
Reads a single byte from the last reply. Each reply contains 4 bytes starting with the command code.
|
- BYTE
|
Index
|
Range: 0-3 / 0=Command, 1=Feedback, 2=Data MSB, 3=Data LSB
|
- BYTE
|
Return
|
|
SkipTrack
|
Jump to the next or previous track
|
[[File:]] -
|
Direction
|
0=Next, 1=Previous
|
- VOID
|
Return
|
|
PlayTrack
|
Plays track from the selected folder. MP3 & Advert folder track numbers should be 4 characters long e.g. 0001 any name.mp3, Other folder track numbers should be 3 characters long e.g. 001 Any name.mp3, Root the Track played in placement order.
|
- BYTE
|
Directory
|
0=Root, 1=Folder "01" - 99=Folder "99", 100=MP3, 101=Advert
|
- UINT
|
Track
|
Track number 1="001*.MP3" / "0001*.MP3", 100="100*.MP3" / "0100*.MP3"
|
- VOID
|
Return
|
|
Initialise
|
Sets up the UART and does some housekeeping. Must be called before calling any of the other component macros.
|
- VOID
|
Return
|
|
ReadAnalogAsInt
|
Reads one of the analogue components as an Integer value
|
- BYTE
|
Channel
|
0 = LDR, 1 = POT
|
[[File:]] -
|
Return
|
|
RemapCharacter
|
Assigns a remap character allowing the PrintString function to automatically swap between pre-defined characters. The characters can be custom (in the range 0-9) or can point to an existing character in the LCD character map.
|
- BYTE
|
RemapIdx
|
Remap Index, Range: 0 to (Remap Characters - 1)
|
- BYTE
|
SearchCharacter
|
Character to look for a replace
|
- BYTE
|
ReplacementCharacter
|
New character value to use in place of the search character.
|
- VOID
|
Return
|
|
Start
|
Startup routine required by the hardware device. Automatically clears the display after initialising.
|
- VOID
|
Return
|
|
SetLEDState
|
Sets the state of a single LED
|
- BYTE
|
Port
|
0 = PortA, 1 = PortB
|
- BYTE
|
LED
|
0 = LED0, 7 = LED7
|
- BYTE
|
State
|
|
- VOID
|
Return
|
|
GetRxIdent
|
Gets the Rx ID as a Integer Standard and Extended IDs.
|
- BYTE
|
Buffer
|
|
- ULONG
|
Return
|
|
Initialise
|
Must be called before any other CAN component macros to enable and initialise the CAN peripheral.
|
- VOID
|
Return
|
Property reference
|
Properties
|
|
Channel
|
UART Channel selector Software channels are bit banged using generic I/O pins but are not as reliable as hardware channels. Hardware channels use the selected peripheral on-board the target microcontroller.
|
|
Baud Options
|
Baud rate option selector
|
|
Baud Rate
|
|
|
TX
|
Pin to be used for Transmit data
|
|
Data Channels
|
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.
|
|
Connections
|
|
Simulations
|
|
Scope Traces
|
Selects if the scope traces are automatically added to the data recorder window or not. Simulation - draws an approximation of the UART data onto the scope trace. ICT - sets up the scope trace for incoming data and adds UART packet decoding at the correct BAUD.
|
|
Console Data
|
Selects if the console data is automatically generated or not
|
|
Console Columns
|
Number of characters that can be displayed on a single line of the console.
|
|
Data Source
|
Simulation data source used to allow the component to connect to various remote devices Nothing - Simulation data is ignored COM port - Routes the communication data to and from a physical or virtual COM port Injector - Routes the communication data via a data injector component on the Panel.
|