LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Communication Error Creation

Okay, here goes.

 

This is my second VI and I'm concerned if I'm using best practices for creating and handling errors.  My VI writes data out of a serial port and then waits for a specific response.

 

The response should look like:

/* General Packet Definition (Input Data)
   0        $A5 signature byte
   1        Address - (0=PC)
   2        packet length - total packet length, address through CRC
   3     command ()
   x        parameters or data
   y        2 byte CRC -   */

 

If I do not read the signature byte, if the packet is not addressed to me, the packet length is incorrect or I never receive information I need to generate and error, close the port and exit the subVI and report the error.

 

I've created my own error codes and edited the Error Code file.

 

Am I doing this right?  Comments, suggestions or insults...all is appreciated .

 

Thanks

0 Kudos
Message 1 of 2
(2,592 Views)

KevinO,

 

From everything that I can see in your code, it looks like you are programming correctly.  Your code is also very neat and easy to read, thank you! 

 

Eric K

Applications Engineering

National Instruments

0 Kudos
Message 2 of 2
(2,560 Views)