01-19-2011 04:09 AM
I am designing a Real time labview program to control a Ball and Plate*** system. The program has two time loops, one for acquiring the images from webcam; the second loop to transfer data to a DAQ board and the ball and plate system. The second loop uses the data from the first loop. RT FIFO function is used to transfer the data between the loops. It was eorking fine and smooth. The problem is when I want to read a file and send the data to one of the loops. As soon as I connect the data from outside the loop to for example the first loop (The loop for image processing), the ball and plate system is getting very angry. I thought because the data is transfering to one of the loops, it affects the timing. I used a flat sequence to first read the data and then transfer it to one of the loop, but it didn't work.
Any help how I can read a data and transfering to a loop in two-paralell-time-loops program without creating a racing condition.
Many thanks,
Samad
*** The ball and plate is simply an automatic system in which the ball position on a table is controled by a set of software. The system I am working on uses a webcam to retrive the position of the ball to be used in a feedback loop. The system uses PID control system.
01-19-2011 06:40 AM
Without seeing your code I'm going to guess that the file read is taking too many resources from the loop it is in, that if you look at the "finished late" boolean in its loop you will see that it is, finishing late.
What hardware are you running this on? Do you have more than one processor core? If yes then I would recommend designating that the "time critical" functions such as your video acquisition and the PID loop run on one processor, the file loading on another (by placing it in a timed loop of its own so that you can designate which processor it runs on.
01-20-2011 09:52 AM
Thanks for the response. I basically used a Read From Measurement File function. I have not used it in a loop. It is outside the loop and is only ran once. After I realised there is a problem in connecting the wire from Read From Measurement File directivity to the image processing loop, I used the Value property. I will send a photo of my program as I am away from my computer now.
Samad