LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error messages

Hi,

 

I would like to do that when one error message appear in one subVi at the same time that it appears in the mainVi. How can I show both messages at the same time one in the subVi and the other in the mainVI.

 

Best regards

0 Kudos
Message 1 of 143
(3,699 Views)

Send the reference to an error indicator to the subVI.  When the subVI writes an error message to the error indicator's terminal in the subVI, also have it write to a property node set to value that uses the reference received from the main VI.

 

Main VI

 

SubVI

Download All
0 Kudos
Message 2 of 143
(3,684 Views)

If you have a more detailed display, you might also consider using a Producer/Consumer system and a queue.

 

If you give a name the to queue, it becomes globally accessible. This makes it harder to identify the source of an error if you have multiple SubVIs, but allows easier access to it when sending an error. You could optionally bundle the VI name (or rely on call chain) to work out where the error came from or additional custom information.

 

Then in your main VI you can dequeue this queue and display any elements that appear.


GCentral
Message 3 of 143
(3,675 Views)

Hi @RavensFan,

 

Could you send me the programs in labview please. I have labview 14

 

Thank you

Best regards

0 Kudos
Message 4 of 143
(3,604 Views)

Hi, 

I was asking this because, I need to show the message of mysubVi in the main VI because at the moment that the message appear in the subVI, I have to press one button.

 

Best regards

0 Kudos
Message 5 of 143
(3,596 Views)

Hi 99,

 

in your other thread you got the recommendation to create better state machines.

 

Doing so (with more states, handling aspects of your device communication in smaller steps) would enable you to react easier/faster on error messages…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 143
(3,590 Views)

Hi GerdW,

 

I just want to know how can appear the message of one VI in another VI at the same time. I mean, at the moment that the error message appear in one VI, that ir appears inmediatly at the same moment in the other Vi.

 

Best regards

0 Kudos
Message 7 of 143
(3,586 Views)

I just want to know how can appear the message of one VI in another VI at the same time. I mean, at the moment that the error message appear in one VI, that ir appears inmediatly at the same moment in the other Vi.

 


The bottom line is that it cannot happen "immediately at the same moment." You can make it virtually immediate - but when the error occurs it has to be transferred from one vi to the other. There are lots of ways to do this. RavensFan gave you one option which is to send a reference of your front panel error indicator to the subvi and writing the value to that using a property node in your subvi. He gave you LabVIEW 2019 snipets, but reproducing those in LabVIEW 2014 should be straightforward. A method that I prefer is to use an Error Handler action engine. You would write the value to the action engine in the subvi and monitor the action engine in the main vi. This gives you the ability to easily react to the error event (you could even have code within the action engine to change the state of the subvi upon error or even upon a specific error). GerdW's suggestion to build a better state machine is also sound advice. You cannot react when you are doing everything in a sequence structure. You really need to restructure you code before trying to use a bandaid to treat symptoms of poor code design.

0 Kudos
Message 8 of 143
(3,571 Views)

 

Thank you very much for all your explanations and for your help.

The truth is that now I'm a little lost ..

Could you help me to reorganize better my state machine please

 

Best regards

0 Kudos
Message 9 of 143
(3,563 Views)

Hi 99,

 


@labview99 wrote:

The truth is that now I'm a little lost ..

Could you help me to reorganize better my state machine please


After the long time you are using LabVIEW now you are still lost?

 

To create a state machine you need to define steps/states. Make them as fine as possible/needed/senseful.

In your case maybe:

- send command to your device (with optional parameter 0/1 for stop/start)

- read answer

- process errors

- other states as needed

Your mainVI becomes the state machine, which calls those states/steps in the right order. Each state can be a single subVI. As soon as the state/step is executed you get an immediate error/result response…

 

Start with drawing all this on a sheet of paper!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 143
(3,561 Views)