LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

daq assistant timing

Solved!
Go to solution

Hi all, I am doing what would seem to be a straight forwared VI. I am controlling a small heater which is being monitored by a thermocouple. I read the thermocouple using the DAQ assistant. I use the example PID from the toolkit. Next I generate a squarewave that varies in duty cycle as per the percentage the PID gives. Strange thing is that all parts work fine seperately. But when I put them together I get no square wave, I only see the transistions that are changed for long periods of time. I have pin pointed the problem to when I use the DAQ assistant to read the temperature. If I remove it and insert a control I see the square wave. The system seems to favor the DAQ assistant that reads the temperature, then outputs the pulses "if it has the time". I am sure there is something I need to do with the sync'ing of the two DAQ assistants. Any help would be great! Thanks

0 Kudos
Message 1 of 7
(4,048 Views)

Your simulate signals Express VI is set to only output 1 sample.  So you are only putting out one sample for each thermocouple reading you are taking rather than a full square wave.  Likewise the digital output on the DAQ assistant is set to only output 1 sample.

0 Kudos
Message 2 of 7
(4,046 Views)

Thanks RavenFan for the quick reply. That was my doing. With the USB-6009 the only generation mode available seems to be 1 Sample on demand. So I had to tell the Simulate Signal to give me 1, if not it would return the error " that the number channels did in the data not match the number in the task.

0 Kudos
Message 3 of 7
(4,040 Views)

If you are trying to do pulse width modulation, then the inexpensive USB-6009 is the wrong tool for the job.  You are going to be stuck with software timing.  It can theoretically generate a square wave if you put the digital output in its own loop and it is pumping out the true and false boolean signals as fast as the software will allow.  But windows is not a deterministic operating system and there is no way to guarantee the duty cycle of your square wave.

 

I'd recommend getting a better DAQ device that has hardware timed digital outputs.

Message 4 of 7
(4,023 Views)

Yeah I know about that limititation. Since it is to control a heater, "slow response" I can theoretically decrease the frequency for something slow and the PID will adjust as needed. I was able to generate a nice and stable square wave without the first DAQ Assistant reading the temp. I need to try to find a way to have them running sequentially. 

0 Kudos
Message 5 of 7
(4,020 Views)
Solution
Accepted by topic author Glepkyj

I second RavensFan's response but if you were happy with the way the USB-6008 was able to generate a square wave in isolation then try something like this:

 

Screen Shot 2012-07-19 at 10.27.05 AM.png

 

Using two loops decouples the acquisition timing from the generation timing allowing you to output many points of your square wave for every temperature reading. 

 

Hope this helps,

 

Simon

Message 6 of 7
(4,015 Views)

Thanks Simon, that decoupling did the job. I understand that higher transistions would not be as reliable. But what I am dealing with is heating a rod that has on and off times of more that a second, I am hoping to be good to go. Thanks to both you guys!

 

 

 

0 Kudos
Message 7 of 7
(4,011 Views)