Jump to content

TroyK vector wrapper


Recommended Posts

Hi,

 

 

 

I'm using the TroyK Vector XL Drivers but sometimes there is an error message window stating "Invalid access".

 

This error is fixed by disconnecting and reconnecting the Vector hardware USB cable. Is there a programattically solution to confirm if the channel I'm trying to use is already in use, then close it and then try to reopen again?

 

 

 

Thanks!

Link to comment
  • 2 months later...

Not really enough information in the question to give a definitive answer, but here is some useful info...

This error message is usually only seen when trying to open or access a LIN channel.  Only one app can open a LIN channel successfully because it must have 'init' access.  If you forget to close the port (or an error prevents the close port function from executing), you can't open it again without encountering this error.  For CAN channels it just opens a new port incrementing the porthandle.

You then have to either unplug the hardware (as you stated) or close the app which is holding the port open (LabVIEW, your compiled app or whichever app has it) forcing the open handle to release.
(The port ref handle seems to be a simple incrementing integer starting at 1. You could maybe try to cycle through a few port handle ref ids incrementing from 1, executing the close port function on the imaginary ref numbers hoping to get lucky, but that seems messy.)

It's best to make sure you are always closing the port, and in the case of LIN, make sure no other app has claimed init access on the channel.

Link to comment

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.