LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

vector xl driver library dll calling by Labwindows/cvi

hello, everybody .

 

i am developing one app to debug our product. the intention is to use vector vn1610 or vn1630 as hardware and labwindows as  software. but when i read the demos vector supplied, i found it is c++ based, which not supported by labwindows.

 

i transformed a little bit but still cannot send out and receive CAN mesages. do anyone have the demos or examples based on labwondows?

 

do you know how to use the function of xlCanTransmit and  xlReceive? how can i receive the messages from the bus?

 

 

 

0 Kudos
Message 1 of 7
(3,085 Views)

Take a look at the xlCANdemo sample program that should have gotten installed when you installed the XL Driver Library on to your PC.  That is a single file, console-based program that you should be able to build in LabWindows/CVI with very little modification. 

 

Key points: 

  1.)  Include "VXLAPI.H" or VXLAPI64.H" in your main header file as appropriate for your application.

  2.)  Include the matching library file in your CVI project.

  3.)  If needed, place copies of the Vector DLL(s) into your project directory.

 

The Vector XL library is ANSI-C compliant, so you shouldn't have to do much, if any, converting from C++.  The functions are exported as regular C functions and are directly callable from the LabWindows environment.  Follow the instructions in section 2 of the XL Driver Library manual to initialize and configure a CAN channel, and use the xlCANdemo source file as an example of how to do that.

0 Kudos
Message 2 of 7
(3,019 Views)
hi, Sporty thank you for your info. I tried it today and it works very well to call the vector CAN case. but I have a new question about the cyclic CAN message sending: how you send the cyclic CAN messages in Labwindows/CVI ? I add the delay() function after each CAN message send out, but the CPU load comes to be very high. I think the cycle time in my case (12ms) is an common cycle time for CAN messages.
0 Kudos
Message 3 of 7
(3,003 Views)

The easiest way is to use an asynchronous timer to control transmission of the CAN messages.  From the Instrument Menu, select Load, then find "asynctmr.fp" and make sure you add it to your project.  Search the help index for "asynchronous timer control" if you have not used them before and need info on how they work.  

 

You can set the timer to have the same period as your fastest message cyclic rate, and then divide the period down via software if you need to also send messages at a slower rate.  Depending on the actual rates, you may have to figure the period of the timer to be the lowest common denominator of all your cyclic rates so that each rate is a multiple of the base timer period. 

 

And try to avoid using the Delay() function.  Use Sleep(ms) instead if you need to pause operation of your program without loading the processor down. 

0 Kudos
Message 4 of 7
(2,994 Views)

Hi, xcfatxc
I have a question that whether it is possible to communicate with VN1640 (1600 family) directly with LabVIEW ?
I will indebted to you if you can guide me in integrating the VN 1640 directly with LabVIEW.

0 Kudos
Message 5 of 7
(863 Views)

Hi Tarunakgec1

since you are working with LabVIEW you should post a question directly in the relevant board: you will find little or no help in this CVI board since those environments are very different



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 6 of 7
(852 Views)

Thanks for correcting.

0 Kudos
Message 7 of 7
(752 Views)