ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Static variable in Formula Node

Hi,

How do I declare and use a static int variable in a formula node?

0 Kudos
Message 1 of 12
(4,937 Views)

Hi splee,

               You can look at Formulat node Syntax

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 2 of 12
(4,932 Views)

Thanks but I can't find the "static" construct

0 Kudos
Message 3 of 12
(4,926 Views)

Hi Splee,

               Control values are static if they are not wired to the connector pane, so you can write to them using a local variable

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 4 of 12
(4,918 Views)

Hi Splee,

 

What you want to do and what do you mean by Static int variable? please explain your scenario

-----

The best solution is the one you find it by yourself
0 Kudos
Message 5 of 12
(4,917 Views)

Basically I am using LabVIEW as a VI for my Vision Builder Automatic Inspection. VBAI is updating the Vi with : update_count. The update can happen anytime.

In the LV vi I want to keep track of how many times the update_count has happened. So it should start with 0, then 1, 2, 3, 4,..

I want to implement this using formula node..

0 Kudos
Message 6 of 12
(4,913 Views)

.. and to make it more complicated, I want to be able to reset update_count if certain condition happens

0 Kudos
Message 7 of 12
(4,911 Views)

@danil33 wrote:

Hi Splee,

               Control values are static if they are not wired to the connector pane, so you can write to them using a local variable


Don't quite understand this.. can give just a very simple snippet?

0 Kudos
Message 8 of 12
(4,908 Views)

Am not sure about the VBAI you mentioned but For updating the count don't you think shift register in a while loop and a case structure is sufficient?. Try to implement that way its very simple.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 9 of 12
(4,906 Views)

problem.png

 

 

OK this is my code snippet, without using formula node.

I do not know how to:

- reset the feedback node in the first sequence to 0, if a certain event happens

- reset the feedback node in the second sequence to 0, if a certain event happens.

Thats why I thought of using formula node, and forget all the arrays and feedback node stuff... but I don't know how to use a static variable

 

0 Kudos
Message 10 of 12
(4,901 Views)