LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

flushing values in the feedback node

I am using a feedback node to build an array.

 

When I stop the VI and run it once again, the values in the feedback node from previous iteration are introduced in the array.

 

How do stop this from happening ? Is there command /VI which could be used to remove the values in the feedback node?

 

 

0 Kudos
Message 1 of 8
(3,842 Views)

Initialize it:

 

 

Andrey.

Message Edited by Andrey Dmitriev on 11-19-2008 06:37 PM
Message 2 of 8
(3,834 Views)

Have you wired a value to the initialization node of the feedback node? (looks like a small diamond).

Which version of LabView are you using?

Hope this helps.

 

Beat me to it. Smiley Tongue

Message Edited by GovBob on 11-19-2008 11:38 AM
Now Using LabVIEW 2019SP1 and TestStand 2019
Message 3 of 8
(3,833 Views)

Wire an empty array constant to the initializer terminal. Better to initialize the array size and use replace array subset instead of building an array, especially if you anticipate this array to become large.

Message 4 of 8
(3,830 Views)

I  am using Labview 8.2 .

 

I am attaching a picture here showing the code. I will be useful , if you could have a look at it.

 

Basically, I am using a case statement to record position values when ever case is triggered true.

 

At this point, I am trying to get the feedback node to initialize only once when the VI starts. If the VI is stopped and started in between, the feedback node should again be initialized to zero and not use the values from previous iteration. This is the problem.

 

Also, it would be useful to have information about "reintializing all values to default" every time the VI runs within the Block diagram of VI.

0 Kudos
Message 5 of 8
(3,792 Views)

Right-click on the diamond looking box on the left side of your for loop, and select Create --> Constant. This will create an empty array constant. If the code you posted sits inside another loop (e.g. a while loop), then right-click on the initializer terminal again and select Move Initializer One Loop Out to get to your outermost loop. This will initialize the feedback node only when you start the program.

 

To reinitialize all values to default, you can do something like this:

 

Edit: Re-posted code as VI

Message Edited by Sima on 11-20-2008 09:54 AM
0 Kudos
Message 6 of 8
(3,768 Views)

Thank you for the re-initializing code Sima.

 

I made some code to initialize the feedback pointer to zero whenever the VI runs.

 

It is in the attached pic.

 

 

0 Kudos
Message 7 of 8
(3,747 Views)

Shan21 wrote:

.


You can delete the shift register, it serves absolutely no purpose here.

 

(also, as noted in the other thread, your FOR loop is pretty uselss. Use the outer loop for accumulation.)

Message Edited by altenbach on 11-20-2008 09:00 AM
0 Kudos
Message 8 of 8
(3,741 Views)