I've attached a VI I'm currently working on. The problem is that the system identification part doesn't work. After the iterations in the for loop the error "The signal length is too small for computation, or the stimulus and response signals are not of the same length" occurs. I've tried out some different ways of fixing this, like in the VI attached with array subset, so that I can determine the length of the both signals. Really don't know how to fix this, does anyone have any ideas?
Solved! Go to Solution.
how many samples does your "Sweep Signal" has? I would expect it to be LESS than 50k samples.....
It is supposed to be 50k samples, but I'm not really sure. If I check it with array size, both the response and stimulis signal displays 1. Because it is 1D arrays or am I totally wrong?
You've built them as arrays, but it should be possible to pass through a single waveform as you have selected to only have the last value as the tunnel mode out of the for loop. The waveforms should contain the 50k samples that you've selected, and the array input is not needed.
A couple of questions:
Uh, wow, giving it a closer look i have to tell you that you have a LOT of incorrect and unnecessary code in your VI.
And you seem to have a complete misunderstanding of the waveform data type.....
Why is that?
1. You generate a waveform using Ramp by Samples and putting that array into a waveform as Y and defining a dt. However, the number of samples in the waveform is not fixed to 50k. And THIS number is what the analysis function later on looks into! Granted, the default values end up with 50k samples in the waveform.
2. You take the same array of Ramp by Samples, make a complete new computation on the values (loop, sine, window) and REPLACE the original Y of the waveform. This is called Rube-Goldberg code.
3. You now pass the waveform data to your output device. However, you pack this waveform into a 1d array of waveforms. This array has of course exactly ONE element. Ever. You never increase the number of waveforms in that array.
4. You take the array into an conditional output tunnel type "Last Value". The condition you implemented is always false for each iteration before the last one. As you never terminate the loop before the last iteration (e.g. 15 "Measurements") the condition on that terminal is Rube-Goldberg (as it is for input waveform tunnel as well!).
5. Your input waveform data array will also contain only exactly ONE element (waveform). It should include 50k samples as your DAQ Assistant is configured for that number.
6. You obviously think that your Array Subset functions will extract SAMPLES rather than WAVEFORMS. This is wrong, it will extract waveforms.
How to resolve this:
1. Remove the initial Y storage of the waveform data (output). Just write Y only once.
2. Remove the build array function from output to tunnel.
3. Remove conditional terminal of waveform tunnels and its logic (measurement variable).
4. Configure Convert From Dynamic Data to convert to a scalar waveform.
5. Remove both Array Subset functions.
It should now work as long as you make sure that Samplerate x Sweep Time is always 50k.
EDIT: Minions is correct: You should also either move the waveform generation for output out of the loop (only repeating actual output on the device in the loop) or you have to modify the code to take 'i' (Iterator) of the loop into account for sweeping...
Thanks a lot!
As you probably notice I'm pretty new in labview. I've implemented your notes and everything seems to work just fine. Really kind of you!
If a solution has been provided that solved your problem. Please close out the thread by marking that response as the solution and any others that helped add to the solution as KUDOS. Good Luck.