LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 55 using the Serial Port Init VI

This is a follow-on question to one that I had regarding how to research PDA Serial Compatibility VI error codes when using LV with the PDA module.  An experienced vet help me find the error code descriptions, but now I have questions about what these errors mean.

 

I get Error 55 when using the Serial Port Init VI if my COM port does not make a connection (I am trying to set up a bluetooth serial connection using COM8 on a PDA).  The "explain error" says this means "the network operation is in progress".  This does not seem to have anything to do with initializing a serial port and is also not very helpful for how to correct the problem?  It is also not true since the error code is returned after the Init VI has finished, not while its operation is in progress.  Following the Error 55, I get Error 8 when using Serial Port Read VI and "explain error" says this means "File permissions error. You do not have correct permissions for the file."  Since I am trying to read a serial data stream, not a file, this also doesn't make much sense.  Could I be seeing the wrong explanations since I am viewing the error explanations on the PC instead of on the PDA (I am doing this in a VI created as a Windows Mobile 5.0 Pocket PC Device in Project Explorer) or is this as good as it gets?  I want to make some elegant method to notify the user of what should be done when the serial connection is not made, but I am worried that other error codes than just these 2 may occur and how best to handle PDA error notifications to the user.

 

Jerry

 

0 Kudos
Message 1 of 8
(5,236 Views)

Hi Jerry,

 

Both of these errors are likely the result of not closing the Serial Port after using the VI. "Network operation is in progress" means that the COM port is currently being used by something else. "File permissions error" is likely the same problem: the COM port is reserved, so this VI doesn't have permission to read from the serial port. First, make sure that you are using a Close VI to release the port at the end of your VI. If you are, than you may have aborted the VI or lost connection at some point, and so the port was never released, resulting in these errors. The error code descriptions are correct, but they are very general because they apply to a number of types of connections. If you want more specific descriptions for your users, you will have to determine how the errors are occuring in your case.

Product Support Engineer
National Instruments
0 Kudos
Message 2 of 8
(5,214 Views)

LaRisa,

 

Thanks for the help but maybe I did not explain my problem sufficiently.  I already know the causes of the Error 55 and 8.  The problem is that I want to trap these and any other errors that may occur in the Serial Initialization and/or Serial read/write processes and then report a meaningful error message to the user.  If error 55 and 8 will be all that I could ever get, then I can trap those errors and write out a meaningful error message about the cause.  What I don't know is whether these are the only possible errors.  So what I need is a complete list all possible error codes for the PDA Serial VIs (Serial Init, Serial Read, etc.) and possible reasons for the cause of each error. The 55 and 8 examples show me that using the "explain error" method to investigate the cause of errors is not sufficient for this purpose because the descriptions are too generic to be useful.   Better would be some method to use LV to "look up" a description of the error (similar to the general error handler VI), but this does not seem to be available for the PDA Serial VIs.

 

Jerry

 

0 Kudos
Message 3 of 8
(5,200 Views)

Hi Jerry,

 

Have you seen this article, LabVIEW Error Descriptions for the Pocket PC 2003 PDA ?

 

I haven't tried it, but one idea would be to use the file referenced in this article on your PDA and programmatically unbundle and use the error code to parse out information from that doc. Just a thought. Let me know if that works.

 

Thanks,

Dan Richards
Certified LabVIEW Developer
0 Kudos
Message 4 of 8
(5,169 Views)

Dan,

 

Sorry it took me so long to reply to your post.  I was away for awhile and just got back to this project today.

 

Unfortunately, the file referenced in the KB is not very useful.  It is also not at the location shown in the KB.  On my system using LV82. I found it located at: "C:\Program Files\National Instruments\LabVIEW 8.2\PDA\Utilities\VC\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\Include\Armv4i".  The error messages in this file seem mostly to be the same cryptic and inaccurate ones that I get using the LV "explain error" utility.  I cannot even find the error 8 that I get using the Serial Read VI in the file and the error 8 that is in the file says it is "not enough memory" which has nothing to do with the serial read error.  I also don't think there is any way to use this file to determine all possible errors that a particular VI might generate which is ideally what one needs to know to make a robust error trap for a program.

 

Jerry

 

0 Kudos
Message 5 of 8
(5,139 Views)

Hi Vsaone,

 

The location has changed since the KB was created and that KB will need to be changed, I'll put it on my to do list 🙂

 

If you look inside the winerror.h there are descriptions for the two errors you are receiving. The error 8 (out of memory) happening second might just be a result of the first error, so we can typically disregard it for the time being until we solve the first problem... error 55. However, an out of memory problem might rear its ugly head later if this application has a memory leak or is memory intensive.

 

Error 8 is defined in the winerror.h file here:

//

// MessageId: ERROR_DEV_NOT_EXIST

//

// MessageText:

//

//  The specified network resource or device is no longer available.

//

#define ERROR_DEV_NOT_EXIST              55L    // dderror "

 

 

Which means when you are trying to configure/open your serial port, the PDA says... sure I would do that if it even existed. Can you confirm that the COM8 is available, functioning, and visible to the PDA?  

Stephen B
0 Kudos
Message 6 of 8
(5,116 Views)

Stephen,

 

Thanks for the help, but once again I must not be explaining the issue adequately.

 

I already understand what causes both the error 55 and 8.  Error 55 happens when I try to initialize the serial port COM8 if the bluetooth device that I want to connect with is not available.  Error 8 occurs after that when trying to do the Serial Read since there is no COM port from which to read.  My issue is that I want to make a robust error trap that catches ALL possible errors from the Serial Compatibilty VIs.  I am having trouble finding any documentation that tells me if Error 55 and 8 are the only possible errors or whether other Errors are also possible from the Serial Compatibilty VIs.  I don't think the winerr.h file is the answer because I don't believe it can be used to track the source or the cause of the errors listed in this file, and the error messages in the winerr.h file don't really match the causes very well, at least in the cases of these two errors.

 

Jerry

 

 

 

 

 

 

 

0 Kudos
Message 7 of 8
(5,106 Views)

Vsaone,

 

Sorry about the confusion. Unfortunatly since Microsoft controls the code for the error handling on Windows Mobile, we cannot change how the operating system itself returns errors to LabVIEW. When LabVIEW requests something that throws an error, if the error returned from the operating system to LabVIEW does not provide very much information, there is nothing we can do about it. Your best source of information about what PDA specific errors mean what is in that .h file provided by Microsoft.

 

As far as every single error LabVIEW can return from serial function calls, there is unfortunatly no specific piece of documentation that lists them. In hardware specific functions like serial, which make calls to the operating system, the majority of your errors are going to be returned from the operating system unless you simply wire up the LabVIEW VIs wrong. 

Stephen B
0 Kudos
Message 8 of 8
(5,081 Views)