08-15-2011 04:29 AM
can someone please take a look at this vi file.. why is the "if" block in the formula node executed incorrectly?
Thanks..
Solved! Go to Solution.
08-15-2011 04:45 AM
What is not working as expected? It seems you're assuming the variables in a Formula Node keep their value from a previous run. This is not the case. If you need to retain the variables from a previous run you need to use a shift register and feed the previous value into the Formula Node.
08-15-2011 04:49 AM
@dan_u wrote:
What is not working as expected? It seems you're assuming the variables in a Formula Node keep their value from a previous run. This is not the case. If you need to retain the variables from a previous run you need to use a shift register and feed the previous value into the Formula Node.
Something like that:
08-15-2011 04:53 AM
@dan_u wrote:
What is not working as expected? It seems you're assuming the variables in a Formula Node keep their value from a previous run. This is not the case. If you need to retain the variables from a previous run you need to use a shift register and feed the previous value into the Formula Node.
exactly "diff = now + previous" does not execute as expected. So the value of "previous" is not retained?
08-15-2011 04:57 AM
Yes, it is initialized to 0 in each run. If you want to keep the value you need to use a shift register and feed the value to the formula node.
08-15-2011 04:58 AM
@Andrey Dmitriev wrote:
@dan_u wrote:
What is not working as expected? It seems you're assuming the variables in a Formula Node keep their value from a previous run. This is not the case. If you need to retain the variables from a previous run you need to use a shift register and feed the previous value into the Formula Node.
Something like that:
Dmitriev,
The "previous" with a downward-pointing arrow is an input or output?
08-15-2011 05:52 AM
@splee wrote:
Dmitriev,The "previous" with a downward-pointing arrow is an input or output?
It's a shift register, the arrows can be looked at as a "loop around". The downward arrow can also be an input (if something connects from the left) but the point is to send the "/\" back to "\/" the next loop.
/Y
08-15-2011 08:08 AM
@splee wrote:
Dmitriev,
The "previous" with a downward-pointing arrow is an input or output?
Sounds to me like somebody needs to spend some time with the LabVIEW Help and tutorials.... To learn more about LabVIEW it is recommended that you go through the introduction material, tutorial(s), and other material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. There are also several Technical Resources. You can also take the online courses for free.