Go Back   ControlBooth > CB Discussions > Lighting
 
    Advanced Search

Notices

Lighting For any discussions related to lighting


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old September 22nd, 2008, 08:22 PM

 
Join Date: Sep 2008
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Computer Using an RS 232 to 485 converter box for DMX program

Hello to all, first post here!

I am writing a DMX software program to control lighting gear from my laptop at live sound gigs. I'm a very experienced RS 232 programmer (VB.NET VS 2005), so I bought an RS 232 to RS 485 Converter box from B&B electronics. I've wired up my own DMX connector from the box...

I also have the entire ESTA National Standard USITT DMX 512-A book with all the DMX specs. I know that (from pages 19 & 20 of the book), the timing is critical. I know I can set up the serial comm (232 side) so that the port is opened with, say 9600 baud, 8 data bits, 2 stop bits, no parity and RTS handshaking. This should do the trick, since I'm using the 485 converter box.

What I am not sure about is sending the right characters. Let's say I want to send the "SPACE FOR BREAK" followed by the "MARK AFTER BREAK" and then the NULL (START CODE) followed by the Channels 1->4 data only.

If I want Channel 1 data to be 3C (hex), Channels 2->3 to be 00 (hex), and Channel 4 to be FF (hex), I would normally think that I just have to send the following bytes for the complete loop: 00 FF 00 3C 00 00 FF. But this doesn't seem to be working right. When the specs talk about setting the line high or low, how does that relate to the characters that I'm sending? What is the converter box doing in terms of the incoming data, and do I need to shift the data I'm sending with regards to the least significant bit/most significant bit (LSB/MSB).

Thanks to all!

domls
Reply With Quote
Old September 22nd, 2008, 09:53 PM
icewolf08's Avatar
CBmod
 Premium Member 
 
Join Date: Jan 2007
Location: Salt Lake City, UT
Posts: 3,103
Thanks: 21
Thanked 150 Times in 134 Posts
Send a message via AIM to icewolf08 Send a message via MSN to icewolf08 Send a message via Yahoo to icewolf08 Send a message via Skype™ to icewolf08
Default Re: Using an RS 232 to 485 converter box for DMX program

DMX controlled devices are looking for all 512 values for the universe. Each device counts the bits that go by and act on the ones that apply to them. So, if you are only sending out data for channels 1-4 you will confuse the gear. You need to transmit 1-512 all the time, even if the values are 00.
__________________
Alex Weisman
Master Electrician - Pioneer Theatre Company
IceWolf Photography
[email address]

Soup or art?

"Crap happens, it is our job as technicians to fix the problem and see if it can be avoided. That does not mean yelling at actors or other crew people. We make mistakes, that is life. Welcome to live theatre, if it were the same every night it would be TV." ~Me

Love CB? Upgrade to premium today!
Reply With Quote
Old September 22nd, 2008, 09:16 PM

 
Join Date: Feb 2007
Location: Salt Lake Ciity, UT
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Using an RS 232 to 485 converter box for DMX program

Try this link: DMX512 PAGE FROM Ujjal...details of DMX512 !!
Reply With Quote
Old September 22nd, 2008, 09:42 PM

 
Join Date: Sep 2008
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Embarrassed Re: Using an RS 232 to 485 converter box for DMX program

OK, no problem creating the sending of all 513 bytes of data (START + 512).

rmarston: Thanks for the link. I checked it out briefly and, like many (or most) other web sites with DMX info, it really gives very detailed information about hardware, timing, etc... But it seems that nobody ever talks about the actual sending of of the bytes of data? In other words, when they say HI and LO, what characters are being sent? How does it relate between RS 232 and RS 485???

I've got the serial port write on a timer. I've set the timer to send data every 250ms (I can set to any value, if needed). Here's my write code. Does anybody have any write code that they KNOW actually works?

Private Sub tmrWrite_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrWrite.Tick
Dim b() As Byte
Dim s(0) As Byte
Dim m(0) As Byte
Dim timeout As New System.TimeSpan(100000) '100 microseconds = 100,000 ns
Dim timeout2 As New System.TimeSpan(12000) '12 microseconds = 12,000 ns

Erase b
ReDim b(512)
s(0) = 158 '9E

SP1.Write(s, 0, 1)
System.Threading.Thread.Sleep(timeout)

m(0) = 223 'DF
SP1.Write(m, 0, 1)
System.Threading.Thread.Sleep(timeout2)

b(0) = 0
b(1) = 60
b(2) = 0
b(3) = 0
b(4) = 255

With SP1
.Write(b, 0, 513)
End With
End Sub

Note that I had captured data from my Behringer controller into Hyperterminal and the "9E" and "DF" hex values are from the capture...just guessing that these might be the LO and HI values.

Thanks!!!

domls
Reply With Quote
Old September 22nd, 2008, 10:06 PM

 
Join Date: Dec 2006
Location: Maryland
Posts: 333
Thanks: 9
Thanked 21 Times in 20 Posts
Default Re: Using an RS 232 to 485 converter box for DMX program

The LO and HI refer to the signal level for each bit of data... so sending 0x00 will be all low for 8 bits, 0xFF will be all high for 8 bits, and 0x55 will alternalte high and low. (I may have the high/low backwards, I don't have the specs in front of me...)

RS-232 vs. RS-485... They are two different electrical specs for serial data. Converting from one to the other will give you different signal levels (RS-232 is referenced to ground, RS-485 is a differential signal). Note in terms of data rate, bytes, etc, what you put in is the same as what you get out, only the levels have changed.

Are you running at the correct bit rate? You mentioned 9600... I believe that DMX requires 250,000 BPS.
Reply With Quote
Old September 22nd, 2008, 10:23 PM

 
Join Date: Sep 2008
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Using an RS 232 to 485 converter box for DMX program

Thanks, fredthe,

I'm not sure that the B&B 232 to 485 converter box handles 250,000 bps, or that there is a 1 to 1 correlation between bps in 232 and 485. I'll have to look at the specs of the box, and see what it says. It might have a limit of 115200 on the 232 side. Baud rate in RS 232 is x number of bits per second, so that if you send a character such as FF, you usually have 10 bits per byte (but in this case, you have 2 stop bits, making for 11 bits per byte).

I guess my biggest question concerns the conversion of data in the box between 232 and 485. In other words, if a byte of FF into the 232 end of the box is converted, what is it converted to, or is the box smart enough to know HOW to convert the FF into an 8 bit high signal automatically (where all 8 bits are set to HI)?

Any ideas?

Thanks!

domls
Reply With Quote
Old September 22nd, 2008, 10:33 PM

 
Join Date: Sep 2008
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Computer Re: Using an RS 232 to 485 converter box for DMX program

Allow me to give a real-world example. I have a "COLORpalette" from Chauvet which can be set up to be a 6, 9, 15, or 27 channel DMX LED light. The first channel determines the function. If I set the first channel with a value of between 060 and 079 (decimal), then it is set to 6 Channel mode. The second and third channels are Auto mode speed and Strobe (which I usually don't use, so these are 0).

The 4th channel is Red 1, 5th Channel is Green 1, and 6th is Blue 1 (assuming that I've set Channel 1 to 6 Channel mode, as above). So, by sending a value of 255 for Channel 4, 255 for 5, and 255 for 6, I get all LED's on at full blast, thus giving a White light overall. If Channel 4 is 255, 5 is 0, and 6 is 0, then, obviously I will get a Red light overall.

What is unnerving for me is that the Behringer (and many other) hardware mixing-style dimmer boxes give values on the sliders from 0 to 100 instead of 0 to 255, when all the specs for modern LED devices give detailed channel values ranging from 0 to 255! This makes it incredibly difficult to set Channel 1 to a range of 60 to 79 (which is the range for 6 channel mode), and thus my want for a software program to control the lighting instead. What else is crazy is that there are only 12 main faders (with two banks=24), so heck, in theory, the Behringer controller can only handle the ONE LIGHT (if set to 27 channel mode).

Thanks!

domls
Reply With Quote
Old September 22nd, 2008, 11:15 PM

 
Join Date: Sep 2003
Location: Chicago IL
Posts: 820
Thanks: 1
Thanked 34 Times in 31 Posts
Default Re: Using an RS 232 to 485 converter box for DMX program

This sounds like an interesting project but if you are looking for something that is done for you try this ENTTEC - Lighting Control,RDM,DMX USB PRO it will run with chamsys magic Q so you can use the color mixer and effect engine.
Reply With Quote
Old September 22nd, 2008, 11:36 PM

 
Join Date: Dec 2006
Location: Maryland
Posts: 333
Thanks: 9
Thanked 21 Times in 20 Posts
Default Re: Using an RS 232 to 485 converter box for DMX program

For the (any) 232 to 485 converter, it's only a signal level conversion.... in terms of bit rate, etc, what you put in is what you get out. Since DMX is 250,000 bps, your RS-232 port would need to be set to the same, which it probably can't.

Looking at your code snippet, your reference to HI and LOW seem to be in relation to sending the BREAK and MAB parts of the DMX signal. Unfortunatly, these are Constant levels, not something that can be programmed as a byte to be sent out by a UART, since the byte will always be sent with start and stop bits, but the requirement is to keep the output at a single level, with no transitions, for a specified period of time. Unless you have a port that can be directly programmed to output a Constant low or high level, you're out of luck using a serial port. (This functionality may exist, but may or may not be easily accessable.... I haven't looked at low-level UART programming in 15+ years )

Oh, and don't get me started on "Baud" rate... unless you're dealing with a modulated signal, you really mean bit rate. (Yes, I know the documentation probably says baud, but it's still not correct usage.)
Reply With Quote
Old September 22nd, 2008, 11:47 PM

 
Join Date: Dec 2006
Location: Maryland
Posts: 333
Thanks: 9
Thanked 21 Times in 20 Posts
Default Re: Using an RS 232 to 485 converter box for DMX program

To convert from an attribute value (scaled by 255,) to the board value (scaled by 100) just multiply by 0.392
Reply With Quote
Reply

Tags
(no prefix), 232, 485, box, converter, dmx, program

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
NYU undergrad design program gabe Education 4 August 30th, 2008 03:12 AM
Composer Program Schniapereli Sound 1 October 7th, 2007 10:04 PM
Awsome 3d lighting program mbandgeek Lighting 15 June 2nd, 2006 08:45 AM
New Magic Sheet program for Mac and PC zac850 Lighting 14 July 13th, 2005 05:41 PM


All times are UTC -4. The time now is 01:30 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.1 
Advertisement System V2.6 By   Branden

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80