From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

add timestamp to 2D array of double

Hi,

I'm trying to modify the example "Cont Acq&Graph Voltage - ANALog SW trigger".  As the sub-VI which facilitates a software trigger reduces the  waveform to a 2D array of double, I lose the timestamp of my data. I am currently trying to add a timestamp corresponding to each data point collected (this should be a timestamp from the DAW hardware, the 9172 chassis w/ 9237 and 9215 modules, and save this in a spreadsheet  along with the data.  I am not able to use the "build array" functions as the timestamp is a 1D array, while the data is  a 2D array. Can anyone give me some advice on how to deal with this? I've attached the VI and subVI to this message. 

Thanks in advance, 

Claire.

 

0 Kudos
Message 1 of 7
(4,002 Views)
If you want a timestamp, I think the best thing to do would be to modify the subVI to input a 1D waveform data type. You can get a 1D waveform data type from the DAQmx simply by changing the polymorphic type.
Message 2 of 7
(3,992 Views)

Hi Dennis, thanks for your response. I know how to change with DAQmx type to 1D waveform, and had considered that, but I can't figure out how to get the subVI to allow a waveform type to be input. I think I need to take just the channel of interest (the trigger channel) out of the waveform somehow, and send that to the subVI, but I don't know how to do this (I've just been trying since your message to use the "get waveform data" and other waveform manipulations, but I can't figure it out). Can you give me another hint to start me off?

Thanks, 

Claire.

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

Hi again,  ok, so I've now changed my DAQmx to collect a 1D wfm, and I'm taking the appropriate channel of data (trigger)  from that waveform. This data stream is now of type 1D array of double. I then went into my subVI, and changed the "raw data input" to a 1D array, but this then ruined all off the indexing that goes on in the while and if loops. TO fix the first problem, I needed to re-create an array, since the data "input raw data" was a single value (apparently?) so I initialised an array outside the loop, and put a build array inside the loop with the "concatenate inputs" checked. I am now left with a problem in the final inner "if" loop, at the index terminal of the  "insert into array" block. I don't understand how to fix this - any ideas? (at this stage I don't really know whether the subVI is still doing the same thing it did originally).

I'm attaching my VIs so you can see where I'm at in this mess!

Thanks for any help, 

Claire

0 Kudos
Message 4 of 7
(3,978 Views)

Hi,

I've managed to make the subVI handle a single signal from the waveform (i.e. there are no errors), but now when I run it the trigger doesn't work and no data is collected. If anyone can see where I've gone wrong, can you please point me in the right direction?

Thanks, 

Claire.

0 Kudos
Message 5 of 7
(3,942 Views)

Hi Claire:

 

Nothing immediately strikes me as being incorrect but maybe somebody with better eyes will spot something.  Have you stepped through the subVI to make sure it's operating as expected?

Alex Person
NI-RIO Product Support Engineer
National Instruments
0 Kudos
Message 6 of 7
(3,907 Views)

Thanks for your reply on this Alex. I've done a lot more work on it since and have various pieces of it working now, though not in entirety. 

Cheers, 

Claire.

0 Kudos
Message 7 of 7
(3,862 Views)