03-20-2024 07:43 AM
But i want to specify the error, like if these are my steps:
1. Init coms
2, Write old date/time
3. Write UTC
4. Close coms.
And if the error ocurred between step 1 and 2 i want to drag an error like "ERROR. Coms failed." during the execution of the test in my indicator until its finished.
03-20-2024 07:49 AM
Hi xespizua,
@xespizua wrote:
i want to specify the error, like if these are my steps:
1. Init coms
2, Write old date/time
3. Write UTC
4. Close coms.
And if the error ocurred between step 1 and 2 i want to drag an error like "ERROR. Coms failed." during the execution of the test in my indicator until its finished.
Then you need to change your VI according to your requirements!
You got so many suggestions until now…
03-20-2024 08:08 AM
@xespizua wrote:
But i want to specify the error, like if these are my steps:
1. Init coms
2, Write old date/time
3. Write UTC
4. Close coms.
And if the error ocurred between step 1 and 2 i want to drag an error like "ERROR. Coms failed." during the execution of the test in my indicator until its finished.
Use the same VI I gave before but write the error description of the error cluster to the status indicator instead. Maybe add a case structure somewhere that maps an error code to the error text you want to display.
If the library you are using is well-written, then any error occuring in a VI should be preserved during other VI calls and the same error text is then displayed at each subVI call.
03-20-2024 10:15 AM
@xespizua wrote:
And i know about the stop function but the structure of the code its non-negociable.
Sorry, I am late to the party, but you seem to dig yourself into a bigger and bigger hole and the real problem is architecture as already mentioned. We don't have any of the subVIs and can only see what's there and it does not inspire much confidence.
As has been mentioned, LabVIEW is forgiving enough that even really bad code typically runs OK and you can keep adding more and more Rube Goldberg code to bounce data around via locals. Personally, I would spend 10 minutes rewriting it from scratch. Shouldn't take longer than that and you'll get days back in the investment by simplifying debugging and scalability in the future.
Personally, I might just add a bigger string indicator (handful of lines) where each operation appends a line describing the current operation and its result.
03-22-2024 11:13 AM
As a quick reminder, here's how a very simple state machine skeleton could look like that updates a message indicator and counts errors. It can easily be expanded with much more functionality.