11-12-2009 06:43 PM
11-13-2009 02:21 PM
Vilas,
The 9211 module supports sample rates up to 14 samples/second, so that is not what is limiting you to getting data once per second. It is hard to say what is causing it without seeing your code. Could you pst your VI so I can take a look at whatyou are doing?
Thanks,
-Christina
11-13-2009 02:35 PM
Hi Christina,
Thanks a lot for your reply. Please find the attached main VI. It has a number of calls to other VIs within it. If you go the block diagram, last case named "Read pressure from sensor", I need to add three thermocouples here along with an existing pressure sensor.
Please take a look at it. Actually I was able to solve this problem to some extent. I created a task in the MAX and increased the rate to 1000 Hz for the thermocouple module. The program runs fast for a minute and then displays the following error message:
DAQmx Read (Analog 1D Wfm NChan NSamp).vi:2<append>
<B>Property: </B>RelativeTo
<B>Corresponding Value: </B>Current Read Position
<B>Property: </B>Offset
<B>Corresponding Value: </B>0
<B>Task Name: </B>_unnamedTask<B>
Please help me with this.
Thank you,
Vilas
11-13-2009 02:37 PM
11-16-2009 05:00 PM
Vilas,
The module is only designed to go at 14 S/s. It will not throw an error at higher sampling rates because it is designed to be used in the chassis with faster cards. Therefore, it can be set to a higher sampling rate, but the data will simply have repeated samples. (It will only get new values at a rate of 14 S/s.)
I took a look at your code, but being such a large application it is difficult for me to determine what exactly would be causing the slow down when you add the temperature measurements. However, I do have some general recommendations that would likely improve the speed of your application (and the readability). It is typically not recommended that you use local variables as you are in this code. Instead, I would recommend passing the cluster that contains all of them into the while loop with a shift register. Then you can unbundle any values that you need inside the specific case where you need it. Local variables are less efficient than wires for passing data in LabVIEW and also make it harder to follow the code. This would also eliminate the need to have a case solely for updating the values in the cluster; they would all be updated in any case where they were used. This change would also eliminate the need to have extra front panel objects. (Having so many controls and indicators will slow down your program, because they have to be updated.) Using the cluster and a shift register, you can initialize it with a constant on the block diagram, so it would not have to be on the front panel.
Try making those changes and see if you are able to get it running faster.
-Christina