LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous status indicator with custom messages

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.

0 Kudos
Message 11 of 15
(162 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 15
(158 Views)

@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.

 

0 Kudos
Message 13 of 15
(148 Views)

@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.

 

  • Why would you use a comparison with a coerced 1 of the wrong representation instead of just using "not equal zero"?
  • Have you ever thought what the purpose of the "AND TRUE" towards the end is? that's just a NOP and returns the other input unchanged.
  • Do you know that you can wire an error directly to a case structure?
  • I really have no idea what the purpose of that parallel loop is. Just to prevent the VI from completing if an error occurs? With no possibility to ever call this non-reentrant VI ever again in the same session?
  • Why aren't the input/output connectors aligned horizontally in the subVI train?

 

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.

Message 14 of 15
(133 Views)

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.

 

 

altenbach_0-1711123975708.png

 

altenbach_1-1711124018763.png

 

Message 15 of 15
(99 Views)