LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Resetting an indicator after stop button pressed

Hello, I'd like to reset the "read string" indicator  to an empty string when I press the stop button.

0 Kudos
Message 1 of 9
(4,455 Views)

This is a classic example where a state machine with a well written init-case makes the whole question obsolete......

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 9
(4,452 Views)

You could also set it to an empty string when you start the VI. 

 

Edit:  If I read the thread, I would have seen that Norbert already said this.  Smiley Very Happy

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 3 of 9
(4,398 Views)

The problem is NOT your indicator, but the string stored in the feedback node. Just initialize the feedback node with an empty string and the contents will be cleared the next time you run the VI.

 

(also, your "write" button should be latch action, eliminating the local variable. The code would also be cleaner if you would replace the huge concatenate string on the left with a formatting statement. even better, create a string array and use "array to spreadsheet string" to create a space delimited string ending with a newline. Also, the use of "bytes at port" is typically an indication of a poor implementation)

Message 4 of 9
(4,384 Views)

Can be done in  two ways (making the Empty string as Default value and invoking Reinitialize to default value ) at the start and the same can be done after executing loop.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 5 of 9
(4,360 Views)

I need a help to automatically resetting an numeric indicator to zero after i press the stop button.

0 Kudos
Message 6 of 9
(1,717 Views)

@Rajsakthi wrote:

I need a help to automatically resetting an numeric indicator to zero after i press the stop button.


What is the purpose of Numeric Indicator?

Whether its used in single Loop/Multiple Loop?

Does your Logic has chance of Race Condition?

Have you tried something to achieve this?

Its always better to share the Module you tried and what it does..

 

My Assumption is you have an Numeric Indicator which needs to set as zero once the Loop stops on pressing Stop button So that next time when you run you will have Value 0 in the Indicator.

 

Make the Value to Zero and Make that as Default Value and always initialize with Default values .

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 7 of 9
(1,695 Views)

See i am using serial communication (UART) and  getting 4 sensor temperature as a string output from uart for every 2 sec and then i used spread sheet string to array to separate each value and giving as an input to thermometer indicator if i stop the execution of the program the value should be set to zero.

I tried with the local variable. it is working. If any options is there let me know it will reduce the program size.

0 Kudos
Message 8 of 9
(1,687 Views)

Hi Rajsakthi,

 


@Rajsakthi wrote:

See i am using serial communication (UART) and  getting 4 sensor temperature as a string output from uart for every 2 sec and then i used spread sheet string to array to separate each value and giving as an input to thermometer indicator if i stop the execution of the program the value should be set to zero.

I tried with the local variable. it is working. If any options is there let me know it will reduce the program size.


Using a local to set the value of an indicator might work, too...

What about using a Select node to output your "zero" values instead of the real UART reading upon your STOP condition?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 9
(1,684 Views)