Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog In Waveform application

I am trying to read some thermocouples.  I have 2 DAQ cards and 2 Terminal blocks.

PCI 6289 attached to TBX-68
PCI 4351 attached to TBX-68T

The 6289 is handy because it is DAQmx compatible, the 4351 has onboard signal conditioning (for thermocouples for example) but is legacy.

In an effort to use this signal conditioning, I am trying to acquire data using that board.

My application is below

The T1 T2 and T3 are virtual channels set up in MAX.  The AI Wave is the standard utility block in the I/O Measurement->Traditional->Analog Input->Analog Input Utilities area.  Is there something else I can do here to make this work?  Right now it outputs nothing (greyed out when probed).  This is my first experience with the Tradition NI-Daq (Legacy) stuff.  Do I need to coordinate the outer loop with the scans/s of the that block, or the scan count?  I have tried a few different orientations, and nothing seems to be working.

Thanks in advance!
~milq


0 Kudos
Message 1 of 8
(4,215 Views)

Good morning ~milq,

Thanks for contacting National Instruments with your issue, we'll try our best to resolve it for you as quickly and efficiently as possible.

Instead of programming your PCI-4351 directly with Traditional DAQ, you can try using the NI-435x driver, which should make things a lot easier: http://digital.ni.com/softlib.nsf/websearch/777E0BDEEFDC45D8862571080054063F

Once that's installed, you can take a look at some example programs by navigating to the Instrument Driver Palette in the Function Panel, and then select the NI-435x driver.  You should also be able to find examples of coding with the NI-435x driver in the Example Finder by selecting Help > Find Examples and then navigating in the browse tree to Hardware Input and Output -> Modular Instruments -> NI -435x. 

The NI-435x VIs use Traditional-DAQ VIs but make the programming more intuitive and specific to 435x applications.

Best of luck with your project.

Sincerely,

Minh Tran
Applications Engineering
National Instruments

0 Kudos
Message 2 of 8
(4,196 Views)
Thanks a bunch Minh, that was very useful.  It is amazing how easy LabVIEW can make hard things, and how hard it can make easy things.

I appreciate your help!
~milq
0 Kudos
Message 3 of 8
(4,186 Views)
From what I can tell, utility included with the 4351 outputs "Scaled Data" (a 2D Array of Doubles).

What I want is the following:

Record 3 Channels as frequently as possible (within the limits of my hardware PCI 4351)
Get that data into waveforms (the DAQmx equivalent of Nsamp Nchan)
And put them into some format of shared variable (Cluster, Array of Waveforms . . .) (all of this on an RT target)
Then graph them all on the same chart (on the RT host)

I am running into all sorts of issues trying to make this happen.

RIght now, that is the contents of the SubVI I have in the loop of my main application.

You can see the double orange wire coming out of the NI435X Read block, I would really like that to be 3 Waveforms (where each waveform is a dif channel) as it is, this is what I am doing to try and get that.  It is not working, by the time that I get to that final build array, only one channel is actually reporting data (am I indexing improperly right off the read block)?

It is also a bit of a pain that when this data gets to the host (its loop is faster) I end up charting four or five 0's for every real data point.  I am thinking that I will put it in a case structure and only chart it if it is non zero, but that seems like a horrible way to do what seems like it should be a very simple loop synchronization task.

Thanks again, you guys are great!
~milq


0 Kudos
Message 4 of 8
(4,160 Views)

Good afternoon ~milq,

Thanks for the detailed follow-up message, it makes it a lot easier troubleshooting customer's issues when they give us a lot of information.

Although you haven't shown all of your code, please make sure you set your sample rate to correspond to the timestamps that you're manually applying to the data in order to get proper waveforms.  This is done using the NI 435X Set Reading Rate:

 

Regarding your array manipulation, the data is stored in the rows of the array, with each column representing a single channel.

So the approach I would take would be to first transpose the 2D array out of the NI 435X Read.vi and then proceed with indexing the array, as follows:

That should get that portion of your code up and running.

Finally regarding your synchronization issues, between your Read Loop and your Display Loop, there is both a more accurate and less CPU intensive way to ensure that this does not occur.  We have a great data stucture called Queues.  These are essentially buffered variables, whereby you can write data to the queue and it will be stored in a FIFO fashion to be read off by some other portion of code. 

To get a feel for this, go to Help > Find Examples and select the Search Tab and type in "Queues".  Open up the Queue Basics.vi example and you should be set! 

Best of luck with your project.

Sincerely,

Minh Tran
Applications Engineering
National Instruments

 

0 Kudos
Message 5 of 8
(4,145 Views)

I have no idea why the above pictures are not working, but the images are available here

ftp://ftp.ni.com/outgoing/4350SampleRate.JPG

ftp://ftp.ni.com/outgoing/4350Chan.JPG

 

0 Kudos
Message 6 of 8
(4,141 Views)
Thanks again Minh.  It's strange that the reading rate did not appear in the example I was looking at.  Transposing seems like a good idea.  I am used to matlab, where I can see the data graphically.  I have not yet developed an intuition for what are rows and what are columns in LV.  I guess you pick that kind of thing up with experience.  Anyway, I will try to hammer these suggestions out and get back with my results 🙂

Right now the only other issue I am having I think is synch-related.  I am charting a waveform, and for some reason the chart kind of resets in the middle of running.  The chart will act as normal for a variable amount of time, then it misses a chunk (and the time stamps go back to 16:00 hours, correlating with the Jan 1st 4:00 PM 1903 time, I think) then the chart goes blank and begins graphing again like that never happened.  Of course right now I have it on autoscale, so it is at least zoomed in on the data that I do get (if I adjust the chart to open up to my desired time period, it only fills the right 1/10th or so of the chart before it does the reset thing.  Anyway, I was going to post that in the RT forum because I thought it could be a synch thing.

Anyway, off to fix the broken stuff 🙂

Thanks so much!
~milq
0 Kudos
Message 7 of 8
(4,120 Views)

I know this post was long time ago.. but this helps me a lot since I am reading 14 thermocouples from PCI 4351.

I found that the data read from the NI435x READ vi is in "scaled data" form, when I put an indicator to read the output data one channel by one channel, the indicator shows the data one overwritten by next one. I'm struggling to save all the data. Here I saw you connect a certain array next to NI435x READ, Could you explain what is the array type connected from NI435x READ vi? I can't find it in the function palette. Where did you get it?

Thanks.

0 Kudos
Message 8 of 8
(3,475 Views)