05-07-2019 02:25 PM
Hi all,
I am trying to control a DMX fog machine with labview (the fog machine works similarly to DMX RGB lights). The fog machine only has 1 DMX channel.
I have a usb to DMX cable which works with a FTDI chip. I downloaded the driver from the website https://www.ftdichip.com/Drivers/VCP.htm to be able to see it in MAX. I have the VI attached, but haven't been able to make it work.
The thread https://forums.ni.com/t5/LabVIEW/Open-DMX-to-control-RGB-LED-lights/m-p/1054871#M468659 deals with a similar issue.
I am very new to labview and would appreciate any help.
Thanks!
05-07-2019 02:35 PM
Hi lollol,
I have the VI attached, but haven't been able to make it work.
No wonder it "doesn't work" as it is an empty VI…
I downloaded the driver from the website https://www.ftdichip.com/Drivers/VCP.htm to be able to see it in MAX.
How do you see it in MAX? As a virtual COM port?
What does the manual say about the commands to be send over that VCP?
05-07-2019 02:45 PM
Sorry - attached is a VI and a screenshot of MAX.
I want to be able to send the machine numbers between 0 and 255, with the settings 250k baud rate, 8 data bits, no parity, 2 stop bits, no flow control.
Thanks!
05-07-2019 03:00 PM - edited 05-07-2019 03:02 PM
Hi lol,
why are there so many coercion dots in your VI? Why are there indicators without a label?
I want to be able to send the machine numbers between 0 and 255, with the settings 250k baud rate, 8 data bits, no parity, 2 stop bits, no flow control.
Like this?
Usually you don't close a (serial) port immediatly like you do in your VI…
Basic stuff (to be learned by taking the free training courses): create constants by right-clicking inputs of subVIs/functions!
05-07-2019 03:25 PM
Hi,
Here is my updated VI. I am just confused why you removed the start bit?
Thanks for your help.
05-08-2019 12:48 AM - edited 05-08-2019 12:53 AM
Hi lol,
I am just confused why you removed the start bit?
I removed that Rube-Goldberg array handling in your code because I didn't know what you are trying to do here. You didn't mention any "start bit" before…
(When you want to send more than one byte then just pre-/append more U8 values using this BuildArray node!)
05-08-2019 10:53 AM
Hi GerbW,
Yes, I need a start bit. The timing of the signal goes:
-88 usec break
- 8 usec mark after break (MAB)
-Start code 44usec (same size as channel data but all values 0)
- Mark between time frames up to 1s
- Channel data, 44 usec (8 bit value + one start and 2 stop bits)
The protocol is explained here: http://www.dmx512-online.com/dmx512_packet.html
These time aren't reflected in my program which is probably one of the reasons why it doesn't work. Could you help me integrate those?
Thanks,
Juliette
05-09-2019 12:29 AM
Hi lol,
I have a usb to DMX cable which works with a FTDI chip. …
These time aren't reflected in my program which is probably one of the reasons why it doesn't work.
No, these timings should be handled by your USB-to-DMX converter.
Read its manual about how to setup the communication!
05-09-2019 01:44 AM
@lollol0606 wrote:
These time aren't reflected in my program which is probably one of the reasons why it doesn't work. Could you help me integrate those?
They really can't be solved in software. You are running under a non-deterministic non-realtime OS. That alone will make it impossible to reach realtime reaction times of even 1 ms. You are lucky if you get reproducably about 10 ms accuracy here. In addition the VISA serial communication that you use goes through several layers of drivers that all add their own latency and make it impossible to get even near your us timing requirements from the application level.
As Gerd already mentioned, your serial port to DMX converter should handle these timing requirements if it is worth its money (even if you got it for almost nothing), as such requirements can't be solved reliably on a normal desktop OS.