02-11-2010 05:51 AM
I get a AI value(error(t)) from USB-6008, then I need to find out the Change of error. How I can do that?
"Change of error" = error(t) - error(t-1)
I try delay function to write that but can't do it
02-11-2010 06:55 AM
02-11-2010 07:22 AM
See attached image. You'll need to measure the Error(0) outside of the loop to initialize the shift register, then continuously read the error signal Error(t) inside the loop.
02-11-2010 07:35 AM
The code example in your diagram does not make sense... Which is probably why you are asking for help..
The value in the shift register will not change.
Can you write a pseudo code representation of what you would like to achieve?
R
02-12-2010 07:07 AM
02-12-2010
05:53 PM
- last edited on
05-01-2025
01:29 PM
by
Content Cleaner
Hi fung,
The code that sgregor249 posted does execute the formula you requested. (You'll have to add a stop condition to the while loop, though)
If your AI Error(t) measurement is simply a voltage, all you need to do is replace the AI Error(t) control in his example with your DAQmx Read and set the initial error value as well. After doing so the voltage measurement from the previous iteration will be subtracted from the voltage measurement from the current iteration.
If you want more information about how shift registers work (the up and down arrow on the edge of the while loop) check out the LabVIEW Help: Transferring Values between Loop Iterations
02-14-2010 12:31 PM
sgregor249 wrote:
Ray, I was using numeric controls for the example instead of whatever method fung would use to measure the error signal.
- sorry -
😞
my bad..