06-17-2009 08:07 AM
Hello!
I am quite new to labview and was asked to write a program which uses the realtime tools. The program itself is simple, it is just about giving a specific voltage out and read the incoming voltage "response" (the interface is a PCI6035E card), but the whole thing should go as stable and especially as FAST as possible.
Unfortunately no one in my working group has ever worked with realtime in labview, so even though maybe the bugs have nothing to do with the realtime issue, I am getting no satisfying answers around here. Please excuse the "german/english" mix in the naming of the variables etc.
Now to my problem: To make sure the program runs as stable as needed in the specified time, I inserted all of the "finished late?" buttons of the subVI, to immediately be informed about if there is anything late. If I start the program, for the first characteristic (it's about a plasma characteristic, measured by a langmuir probe) it all works (excpect for one or two little mistakes, which I wasn't able to locate, or rather wasn't able to find out WHY the timed loop is late), but if it comes to further characteristics(=Kennlinie, the value is set in the front panel by "Kennlinienanzahl"), at about the middle of the measurement suddenly the whole subVI seems to randomly get late, then it continues with being in time, up until the middle of the next characteristic.
I know the "finished late" is linked to the setting of the deadline, so I tried to solve the problem with enlarging the deadline, but the problem remains, even though it gets a little better. But since I am trying to make the whole program as fast as possible, the enlarging of the deadlines (and in respect the encreasing of "start"-time for the next frame) seems to be counterproductive.
My next suggestion was that probably the data are passed on way too slow, or that there was something interfering, but I couldn't locate this mistake either. I read a lot about local/global variables, queues, and other possibilities of storing the data and also passing it on in the VIs, but I wasn't able to find out which solution is the best for my program.
I have attached screenshots of the program (characteristics_1 is the main VI, characteristics_2 the subVI), if that will not be enough to solve my problem, I could also attach the whole VIs.
Since I am new to LV, I hope I will get some constructive ideas how to improve the program and I apologize for the common mistakes I probably made.
Many thanks in advance,
Hanna
06-17-2009 04:29 PM
I assume you are running this VI on a real-time target? Why haven't you designed a host VI that is responsible for the user interface? Right now, your real-time has an invisible user interface thread that is communicating with the real time front panel, which is based on the host. This must be messing up your timing. I would suggest you design another loop that is designed for network communication and a host vi that listens to this communication and displays the data for you.
Also, at what rate are you doing your DAQ and how many samples are you acquiring with DAQmx read?