We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProcessing DevelopmentLibraries,  Tool Development › DMX ouput library - suggestion
Pages: 1 2 3 
DMX ouput library - suggestion (Read 26059 times)
Re: DMX ouput library - suggestion
Reply #15 - Nov 9th, 2008, 5:14pm
 
for those who wants to use this DMX4All USB adapter

http://www.dmx4all.de//product_info.php/info/p254_USB-DMX-STAGE-PROFI.html

might try out this class, it wraps the DMX4All serial ascii command for setting the DMX channels values.  

Code:

/**
*  Class for communication with
*  the DMX4All DMX - USB interface
*/
class DMX4All {
 
 Serial dmxPort;
 
 /**
  *  Create a new Serial port connection
  *  to the DMX USB interface
  */
 public DMX4All(PApplet p, String name) {
   dmxPort = new Serial(p, name, 38400);
 }
 
 /**
  *  Set the value of a DMX channel
  */
 public void setChannelValue(int channel, int value) {
   if(channel < 0) channel = 0;
   if(channel > 511) channel = 511;
   if(value < 0) value = 0;
   if(value > 255) value = 255;
 
   String channelStr = "" + channel;
   String valueStr = "" + value;
 
   if(channelStr.length() == 1) channelStr = "00" + channelStr;
   if(channelStr.length() == 2) channelStr = "0" + channelStr;
 
   if(valueStr.length() == 1) valueStr = "00" + valueStr;
   if(valueStr.length() == 2) valueStr = "0" + valueStr;
   
   char[] channelChars = channelStr.toCharArray();
   char[] valueChars = valueStr.toCharArray();
 
   dmxPort.write('C');
   dmxPort.write(channelChars[0]);
   dmxPort.write(channelChars[1]);
   dmxPort.write(channelChars[2]);
 
   dmxPort.write('L');
   dmxPort.write(valueChars[0]);
   dmxPort.write(valueChars[1]);
   dmxPort.write(valueChars[2]);
 }
}


Usage example:

Code:

DMX4All dmx;

// first argument is the current sketch
// second arg is the serial port name

dmx = new DMX4All(this, Serial.list()[2]);

// first arg is the dmx channel, range (0 .. 511)
// second arg is the value, range (0 .. 255)

dmx.setChannelValue(1, 255);


Re: DMX ouput library - suggestion
Reply #16 - Jan 3rd, 2009, 11:49pm
 
Hi, I started a project on sourceforge, proDMX, to put all these classes into a unified DMX library:

https://sourceforge.net/projects/dmxp5/

Right now I don't have much time to work on it, but feel free to send commends, suggestions, code patches, etc. regarding this lib.
Re: DMX ouput library - suggestion
Reply #17 - Jan 6th, 2009, 4:46pm
 
hi dihardja, I just looked at your code in more detail and checked the specs page for the DMX4all adapter, but it is only for input. Maybe you linked to the wrong page?

Is your class for accessing this device instead: http://www.dmx4all.de//product_info.php/info/p254_USB-DMX-STAGE-PROFI.html ?
Re: DMX ouput library - suggestion
Reply #18 - Jan 9th, 2009, 3:01pm
 
Hi ac,

you were right, just fixed the link. Just curious, do you notice any latency while sending DMX through the processing serial lib and which devices is now or will be in the future supported by your library ?

greets  
Re: DMX ouput library - suggestion
Reply #19 - Jan 9th, 2009, 5:13pm
 
Ye, I noticed some latency, but it wasn't significant for the project I was working on.

The only DMX hardware I used with my code is the DMX USB pro from Enttec: http://www.enttec.com/index.php?main_menu=Products&prod=70304&show=description
Re: DMX ouput library - suggestion
Reply #20 - Jan 14th, 2009, 7:55pm
 
I am trying to control a bunch of RGB leds on the ceiling of a club. They use e:cue programmer, and an e:cue butler Ethernet to DMX converter (http://www.ecue.de/products/engines/butler.html)
Does anyone know if it's possible to use this DMX usb code and use it to control the light over Ethernet?

**i'm sorry I can't really provide more info about the hardware used, I'm new at this light stuff, and the people at the club hardly know the system because it's brand new (to them atleast).
I already contacted the manufacturer but they haven't responded yet
Re: DMX ouput library - suggestion
Reply #21 - Jan 27th, 2009, 10:05pm
 
Heedless wrote on Jan 14th, 2009, 7:55pm:
I am trying to control a bunch of RGB leds on the ceiling of a club. They use e:cue programmer, and an e:cue butler Ethernet to DMX converter (http://www.ecue.de/products/engines/butler.html)
Does anyone know if it's possible to use this DMX usb code and use it to control the light over Ethernet


No it is not possible. To be able to communicate with an e:cue butler you´ll need a special dll. This dll interfaces your software i.e. processing and the device. I think if you ask e:cue they will provide you with the dll and specification on how to use it.

vvvv already supports butlers, maybe you´ll want to give it a try Smiley
Re: DMX ouput library - suggestion
Reply #22 - Feb 28th, 2009, 10:24pm
 
Great project, thanks!

https://sourceforge.net/projects/dmxp5/

Why does it max out at 125 channels instead of 512?
Any workaround?

Thanks,
s
Re: DMX ouput library - suggestion
Reply #23 - Mar 1st, 2009, 2:40am
 
The constructor of the DMX class:

DMX(PApplet parent, String port, int rate, int size)

lets you set how many channels you want to use, with the size argument.
Re: DMX ouput library - suggestion
Reply #24 - Mar 1st, 2009, 3:39am
 
Thanks ac,

if I put any number greater than 126, the control doesn't work any more. No errors, but no channel communicates any more.

DMX(this, portName, 115200, 126); // 126 max

Thanks,
s
Re: DMX ouput library - suggestion
Reply #25 - Mar 1st, 2009, 6:31am
 
I found the source of the problem! There was a bug in the initialization of the message size. Try the new release I just uploaded to sourceforge:

https://sourceforge.net/project/showfiles.php?group_id=231007&package_id=280042&
release_id=664909

It should work now with more than 128 channels.

Thanks for pointing out this issue!.
Re: DMX ouput library - suggestion
Reply #26 - Jun 1st, 2009, 5:48pm
 
Thanks for version 2, working well and stable since you posted the update.
I'm wondering if there is a more efficient way to package 1 frame (up to 512 channels) to improve frame rate?
For instance, an auto-increment function so every value is sent to the nextChannel, eliminating one address byte per package?
Suggestions appreciated!
s
Re: DMX ouput library - suggestion
Reply #27 - Jan 5th, 2010, 7:45am
 
I have been using the ProDMX library but I am having speed issues using the setDMXChannel function.

The problem is that if at any instant I have a bunch of values generated, I need to call this function for each seperate value which results in huge Serial data traffic since each package only has one updated byte of a possible 512 address values.

It would be better if there was a seperate function that would allow me to pass it an array of values so that they could all be sent in one package at a time.

Re: DMX ouput library - suggestion
Reply #28 - Jan 5th, 2010, 2:37pm
 
hi, this is actually a very good suggestion, and also easy to implement.

Test the DMX.setDMXChannels(values), where the argument values must be an int array with length equal to the size specified in the constructor of the DMX object. It is available in this new version of the library (I will upload to sourceforge once it is tested):

http://users.design.ucla.edu/~acolubri/processing/prodmx/prodmx-0.0.3.zip
Re: DMX ouput library - suggestion
Reply #29 - Jan 13th, 2010, 8:20am
 
just wane add a little example on how to send DMX,  using the OpenDMX USB device by ENTTEC.

OpenDMX_Example
http://ig.hfg-gmuend.de/how-to/dmx-and-processing

ENTTEC
http://www.enttec.com/index.php?main_menu=Products&pn=70303&show=description&nam...

the library is by Juanjo Lopez
http://ko.sourceforge.jp/projects/sfnet_opendmxjavajni/

Tomek
Pages: 1 2 3