11-22-2010 09:21 PM
I am writing a program that records the speed of a car and then is supposed repeat the action through the use of an actuator. I was able to write the program to the point where I am saving the data into a .txt file and will be able to read it back out. My problem is that I need to use a dbl value that I am calculating from the output of a DAQ Assistant block that is contained inside a while loop in another part of the program to compare current speed vs. recorded speed then output an action. Everytime I try to draw a connection outside of the while loop, the actual value is not read outside of the loop. I cannot put the other part of the program into the while loop because the while loop only performs every .1 to 1 second and I need the output to the actuator to be a continous string delievered to the serial port. I also cannot create another DAQ Assistant block that reads the same port outside of the while loop. I have thought about using a jumper to another input on the input card, but I would prefer not to use the extra space.
So generally speaking, I'm wondering if there is a way to read a value obtained from a DAQ Assistant block outside of the while loop it is contained in.
Thanks to anyone that can help!!!
Travis
11-23-2010 06:51 AM
Cheers,
I am not 100% sure what your problem is but how about writing the red value into the local variable and reading it outside of the loop? Or enqueue the value into the queue and dequeue it in the other loop (Producer/Consumer Structure (Data))?
Br,
Jick