Jump to content
boochbrain

VISA errors occuring only in executable (not development)

Recommended Posts

Hi All,

 

This is my first post on LAVA, so here it goes:

 

I am creating an application that involves reading data on two RS-422 serial ports. Everything was going just dandy until it was time to build my application into an executable. I've spent time debugging my issue and have been able to narror down where the source of the error is coming from, but I can't figure out why it's happening or how to fixt it. I created a simple VI that clearly demonstrates the error.

 

The VI  first configures two serial ports using VISA. It then gets the number of bytes at the port and reads from VISA resource in a loop. Finally the resource refs are closed. Before building into an executable (development mode), everything works fine. When I build this single VI into an executable, there are errors anywhere there is an Instr Propert Node. The error code is -1073807246 (which I can't find anywhere).

 

Does anyone know why I'm having this issue? Is this some sort of dependency issue? Maybe I'm not really including some VISA functions in my dependenices?

 

 

Serial Read.vi

Share this post


Link to post
Share on other sites

Here's the error description as stored in LabVIEW (help->Explain Error..):

 

 

Error -1073807246 occurred at an unidentified location
 
Possible reason(s):
 
VISA:  (Hex 0xBFFF0072) The resource is valid, but VISA cannot currently access it.

Where are the errors comming from? I suppose from the 'Open VISA resource'.

Is this running on the same computer as the Development enivronment?

 

You might need to wait a little bit before calling the VISA open function. Try to add a wait of 10 seconds before the open VISA session.

 

Ton

Share this post


Link to post
Share on other sites
Is this running on the same computer as the Development enivronment?

If this is true close LabVIEW entirely to ensure that it isn't holding the resource.  This isn't always necessary but if cleanup is not done properly this can be an issue.

  • Like 1

Share this post


Link to post
Share on other sites

If you are deploying on a different computer, then you need to include the NI-VISA Runtime 5.3 installer when you build the installer.  Might be necessary to include the NI-Serial 3.9.1 too.  These are under the additional installers tab in the installer properties.

Share this post


Link to post
Share on other sites

Thank you all for responding. Ton got it right. I had a different VI that wasn't closing the refs and so my LabView environment was still holding the resources.

 

I want to pose another question - Is the open Visa function necessary when reading from serial ports? I have only been using the VISA configure function in some cases, and it has been working fine.

Edited by boochbrain

Share this post


Link to post
Share on other sites
Thank you all for responding. Ton got it right. I had a different VI that wasn't closing the refs and so my LabView environment was still holding the resources.

 

I want to pose another question - Is the open Visa function necessary when reading from serial ports? I have only been using the VISA configure function in some cases, and it has been working fine.

 

It's not strictly necessary since LabVIEW does an implicit open on a VISA resource when it does find that that resource hasn't been opened yet. LabVIEW stores the internal VISA handle that belongs to a VISA resource with the resource itself in a global list of VISA resources.

 

However suppose you didn't use the VISA Open in your executable: The implicit Open would have failed too, but possibly without a good way to report that error. So I really prefer to always explicitly open VISA resources anyway. Costs nothing when writing the code, but makes it much clearer what is happening and possibly improves error detection.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.