03-29-2021 03:54 AM
I want to maintain the separate text file history of Warning /Error Message while doing testing.
if Oil level is lower than defined range, in string indicator will display " Oil Level is Low". Similar kind of health monitoring feature will be maintained during testing.
I just want to do logging to maintain the history of message displayed in that string indicator. Whenever new warning/error message is updating in the string indicator. New Warning/Error Message also to be appended with existing data.
For example,
29/03.2021 01.13 PM Oil Level is low
29/03.2021 02.13 PM Oil temperature is high
i attached basic functionality code for your understanding.
How can i achieve this task?
03-29-2021 03:39 AM
I want to maintain the separate text file history of Warning /Error Message while doing testing.
if Oil level is lower than defined range, in string indicator will display " Oil Level is Low". Similar kind of health monitoring feature will be maintained during testing.
I just want to do logging to maintain the history of message displayed in that string indicator. Whenever new warning/error message is updating in the string indicator. New Warning/Error Message also to be appended with existing data.
For example,
29/03.2021 01.13 PM Oil Level is low
29/03.2021 02.13 PM Oil temperature is high
How can i achieve this this task?
03-29-2021 03:55 AM - edited 03-29-2021 04:01 AM
Hi gowthameie,
@gowthameie wrote:
Whenever new warning/error message is updating in the string indicator. New Warning/Error Message also to be appended with existing data.
How can i achieve this this task?
Open your log file and set the file position to the end of the file, then write your new string(s) to the file.
@gowthameie wrote:
Whenever new warning/error message is updating in the string indicator.
How can i achieve this this task?
Write a string when it is different to the previous string…
Edit after merging your cross-posts into one thread:
You surely don't want to "Replace or create" your error logfile when you want to maintain a history! Why not use "open or create" instead? You forgot to set the fileposition before writing (aka appending) new data into the file!
And what's the point of that Rube-Goldberg? Comparing a boolean value with FALSE is the very same as a NOT - and this NOT is not needed as you can switch the conditional terminal of the loop!
03-29-2021 04:06 AM
Can you remodify my code and post?
03-29-2021 04:11 AM
Along with date and time stamp how history can be maintained?
03-29-2021 04:37 AM
Hi gowthameie,
I cannot edit your code because I'm using LV2017 right now…
@gowthameie wrote:
Along with date and time stamp how history can be maintained?
Use FormatIntoString with a format string like "%<%c>T\t%s\r\n" and wire the current timestamp and your message string…
03-29-2021 04:40 AM
Lower version file is attached for your reference
03-29-2021 04:53 AM - edited 03-29-2021 04:54 AM
Hi gowthameie,
see this:
It doesn't make sense to provide an array of 12 error messages, but only check for two possible errors (IMHO).
And it makes absolutely no sense to index the wrong error messages according to your control labels!
03-29-2021 07:03 AM
Maybe my Super Error Indicator will work for you. It's one of the XControls in the zip.