LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a custom error code when bytes at port is equal to zero

I am trying to create some custom error codes for my VI.  One of them that I want to create is when there is no data on the serial line.  I was trying to do this checking the number of bytes that are read in from the serial port.  If the number of bytes is equal to zero, it would return an error to check the cable or to power on the device (using the general error handler and creating my own codes).

The problem is that I cannot figure out how to flag the error.  I was thinking I could use the Equal in the compare pallette to compart the bytes at port to zero.  If it was true, then the error would be flagged, otherwise it would be ok.  Is there a VI to do this or some way to add the value to the error cluster???

Kenny
Kenny

0 Kudos
Message 1 of 3
(2,819 Views)
It's pretty simple to generate your own error. All you need is an error cluster constant as shown here,
and defining the error code. If you go to Tools>Advanced>Edit Error Codes, you can create your own codes that get reported just like the native LabVIEW ones.
 

Message Edited by Dennis Knutson on 02-21-2006 09:18 AM

0 Kudos
Message 2 of 3
(2,820 Views)

Thank you very much.

 

Kenny

Kenny

0 Kudos
Message 3 of 3
(2,806 Views)