05-20-2012 03:02 PM
Hello everybody,
I have a problem with some aquisitions that I try to make and I will be really thankful if someone can help.
(Real problem is that I try to make something without knowing all the basis but I'm short with the time 😞 )
So I try to display and record some analogic values: three voltages and 8 thermocouples (through a Pico unit). I also have a RPM function through a coded wheel.
I would like something like 10 Hz for the display and the record. When I look at my .txt after recording, RPM works fine but "torque" gives me (generaly) 20 times the same value ( 2 seconds) and then change.Thermocuple gives me the same value around 10 times before changing. It is too far form "real time" for my application. I really don't understand why and it seems to be the same with the display.
I hope I was clear enough and I hope someone can advice me with this.
The card is PCI-6040e.
Thanks for your time.
Thomas
05-20-2012 07:25 PM
To be sure, is it possible that the way I configure a signal in SignalExpress influence the VI ? For exemple with this loop (capture in attached), it does not change the value each 100 ms as expected (I have 3 others loop in this VI but it should work in parallele if I understand it well).The value change each 2 seconds in the results.
For the coded wheel, I use a DAQmx counter and the value is accurate and change each 100 ms as asked. Is it possible it produce the problem in the other loops ?
I hope it is not the computer that limits the speed.
Thanks again, any help are welcome and will help me.
Ciao,
Thomas
05-21-2012 04:56 AM
Okay, I find part of the solution.
Sample on demand in SignalExpress solve the problem. But I can't do this for the thermocouple module. How can I change the refresh frequency of the temperature ? I do not understand this part of the VI.
Thanks
05-21-2012 08:16 AM - edited 05-21-2012 08:19 AM
Most people on this forum will not be able to help you, since the Pico unit is not made by or supported by National Instruments. Could you please give us more information on it (model number, support website, etc.).
The code you posted is a series of call library nodes into a driver DLL. This is pretty standard, but we would need the documentation to be able to help you. There may or may not be a way to set the sample period on the thermocouple reader. It may also be running at full speed. Thermocouple readers are not known for their speed. But we don't know without documentation.
You are depending on the host processor operating system for timing and synchronization. This may work at 10Hz, but you will probably occassionally get duplicated entries as the relative phases of the read and write loops randomly change. This could also cause you to miss data points. You can minimize this with your current architecture by using the wait on next millisecond multiple instead of the simpler wait function you are currently using. However, as a first step, you may want to use a single loop for all your acquisitions to "synch" them. Then, use a queue to send the data to the file write loop instead of the local variables. This will ensure you get no data loss and your data will be better synchronized.
You can synchronize the acquisitions from your DAQ board, but synching the temperature measurements to this may prove challenging, unless your temperature module has either a trigger pulse in or out. In this case, you could synch it all. You may not care. 10Hz is pretty slow, and you may be able to tolerate >10ms jitter in the sample times (roughly how good you will get with a multitasking OS like Win 7).
Finally, your file I/O has a subtle problem that you may not detect until too late. The VI you used formats the data into a string, opens the file, seeks to the end of the file, writes the string, then closes the file at each iteration. At your data rates, this works OK for awhile. However, if you produce large files, you will start missing data points, because the open-seek-close operation will take too long, so your loop time will go over 100ms and you are reading from local variables, which have no buffer. If you use a queue to pass data, this will solve the loss problem, but you will then get a queue backup. To solve this, open the file before the loop, format and write in the loop (no seek needed since the file pointer stays put between writes), then close the file when done after the loop.
Good luck. Let us know when you have more questions.