Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 9211 slow response

Hello,

I want to make changes in an existing software developed in LabVIEW 8.6. The software uses a state machine sequence architecture to communicate with a spectrometer, pressure sensor. Generally the data on front panel gets updated at least FIVE times every second. 
 
Now, I need to add three thermocouples to this sequence. I have added ONE thermocouple initially (just to start with) to the program in one the cases. So, the numbers on the front pannel of the software get updated only once a second. I believe this lag is because of the thermocouple. Is there a way to increase the rate at which the program reads data from thermocouple?
 
The spectrometer communicates directly with the program through its LabVIEW VIs. Thermocouple is connected through a NI9211 module, while pressure sensor is connected through a NI 9201. I know that the sampling rate of NI 9201 is far greater than that of NI 9211. But this is introducing a huge delay in the communication and we can not see real-time data on the front pannel.

Is it better to write another VI to read temperature and then pass this data to the main VI?

Thank you,
Vilas
0 Kudos
Message 1 of 5
(3,885 Views)

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

0 Kudos
Message 2 of 5
(3,860 Views)

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 

0 Kudos
Message 3 of 5
(3,858 Views)
I guess 1000 Hz frequency is far more than what NI 9211 is designed for.
0 Kudos
Message 4 of 5
(3,857 Views)

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

 

0 Kudos
Message 5 of 5
(3,820 Views)