LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Xmega dll read and write usb bulk

Hi

I worked hard to read and write buffer of xmega bulk usb by labview. first of all after many days work on hid class finaly i can read buffer by labview and dll.

but with linusb0.dll from atmel site i can't build vi for reading buffer.

The strange things is that when i import shared library when labview build usb_open vi labview coud not build vi. after that i decided myself build vi for read and write buffer but i can't

I attached .dll file .h file and c code  that works fine when i connect xmega vendor class to my pc

This C code is atmel test code

 

 

Download All
0 Kudos
Message 1 of 5
(3,700 Views)

Dear saleh_hp,

 

I think we need some more information from you. First, when you say you “can read buffer by labview and dll,” what .dll did you use that worked for you? When you say LabVIEW can’t build the usb_open VI, what exactly do you mean? If you’re getting an error, please take a screenshot and post it.

 

Next, looking into the libusb0 dll, it appears it’s not directly compatible with LabVIEW. Specifically, if you look through the bindings at the libusb website, LabVIEW isn’t listed.

 

However, this blog had success using the .NET binding and calling the functions through .NET constructors. Take a look at their process and see if that’d be an option for you.

 

Regards,

Cason

 

Cassandra Longley
Senior Technical Support Engineer - FlexRIO, High Speed Serial and VRTS
Message 2 of 5
(3,644 Views)

Thanks cason

this is true i didn't know that libusb doesn't support labview

I try get data with Libusbdotnet but another time i am not success. I finaly change micro code from atmel to lufa and visa protocol respond to micro.

when i use visa and lufa asf for bulk i can't get more than 1000 sample per second and correct shape of signal, i don't khow what is the problem

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

Just because LabVIEW isn't mentioned on the libusb site doesn't automatically mean that it couldn't be used, only that nobody from the libusb project released a LabVIEW binding or more likely even bothered to try to do it, since LabVIEW is a commercial package. As you can see all the bindings on the that libusb page are for languages that have at least an open source and free option to be used.

 

That said the libusb API isn't exactly LabVIEW friendly (or Visual Basic for instance). The bus and device enumeration with linked lists is definitely something that, while possible to do in full LabVIEW, isn't something you want to do inside LabVIEW but rather implement in a wrapper DLL written in C(++). So trying to use a .Net interface is probably the easiest workaround unless you want to dig into writing a C wrapper DLL around libusb (or God beware, start to play C compiler yourself by implementing everything inside the LabVIEW diagram).

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 5
(3,562 Views)
Are you trying to do low-level USB communications? Did you know you can use NI-VISA RAW to communicate with USB devices? There's a pretty good resource about it here: http://forums.ni.com/t5/LabVIEW/Nugget-1-of-n-GEtting-started-with-USB-communication-via-VISA/m-p/74...

LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 5 of 5
(3,552 Views)