I am trying to write a Labview nxg 3.1 code in which I add two copies of the same signal, the original one and it's delayed version.
I used a shift register with a wait function. The shift register should add the previous signal to the delayed one.
However an error 1802 is occuring on the addition. It says that the two waveforms have different dt. Can anybody help me with this ??
Solved! Go to Solution.
Check the waveform components and see what the dT's are.
I'm not familiar with NXG. If you attached your gvi, then people who have NXG installed could run it.
I think the problem is you have an uninitialized shift register. So when you run your VI, you are trying to add a waveform together with a default waveform which would be an empty Y array, a dT of 1, and a T0 of 0.
Try putting in a case structure so that on the first iteration of the while loop, it does not do any addition, but just feeds the captured waveform to the shift register.
Thanks for replying,
Yes that's exactly what the program is doing. But why should I initiate the shift register ? I just want to add the waveform from the previous iteration as it is after some time delay. Isn't it works with waveforms just as it works with numbers ? For example if I have a 1+1 addition in the loop and the result is connected to the shift register on the right, after one ifteration i'll have 2 in the left part of the shift register. I need to do the same thing but with a signal, If you think that this way is wrong kindly help me to correct it.
Because what happens at iteration 0? There is no valid waveform in that shift register you are reading from the first time you run that VI!
With a number, you don't have a 1 in that shift register to start, you have a default value of 0. To that first iteration, you can add 0 + 1 and put a 1 in that shift register on the right had side. Second iteration then you read 1, add 1, and put in a 2.
Waveforms are different. They are a special kind of cluster. The 3 major components are a Y array of values, a t0 for initial value timestamp, and a dT for the time difference between elements. They also have a variant for holding additional information about the waveform. When you first run that VI, the shift register contains a default value for a waveform. So what makes up a default waveform? An empty array, a t0 of 0, and a dT of 1. When you go to add waveforms, it tells you that you can't add a waveform with a dT of 1 with a waveform of dT whatever it happens to be.
Just don't do the addition of waveforms on the very first iteration (i=0) of that loop!