LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Feedback Node does not memorize the previous value

Hello everyone!

I am new here. I have a question about the Feedback Node.

My Feedback Node always resets to Default Mode for every loop instead of memorizing the previous value. Please help!

I have tried the Shift Register as well but still same result

Below is my code. I want to use the value of NewVal, in one event of my event structure, as a control for another event. However, the Feedback Node always returns to the Default Mode everytime I run something else but not the Value Change button of the events.

Please help!

DTB1538_0-1688160252534.png

DTB1538_1-1688160345419.png

 

 

 

0 Kudos
Message 1 of 5
(777 Views)

Your output tunnel is set to "use default if unwired" and is not wired across in all cases of the event structure. Whenever such an event fires, the value gets reset.

 

In general, we don't like to truncated pictures. Please attach the VI.

 

0 Kudos
Message 2 of 5
(767 Views)

If you look on the border of your event structure you can see that the terminal leading to the node is set to "Use default if unwired".  That means it resets to False every time any event other than the one that sets it is run. 

 

You need to un-check that option, then for every case where you don't want to change the value, create a loop from the input terminal to the output terminal.

0 Kudos
Message 3 of 5
(764 Views)

I would also strongly recommend to rethink your code architecture in general. I see glaring problems that will bite you down the line.

 

  • Hiding an event structure deep inside a case structure can cause problems.
  • Your on/off control is outside the loop and will only get read once.
  • firing via a signaling value property should only rarely be needed. You fire it every time that "main" case executes and we can't tell what that event even does after that.
0 Kudos
Message 4 of 5
(762 Views)

Why do you have the feedback node outside the event structure? Which other events need to know what you did previously?

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 5
(674 Views)