PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to optimize reading multiple temperatures from PXI-4351?

Hi,
 
I need to read 12 thermocouples using a NI PXI-4351 board. The attached vi is part of a much larger application and publishes the newest temperature readings to other sub-vis and the user interface using data sockets.
 
Monitor Temperatures Parallel.vi
If I use the AI Read One Scan.vi or the AI Sample Channels.vi, the main application becomes very sluggish, e.g., switching a relay on a SCXI-1160 board takes several seconds instead of happening instantaneously. If I prevent the vi from running (by putting it in a case structure with a false constant attached), everything happens at normal speed.
 
Monitor Temperatures Serial.vi
I rewrote the vi to read each channel individually and including a 10 ms wait for the system to execute commands from other parts of the main application (e.g., switching relays). However, now updating all the temperature channels takes about 11 seconds. (I was expecting that the execution of both vis takes about the same amount of time.)
 
I need the vi to update all temperature values about every 1.2 seconds or so (corresponding to the maximum speed of the board), and without slowing the rest of the application down. How do I need to do this?
Thanks for your help.
Best regards,
Peter Buerki
0 Kudos
Message 1 of 12
(4,006 Views)

Hi Peter,

Could you please attach the VI's that you are referring to.  It is hard to imagine what you are doing in them with out actually seeing them.  Please also include the version of LabVIEW and the NI-435x driver that you are using.

 

Regards,

Ima
Applications Engineer
National Instruments
LabVIEW Introduction Course - Six Hours
Getting Started with NI-DAQmx
0 Kudos
Message 2 of 12
(3,987 Views)

Sorry, I thought I attached the vis. Here they are.

I am using LabVIEW 7.0 with NI-DAQ version 7.0.1f4

Where do I look up my NI-435x driver ? It does not show up in MAX.

Thanks for your help.

Peter

0 Kudos
Message 3 of 12
(3,986 Views)

Hi Ima,

Some additional information. My PXI system came preinstalled. Apparently, someone forgot to install the PXI-435X drivers. There was also no NI 435X driver CD included when the system arrived, and there are no examples for the 4351 in my examples folder. I purchased the system in 2003, but did not get to using the 4351 until recently. This is why I have not noticed this earlier.

Peter

0 Kudos
Message 4 of 12
(3,983 Views)
Hi Peter,
 
While I am taking a look at your code I would like you to download the NI-435x driver.  Scroll down and download the latest version of it that works with your operating system (Currently this device is not supported on Windows Vista).  The driver comes with example code and help files that will be helpful to you when using your PXI-4351.
Regards,

Ima
Applications Engineer
National Instruments
LabVIEW Introduction Course - Six Hours
Getting Started with NI-DAQmx
0 Kudos
Message 5 of 12
(3,975 Views)

Hi Ima,

I have downloaded the driver this morning Ni-435X Version 2.5.2 and am looking at the example code as we speak. I noticed that none of the examples applies to the case of TC channels being preconfigured in MAX.

Peter

0 Kudos
Message 6 of 12
(3,974 Views)
Hi Peter,

One thing I noticed with your Parallel application is that you have a delay of 1.2 s for each iteration of the while loop.  You only need to have a 100ms delay so that you won't make your processor run at 100% and your segment of code should run much faster.  Basically what is happening is that it is taking about 1134 ms to read all 11 channels and you're adding a 1200 ms delay on top of that.

I don't see anything that will cause the serial example to take 11s.  One thing you can try is to run the segment of code with highlight execution and see if there's a section that's being repeated or if there's a section of code that is taking a second to execute.

Please try these things and let me know if they help your application to run faster or if it brings up anything else that might help explain what is going on.




Thank You,

Nick F.
Applications Engineer
0 Kudos
Message 7 of 12
(3,952 Views)

Hi Nick,

I tried your suggestions. For the parallel application, it takes the same amount of time for each iteration whether or not I have a delay in there. The reason why I put it in there was that I wanted the vi to execute approx every 1200 ms instead of every 1134 ms or so. Again, the 1200 ms delay does not slow down the vi.

The serial example does take about 1 second for each iteration, and about 11s in total. There is no segment that is repeated or takes an unnecessary amount of time.

Thank you for your help.

Peter

0 Kudos
Message 8 of 12
(3,950 Views)
Hi Peter,

I tried running your program and the channels were measuring at the speed that you were expecting.  I was using a newer DAQ card however, so I will try to find a 4351 and see if I can recreate your issue.  While I do that, can you show me how you have all your channels setup?  I want to make sure that I can get as close to your setup as possible. 
Thank You,

Nick F.
Applications Engineer
0 Kudos
Message 9 of 12
(3,929 Views)

Hi Nick,

Attached is a print screen of the channel configuration. TD1Heater and TD1Wall are currently not in use, and no thermocouple is attached to these channels (channels 2 and 3). Thanks.

Peter

0 Kudos
Message 10 of 12
(3,927 Views)