02-20-2012 10:03 PM
If you want your time stamp to be related with the data that you acquire you need to keep this vi at the place where you are getting the data and remove the delay so whatever data you acquire will pass through this for loop and have the time stamp. But still that might not be accurate.
02-21-2012 05:20 AM
I posted the code a few back. Any suggestions based on what you see there?
02-21-2012 09:09 AM - edited 02-21-2012 09:10 AM
Convert your DAQmx read to a 1-D waveform datatype instead of a 2-D array of doubles. Then the correct time information will be saved with the data and passed through your VI.
02-21-2012 10:23 AM - edited 02-21-2012 10:27 AM
When I split the 1D array of waveform, how do I take a component of the waveform to manipulate it. In my code I subtract out a voltage offset and I don't know how to do that with a waveform without changing the timestamp.
Is there an easier (more efficient) way to seperate the data into 4 groups of 6 data channels?
Thanks,
~Chris
02-21-2012 10:35 AM
You simply initialize the queue with a waveform constant. Right click on the DAQmx output and select 'Create Constant'.
You use the Get Waveform Components if you really need to extract the Y array. To subtract a constant from the wavefrom, simply wire the waveform to the subtract function. No different than what you are doing now by wiring a 1D array to the subtract though what you are doing with the array constant and the subtract does not make much sense to me.
p.s. It is silly to wire up the N terminal and use auto-indexing of a for loop. Do one or the other. You also have way too many local variables.
02-21-2012 11:06 AM
Auto indexing the "for loops" is redundant and I removed the wire to the N terminal.
I can remove some local variables once I get the program working but it helps me visually see what is going on. Then I condense. I am new remember. 🙂
I did get the initiate queue as soon as I sent the last post. Thanks though.
Maybe you have an idea for offsetting the data: I want to make all values offset to zero when the user presses the "Tare All" button. That way I read the voltage change from that moment (kind of like taring a weight scale). Then this offset is removed when they press the button again.
Any thoughts?
02-21-2012 11:41 AM
A simple solution for making everything zero is by multiplying the value with 0 and for getting back the same condition you can multiply with 1.
02-21-2012 11:55 AM
A logic similar to this may help you. As long as you click the tare button you will get your analog inputs zero once you release it the tared value will be taken as an offset and subrated from the future values.
Good luck
02-21-2012 12:42 PM
That is a great way for offsetting the data. Can I use the same method and subtract out a 1d array of waveform data?
If I wanted to be able to offset each group of data seperately (using four seperate "Tare" booleans) could I use this same idea in the consumer loop?
I still need to split the data into 4 charts. With a 1D array of waveforms would using "split 1D array" work best?
Thanks again,
~Chris
02-21-2012 01:00 PM
A simple Index Array will do. You don't even need to wire the index inputs.