08-23-2017 06:11 AM
Hello, I'd like to reset the "read string" indicator to an empty string when I press the stop button.
08-23-2017 06:12 AM
This is a classic example where a state machine with a well written init-case makes the whole question obsolete......
08-23-2017 01:20 PM - edited 08-23-2017 01:21 PM
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.
08-23-2017 01:36 PM - edited 08-23-2017 01:45 PM
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)
08-23-2017 11:49 PM - edited 08-23-2017 11:49 PM
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.
01-31-2024 04:48 AM
I need a help to automatically resetting an numeric indicator to zero after i press the stop button.
01-31-2024 05:58 AM
@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 .
01-31-2024 06:30 AM
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.
01-31-2024 06:35 AM
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?