LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XY plot from two signals into one module

Hello

I have two instruments (an LVDT and a positive displacement flow meter) and i am trying to plot their readings in an XY graph. The issue i am running into is that i want to gather both of the signals on one NI 9215 module. I have 2 BNC cables, one is connected to Mod1 ai0 and the other is connected to Mod1 ai1 respectively. Can i use the 1 module to gather both signals and plot them on an XY plot or do i have to purchase another NI 9215? 

 

Kind regards,  

0 Kudos
Message 1 of 6
(1,698 Views)

Yes, you can do that quite easily. Go into Help -> Find examples -> Hardware input and output -> DAQmx -> Analog Input. There are some great tutorials in there that can get you started. I think the examples plot each individual input versus time, but it sounds like you want to plot one signal as your X input and one as your Y input. There are some examples on that as well in a different part of the example finder, but basically you will just wire your X array and Y array into a cluster and feed that into the XY plot.

Message 2 of 6
(1,684 Views)

So I've looked through a couple of the examples and ive tried to see if i can utilize any of them for what i need. Im using an NI cDAQ-9184, and both signals are going into the NI 9215. Is it possible that the cDAQ-9184 cannot perform the function i want? ill link a picture of what i have on my block diagram as well as the error. 

Beginner2020_1-1595348996712.png

 

 

0 Kudos
Message 3 of 6
(1,624 Views)

You're creating two tasks; you need to have two channels in the same task. Put two of the Create Virtual Channels in series with each other, and use only one Sample clock, Start task, Read, etc. Your Read is already configured as "NChan" which is the multichannel version, and it'll output an array of waveforms.

Message 4 of 6
(1,607 Views)

It worked AWESOME!! thank you for the help, here is a picture of what i have.please let me know if you have any further advise. I would also like to export the data from each array into an excel document automatically with out having to right click the xy graph and selecting that option. what would be the best way to do this?

 

Kind regards, 

Beginner2020_0-1595437611354.png

 

0 Kudos
Message 5 of 6
(1,572 Views)

A couple of tips.

 

You can get by with one Create Task if you set it to cDAQ9184-.......Mod1/ai0:1

Index Array is expandable.  Drag bottom border downwards.  Now you'll have two outputs.  BONUS:  when you don't wire any constants for the indices, they'll default to 0, 1, 2, ....

 

For your Excel File.  Look at the Write to Measurement File express VI.  I don't recommend programming with Express VI's much, but it is a quick way to get started.  Then you can learn more when you need to do more than the Express VI is capable of.  You should be able to wire the 1-D array of waveforms into it.

Message 6 of 6
(1,565 Views)