LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Any examples of event driven front panel, paired with real time serial communications going on?


@Mark_Yedinak wrote:

You are killing the queue while another loop is currently waiting on it. I would use explicit messages for your queue so you can implement stuff like Stop and Exit messages. Your consumer wold catch these messages and act accordingly. Then release the queue only after all your loops have terminated.

 

If you decide to continue as you are then at a minimum you should wire the error out of your dequeue to a case statement and only process the data when there is no error. Since you do nothing with the error the automatia error handling is kicking in and giving you the error message.


Thank you for the reply.

Is there a simple way to kill or ditch the automated error being thrown?  What would a case statement look like that would take this error and remove it.

 

I've not gotten to error handling yet in my learning of LV...

😞

 

At this point I just need to be able to hit the stop button and have it stop without an error message.

 

Thank you,

 

C

0 Kudos
Message 11 of 16
(768 Views)

@cayenne wrote:

Is there a simple way to kill or ditch the automated error being thrown?  What would a case statement look like that would take this error and remove it.


You can disable Automatic Error Handling in the VI Properties, and then the error dialog won't appear.  You could also wire the error out terminal from the queue operation to the Clear Error function, which will also prevent the dialog from appearing.  This of course is not the right way to handle errors in general, but in this specific situation that error is harmless since you've intentionally destroyed the queue in order to stop the program.

Message 12 of 16
(761 Views)

@nathand wrote:

@cayenne wrote:

Is there a simple way to kill or ditch the automated error being thrown?  What would a case statement look like that would take this error and remove it.


You can disable Automatic Error Handling in the VI Properties, and then the error dialog won't appear.  You could also wire the error out terminal from the queue operation to the Clear Error function, which will also prevent the dialog from appearing.  This of course is not the right way to handle errors in general, but in this specific situation that error is harmless since you've intentionally destroyed the queue in order to stop the program.


Fantastic!!!

 

Thank you, I"ll look for that clear error function and give that a try!!!

 

I know I have a lot to learn here and error handling the proper way is one thing....but this should get me by for now!!!

 

C

0 Kudos
Message 13 of 16
(754 Views)

@cayenne wrote:

@nathand wrote:

@cayenne wrote:

Is there a simple way to kill or ditch the automated error being thrown?  What would a case statement look like that would take this error and remove it.


You can disable Automatic Error Handling in the VI Properties, and then the error dialog won't appear.  You could also wire the error out terminal from the queue operation to the Clear Error function, which will also prevent the dialog from appearing.  This of course is not the right way to handle errors in general, but in this specific situation that error is harmless since you've intentionally destroyed the queue in order to stop the program.


Fantastic!!!

 

Thank you, I"ll look for that clear error function and give that a try!!!

 

I know I have a lot to learn here and error handling the proper way is one thing....but this should get me by for now!!!

 

C


You should really put your processing code inside a case statement and wire the error to the case statement. Do you really want to process invalid data?



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 14 of 16
(743 Views)

 

cayenne wrote:

Fantastic!!!

 

Thank you, I"ll look for that clear error function and give that a try!!!

 

I know I have a lot to learn here and error handling the proper way is one thing....but this should get me by for now!!!

C


The best error practice is to handle all errors.there may be times where you may want to simply clear an error.As Mark told if the error is harmless,we are using a function called "Clear Errors" that will clear any error in an error cluster.So no problem with using 'Clear Errors'.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 15 of 16
(737 Views)

cayenne,

 

I have to apologize. In my haste to get you an example (and get to bed), I put a bit of code in there that can only be described as - "very bad programming". Smiley Sad

 

The delay after the "Stop Timed Structure" and before the "Release Queue" function was an incorrect way to deal with the issue of the queue being released before the Timed Loop has stopped. Computer speed and the complexity of the Timed loop code could effect the time required to stop the queue (as you found out). Coding like this is a bug just waiting to happen.

 

The right way is to use data flow to ensure that the Timed Loop has stopped before releasing the queue. 

Improved stop Code.png

 

See if this solves your queue error.

 

-----

 

There are times when you need to dismiss an expected error. Here are two ways to do that.

remove error.png

 

I think that removing a single expected error using the Clear Errors function is dangerous because you lose visibility of unexpected errors. (Just for fun you can open the Clear Errors function and see all the fancy code in there. Smiley Happy)

 

Comments should always be put in the code to describe what is being done and why. Especially special case code.

 

steve

 

--------------------------------------------------------------------------------------------------------------------------
Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
question. Give "Kudos" to replies that help.
--------------------------------------------------------------------------------------------------------------------------
Message 16 of 16
(732 Views)