Members | Sign In
All Forums > Hardware and LBE construction
avatar

how does DMX connect to Artemis?

posted May 06, 2013 10:09:03 by anwoke8204
hi, we are trying to develop a program that will display LCARS images on several screens around our bridge, and when the ship goes to red alert currently the GM has to click a red alert button in the program, and when the ship takes damage, the screens go obscure. I would like to try to integrate it so that when coms clicks on red alert, or when the ship takes damage it would automaticaly obscure the screens. so my question is how does DMX integrate with artemis, or how does Artemis tell the DMX the commands and the Status's, so we can get our program to do the same. the program is being programmed in VB 6.0
page   1
14 replies
avatar
MarkBell said May 06, 2013 13:07:45
What Artemis does is connect to an attached USB-RS485 Converter (specifically one based on FTDI's FT232R chip, which you can buy yourself, buy as a wire ended cable (I recommend this one if you're doing non-standard DMX equipment), or in a pre-made product such as the Enttec Open) and send sequential data. The DMX packet is a start packet followed by 1 to 512 bytes of data, depending on how it's addressed.

All the DMX devices receive the same packet, and each device counts bytes until it counts up to its current address. Once there, it reads the byte and does whatever it was programmed to do with it. Most DMX devices read that as channel intensity (for example, if an RGB controller is on channels 4,5,6 and bytes 4,5,6 read as FF 80 00, then the controller would put the Red channel to full, the Green channel to half and the Blue channel to zero). Some devices read it as a servo position (80 as center forward, FF as full right, 00 as full left, etc). Really, the DMX master (Artemis, in this case) just sends out bytes and lets the downstream devices decode it as they will. There was an Arduino shield designed for this a while back, and several flavors exist. You could let the micro handle decoding the byte array into useful integers and have a lookup table for commands. Alternately, you could have it run into an RS485 port on a computer and do some bit-banging to decode it directly. Alternately, there are plenty of cheap DMX decoders that can drive either an adjustable analog voltage (usually for driving lights) or even just a relays, which you can use as on/off inputs to your box. Either way, you're probably looking at 2-3 stages of translation to get it back into a computer :)

The DMX commands are obfuscated in the Artemis file DMXcommands.xml, in the \dat folder. Currently, it supports the following states: Normal, Shields active, Tractored for Docking, Docked, Red Alert, Damage 20, Damage 40, Damage 60, and Something Hits Player. The hierarchy of commands goes bottom to top. Most players have just a few DMX lights, so they tend to be used for just about everything. The same lights handle Normal, Shields up, Docking, Red Alert, and everything. So, since you typically want the shields up light change to override the Normal light status, the Shields Active commands go below the Normal commands.

There are 2 types of commands that Artemis can issue over DMX - continuous and single. A continuous command keeps being reissued until that state is no longer active. A single command is run once and then it stops. If you wanted your Red Alert to flash several times then just stay red, then you would have a continuous Red Alert command (Red On) followed by a not continuous Red Alert command (Red On, Red Off, etc). This way, it flashes several times (the single command), and once it stops flashing it stays red (the continuous command). Once you turn off Red Alert, it goes back to the next higher state on the list (shields active, or normal, or whatever). Once you trigger Red Alert again, of course, it fires the lowest command in the stack that is Red Alert, and goes from there.

In your case, I'd suggest having Red Alert to set a particular address to 255 (full on - relay decoders will read this as High/Active). Then, however you're reading it into the controlling device, it either reads 255 or a high bit and makes the screen adjustments accordingly. Same for "Something Hits Player" - either the same address or a different one depending on how you've got your screen outputs set up.

Hope this helps!
avatar
MarkBell said May 06, 2013 13:11:05
Here's a bare-bones relay receiver, this is a USB to RS485 direct convertor, and an Arduino Shield.
avatar
anwoke8204 said May 07, 2013 04:49:59
what we are trying to do is get another program to connect to artemis and read the status and things like that, not have it hook in via dmx or anything like that. how can we have a 3rd party program access the server status and read the ship status and send it to the other computer
avatar
MarkBell said May 07, 2013 11:51:06
Aah, ok. What you're talking sounds more like this project that got started a while ago, although I don't know what the current status of it is (compatible with 1.702, etc).
avatar
DeaneGeiken said May 17, 2013 13:20:39
Mark, I have the USB-RS485 Converter you mention in the above comments, and got it to work with a light that was not like the PAR can lights that most home bridge setups use. Do you know of the proper settings to put the dip-switched styled PAR can lights to make them work properly with "un-edited" DMX code that is currently in the Artemis Game? Currently, all I can manage to get it to do with my lights is make them blink incessantly and then turn off when shields are raised. Thanks! Deane
Commander -TSN Belisarius (BS 108)
avatar
MarkBell said May 17, 2013 14:09:41
The Artemis standard DMX addresses are Channels 0/1/2 for R/G/B. Typically, that means all DIP switches to 0 - that sets the first channel of the PAR can to 0 (usually the Red channel). Green and Blue are then set to channel 1 and 2, and you should be good to go.

Should.

Some cans have additional channels available for strobe effects and various other niftiness, so your mileage may vary. Double check the manual of the PAR can, it should give a rundown of what each channel addresses. Also, I've heard that some adapters auto-increment the address to be +1 from what you'd expect - set for 3 and you get 4, which would make getting channel 0 tricky :)
avatar
DeaneGeiken said May 17, 2013 14:22:00
So all dip switches on all the PAR cans to 0 (off), correct? And yes, the PAR cans I have do have those tricky neat flashy options too. Any idea if the USB-RS485 cable does that auto incrementing? If that is the case then I would need to change the DMX code to 1, 2, 3 right? Thanks Mark... I will try it out!
Commander -TSN Belisarius (BS 108)
avatar
DeaneGeiken said May 17, 2013 14:22:25
And that calculator is just the coolest thing!

Commander -TSN Belisarius (BS 108)
avatar
MarkBell said May 17, 2013 14:46:29
The USB-RS485 shouldn't incur any autoincrementing, since it's just a translator. Most of the incrementing happened in the decoder/controllers themselves, the datastream wasn't hijacked. If all the dip switches (except 10) are set to off and the PAR can shows white light when a game starts, then you're good, since white is R/G/B.

If it shows yellow light, then you need to increase the addresses in the DMX file. Since yellow is only R/G with no B, then what's (probably) happening is that the PAR can is listening for one channel off from where you're expecting it.

If it shows teal light, then you need to increase the address on your PAR can. Since teal is G/B with no R, then what's (probably) happening is that Artemis is inserting an additional dummy 0 channel before sending the "true" 0 channel, so it won't start below channel 1.

There have been a bunch of different slight addressing issues reported for a slew of different hardware, so adjust as necessary :)
avatar
DeaneGeiken said May 17, 2013 14:56:56
I will take this info and see what I come up with! I might need to record what colors I get so that might help. Thank you for the info! An FAQ for this stuff would be very helpful....
Commander -TSN Belisarius (BS 108)
avatar
DeaneGeiken said May 29, 2013 16:45:05
Ok. All dipswitches are set to off and #10 is set to on. When starting the game the R/G lights come on and flash on and off. When Shields are raised, the lights go off. When I hit something, like an asteroid without shields, the light (R/G) flash quickly on and off. Suggestions?
Commander -TSN Belisarius (BS 108)
avatar
DeaneGeiken said May 29, 2013 17:42:02
Here is a photo of the switches in the mode the instructions call for DMX control

Commander -TSN Belisarius (BS 108)
avatar
MichaelMesich said May 30, 2013 13:50:57
Flip the number 1 switch to on to set the light at address number 1 (which usually maps to DMXCOMMANDS address 0).

I think you're just an address off which is why the blue light doesn't come on and why you've got red/green weirdness.
Login below to reply: