Max and DMX: DMX512
Introduction
DMX512 is a standard for digital show control networks most commonly used to control lighting fixtures, stage effects and other show-control devices. It is connected using 3-pin or 5-pin XLR connectors. DMX is easily programmed in Max, using techniques similar to those used to program MIDI. With your Max skills, you can replace and extend the functionality of dedicated DMX controller/mixer hardware boxes with patches.
Working with Hardware DMX Series
Information below collected by David Butler who is also interviewed in Part 2 of the DMX series.
Packet Structure
The DMX512 specification details a number of packet types, each indicated by a start code transmitted at the start of the packet. However, in 99% of cases the only start code used is 0x00, which indicates a standard DMX data packet. Other start codes are used for the RDM extension, testing purposes and various manufacturers propitiatory data.
A standard DMX packet consists of up to 512 8-bit (between 0 and 255) integers. Each integer represents a DMX channel. No channel numbers are transmitted- all packets begin with channel 1 (there is no channel 0 in DMX terminology, although the start code is sometimes referred to as 'slot 0'), and channel numbers are calculated by counting integers sequentially from 1. There is no way to skip channels in a packet- in order to send on channel 1 and channel 512, 512 channels must be sent.
A full packet can be sent up to 44 times per second, although packets with less than 512 channels can be sent at a higher rate. However, in practice 44 Hz is perfectly acceptable for the majority of uses, and configuration of frame rate is rarely required.
Network Structure
A DMX network is connected in a daisy-chain fashion. Each DMX-controllable fixture has a 'DMX IN' port and a 'DMX THRU' (sometimes called 'DMX OUT') port. To connect these together, the 'DMX IN' of the first fixture should be connected to the 'DMX OUT' of the lighting desk/controller, and then each subsequent fixture's 'DMX IN' connected to the 'DMX THRU' of the previous fixture. The DMX512 specification allows for up to 32 devices to be connected in one chain before signal degradation starts to affect further devices.
The DMX512 specification states that the last fixture in a DMX chain must have a 'DMX Terminator' connected to the 'DMX THRU' port. A terminator is simply a male DMX connector with a 120 ohm resistor connected between the data pins. It's purpose is to prevent electrical reflections which could distort the transmitted data. In practice this only becomes a problem with large DMX signal chains.
It is important to note that on the majority of fixtures the 'DMX OUT' or 'DMX THRU' ports are passively connected to the 'DMX IN', therefore even if a connected fixture is without power, data will still travel through the system. This also means that exactly the same data is sent out as was received in - the fixture does not 'eat' any of the data.
Fixture Addressing
In order for a fixture to read the correct information from the DMX packet, it must be addressed by telling the fixture which DMX channel to read data from. On some fixtures this is entered via buttons and an LCD display, but on others it is calculated by setting DIP switches on the fixture which spell out the correct value in binary. If the fixture has multiple parameters (for example a complex moving light) the value entered is used as the 'Start Address'. For example, in a fixture with 3 channels for red, green and blue LED brightness, a start channel of 345 will cause the fixture to read data for these parameters on channels 345, 346 and 347 respectively.
Connectors
DMX512 is connected using 5-pin XLR connectors. Although only 3 of the pins are actually used, 5-pin connectors are specified by the DMX512 standard in order to avoid confusion with 3-pin XLR connectors used for audio. This confusion could be particularly disastrous if a high powered audio line is accidentally connected to a lighting fixture. Some manufacturers however (particularly of cheaper and 'budget' equipment) disregard this and provide 3-pin XLR connectors on their equipment for reasons of cost. In this case, simple in-line adapters can be used. Some equipment comes equipped with both 3-pin and 5-pin connectors in order to save hassle.
DMX512 follows standard signal directions in that an output always uses a female connector, and an input always uses a male. It should be noted that this is the opposite of audio cable signal direction.
DMX cable is electrically different to audio cable (another reason why connectors should be differentiated), and although audio cable can be used for DMX connections, it will not provide a reliable connection due to the decreased resistance of the cable. This will result in flickering and drop-outs over long cable runs.
DMX IP Protocols
Art-Net is an IP protocol developed by Wayne Howell of Artistic License for the transmission of DMX data using ethernet networks. The specification is freely available and there is no charge for implementation.
by Cycling '74 on November 25, 2012