03-12-2019 11:21 PM
I input signal from two channel and split the data with split vi, usually, the upper wire connect to the ai0 while the lower one connects to ai1, but sometimes it will reverse, what can i do to fix it?
03-13-2019 02:03 AM
Hi frog,
I input signal from two channel and split the data with split vi,
Which is your first fault: why use an ExpressVI when you can use a simple IndexArray function?
usually, the upper wire connect to the ai0 while the lower one connects to ai1, but sometimes it will reverse, what can i do to fix it?
"Usually" it will ALWAYS have the first channel at the first output and the 2nd channel at the 2nd output. There is nothing to be fixed…
03-13-2019 02:23 AM
Hi GerdW,
Do you mean the Interpolate 1D array? cause the index is not an integer.
But sometimes it get reversed, but it will be normal if I noticed and reopen the file.
Thank you!
03-13-2019 02:35 AM
03-13-2019 07:51 AM
To expand slightly on GerdW's response, I was (pleasantly) surprised to see you were using DAQmx functions (instead of the Dreaded DAQ Assistant, which usually goes hand-in-hand with its Evil Twin, the Dynamic Data Wire). However, the ever-to-be-avoided Dynamic Data Wire showed up, anyway. Why? You're generating a 1D Array of Waveform (just look at the DAQmx Read function), so simply use Index Array and pluck the individual Waveforms off one at a time (note that if you don't wire the "index" inputs to Index Array, they default to 0, 1, 2, ...). Also note that if you don't want to deal with Waveforms, but want a 2D Array of Dbls, you can simply change the Polymorphic DAQmx Read function and the Index Array function will give you directly each channel's data as an Array of Dbl (instead of as a Waveform).
Bob Schor