LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Vector LIN

I am trying to use the dll's that Troy made.  Below is onde of the samples modified slightly.

When trying to open a port, an error is seen.  I only dabble in programming so any adivce is appreciated.

Please see the attached.

 

0 Kudos
Message 1 of 5
(3,635 Views)

Have you tried contacting Vector support?

They provide a .NET interface which may be more reliable than the LabVIEW wrapped DLL calls that you're using now.

 

Can't see all of the error message. Have you tried a driver update and using a Vector utility to make sure the device is recognized and operating?

0 Kudos
Message 2 of 5
(3,625 Views)

I did verify wirh CANoe, and also the latest dll was installed.

I will call vector (again), but they did not seem to helpful.  I have also been told that using active X controls may be a better way to go...but have never used these.  I looked at some examples communicating on a CAN bus, but not LIN.  Should be similar, but need to look into it further.  Is there a document detailing how to use the active x controls?  Other than what is in the LabView help?

0 Kudos
Message 3 of 5
(3,613 Views)

Active X will go the way of the dodo soon.  If there is a .NET solution it would be preferable.  (Just one man's opinion)


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 5
(3,608 Views)

Hello kltchurch,

Sorry for taking so long to answer. My subscription to the "vxlapi" tag didn't seem to notify me of your post.

 

The default error codes for the vxlapi.dll go from 0 (no error) to 255 which would overlap with other error codes. So I added 6000 to the error codes.

Unfortunately 6255 (or 255) is the useless "unspecified error occured". It usually means the driver has fallen over for some reason.

The fastest, most effective way to reset the hardware is to unplug it and pulg it back in again.

 

As to why it may have locked up, there seems to be a flaw in your calling sequence.

 

It is really best to follow the api documentation (XL Driver Library - Description.pdf) that comes with the driver library from Vector.

Section 2.3.2 has the appropriate calling sequence for a LIN application defined.

 

You are addressing device 0 channel 0 and opening it as a LIN port. Then you are calling what appears to be CAN set channel bitrate, CAN flush transmit queue and then is it CAN set channel acceptance? (It's a bit tricky to tell from a picture.)

 

You can't use CAN only functions on a LIN channel. This will throw a completely different error and may be why the next time you tried to run the VI it gave a 6255 error.

 

There are two LIN examples in the zip file attached here: Vector XL Driver - LabVIEW wrappers

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 5 of 5
(3,316 Views)