03-03-2015 11:13 AM - edited 03-03-2015 11:15 AM
I am having problems when trying to add data from DAQmy Read (Analog 1D Wfm NChan NSamp) to shift register inside timeout event case structure. The data from DAQmy Read is 1D array of 3 waveforms (I am using 3 channels). I tried with Build array (and also with additional For loop, to build each channel data separately), but with no success. Any suggestions, ideas?
As I am having some problems attaching .vi file, I have posted a link where to get the zip package of files:
https://dl.dropboxusercontent.com/u/12580896/vibration_meas_V7.zip
Solved! Go to Solution.
03-04-2015 09:04 AM
Dear avstenit,
I am not sure what is the problem. You can create a shift register containing an array of waveform without any problem. There is no need for using for loops or anything else.
03-04-2015 04:49 PM
I think the function you are looking for is Append Waveforms.vi.
03-05-2015 02:53 AM - edited 03-05-2015 02:56 AM
I have tried with Insert into Array, Append Waveform and Build Array. Below is example using Append Waveform. The data (waveform) is added (appended) to shift register as I also checked this with probe every time this timeout event case is executed.
And when the measurement is finished (case structure is not running any more) I then try to run another proces in event case Analysis (see figure below):
I get the following error (see figure below):
03-05-2015 03:09 AM - edited 03-05-2015 03:12 AM
Hi avstenit,
as long as your event structure has a lot of "default if unwired" output tunnels it is very likely that you will lose precious data while executing several events…
Solution: use more wires!
Btw: What's the purpose of a TimeOut event when the timeout input is unwired?
03-05-2015 03:11 AM
Hi,
the problem is, that in some cases of the event structure you don't connect the wires transferring the acquired data from one iteration to another:
Every time you enter a case with "Use Default If Unwired" option on and no wire connected on the input, the dataflow is disrupted and you lose all the data - it is replaced with a default value (in this case empty waveform).
Connect the wires in all cases of the event structure remembering about the dataflow (even if you are not using them inside) and it should work fine.
03-05-2015 03:15 AM
Haha, seems GerdW was 2 minutes faster 🙂
03-05-2015 08:03 AM
I have edited the code by your suggestions (connected every case of shift register), but I think the problem is not solved.
In the attachement there is a code that should append waveforms in for loop, but if I check data with indicator, there is only data in indicator scaled signals [EU], but there is no data (of any kind) in indicators before append, after append and in analysis (event case Analysis). Channels used are ai0, ai1, ai2 (cDAQ2Mod5). Any ideas?
03-05-2015 08:06 AM - edited 03-05-2015 08:07 AM
Hi avstenit,
there is no data (of any kind) in indicators before append, after append and in analysis (event case Analysis)
When there is no data before your FOR loop then there will be no data after FOR loop. THINK DATAFLOW!
You need to check WHY there is no data in "before append" - we cannot as you only show an image of that single case…
03-05-2015 08:19 AM
I am having problems with uploading .vi file as I always get error of wrong file type. On the link you can get the file:
https://dl.dropboxusercontent.com/u/12580896/waveform_to_shift_register_V2.vi
About the for loop, the situation is the following:
- into for loop goes before append (at first execution without data from shift register)
- into for loop goes scaled signals [EU] (has data at every execution, data form is 1D array of waveform)
- out of for loop goes after append (this should have data appended fof both
- inside the for loop the two input waveforms are appended to get one waveform (array element wise)
IYou've forgoten the scaled signals [EU] input in the for loop or not?