LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

struggling how to set up 2 daq assist on labview in the same VI

Hello Brad.

Looking at your vi, the reason why you dont have any timestamp data in your charts is because your 'convert from ddt' function is converting the dynamic data into an array of scalar values. This will remove the timestamp and just take the actual Y values (values read). If you want to use the timestamp data then you'll need to specify '1D array to waveform'.

Then you'll be able to index each individual set of data so that you can manipulate the data for each channel, including the timestamp.

I've attached an example that reads from 4 Analog Input channels on Dev1 using the DAQ assistant, then the data is plotted together as dynamic data, also the data is passed through an 'index array' function to allow you to plot each channel individually.

Please note that on each graph, I have right clicked an unchecked the 'Ignore Timestamp' option, so that the time data is displayed correctly.

I hope this helps

Hannah

0 Kudos
Message 11 of 16
(861 Views)
Thanks Hannah.  It seemed like an easy fix, but upon changing my DDT conversion VI to convert to waveform data I still didn't get the time stamp.  I probed my wires and found that I had the time stamp after conversion, but not into my post-processing sub-VI.  It is interesting to me because my sub-VI is so simple - it merely accepts an input array, calculates pressure from voltage, and outputs an array.  The time stamp doesn't even make it into the sub-VI, so it can't be the calculation where I am losing the data.  Is there something I am missing about adding a subVI?  Do I have to explicitly tell it to hold the time stamp?

Here is the sub-VI...

Thanks,
Brad
0 Kudos
Message 12 of 16
(852 Views)
Hannah and company,

I have been chipping away at this problem, and I have made some progress.  The time stamp of the dynamic data was lost in both data streams at each of two sub-VI's I had written.  One was very simple, so I simply pasted its "guts" into my main VI, selected it again, and use the "make SubVI" function under edit.  Now the time stamp is passed through this subVI.  The other subVI is much more complicated and pasting it into the main VI is not working (I'm not sure I understand why).  I still have no time stamp coming through this one.

Two things - 1) I am interested on ideas on why the time stamp won't pass through the complicated post-processing subVI (I've attached it).  2)  I am interested to know, for future reference, why the creation of a subVI using NI's menu option rather than creating the subVI from scratch was sufficient to preserve the timestamp data. 

As this post has deviated considerably from the original title of the thread (which was not even mine), I am going to cross post this elswhere.

Thanks,
Brad
0 Kudos
Message 13 of 16
(839 Views)

Your subvi has a 1D Array of doubles as the input, and a 1D Array of doubles as the output. This wont allow you to pass the timestamp data into your subvi. If you want to do this, you need to change the control and the indicator on the front panel of the subvi to a waveform type. This will then have the correct data type to pass your waveform data into.

When you created the subvi from the menu in LabVIEW from your main vi. LabVIEW will look at all the data types that are being used by the various functions etc that you have selected, and will build the subvi using these data types for the controls and indicators it creates on the front panel of the subvi.

You need to change the control and indicator on your subvi to be a waveform control / indicator, then you will be able to pass waveform data into and out of this subvi.

Hope this helps

Hannah

0 Kudos
Message 14 of 16
(827 Views)
Thanks for the input Hannah.  I recieved some good suggestions on my cross posting (http://forums.ni.com/ni/board/message?board.id=170&message.id=171377)
and i now have my time stamp coming through.  As per your suggestion, I am still confused as how to create an array of waveform data from thin air.  What I ended up doing was copying one from a subVI that LabVIEW had created for me. 

Brad
0 Kudos
Message 15 of 16
(823 Views)

Hi Brad,

I'm not sure what you mean by 'how to create an array of waveform data from thin air' but I think you mean so that you have a constant or a control you can work from or build them from other parts of data (from wires) in your program.

If thats the case, then firstly, you can take a waveform control and put it on your front panel. This can be found on the I/O palette. If you want a waveform constant instead, the easiest way to do this is to create a control and then right click it to change it to a constant.

If you want to create a waveform from data that you have in wires, i.e on the fly, then you can use the 'build waveform' function. Which you can find on the 'Waveform' palette. This function takes in the following data

t0 is the start time of the waveform.
dt is the time interval between data points in the waveform.
Y contains the data values of a waveform.

and gives out a waveform type of data.

I hope this helps. Let me know if you have some more questions.

Hannah

Message 16 of 16
(816 Views)