05-05-2009 06:43 PM
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
05-06-2009 06:26 PM
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