10-11-2010 12:38 PM
I am using SiUSBX.dll to communicate with a usb device. Instead, I want to communicate with the usb device using regular LabVIEW code. For example, I need to write an array to the device to activate the channels.
P.S. I used this link to help create a raw USB connection to my device which seems to work. http://zone.ni.com/devzone/cda/tut/p/id/4478#toc0
10-11-2010 01:25 PM
No, you cannot convert a DLL to LabVIEW code. You can import the DLL (assuming you have the header file). This will create VIs that call each of the exported functions. These VIs act as wrappers around each DLL function.
While you may have created a raw USB connection, do you have the actual information as to the protocol? It's quite rare for companies to provide this information. If you have a DLL you're usually better off sticking with that.
10-11-2010 01:44 PM
Thanks smercurio_fc.
I found a .h file on the web that i think is the correct one. The reason i'm doing this is so i can use the same usb device on a Mac. As you probably know, the .dll will not work on a Mac. I am currently trying to use the utility you mentioned.
10-11-2010 03:06 PM
@kevmi2ca wrote:
Thanks smercurio_fc.
I found a .h file on the web that i think is the correct one. The reason i'm doing this is so i can use the same usb device on a Mac. As you probably know, the .dll will not work on a Mac. I am currently trying to use the utility you mentioned.
The import utility will not help at all with this. It generates nice LabVIEW wrapper VIs around calls to the DLL, but it still calls the DLL.
10-11-2010 03:19 PM
Indeed. If this is going to be used on a Mac, then the import operation won't help you. As I indicated, it still calls the exported functions ... which are in the DLL. of course
What is this device that you're trying to communicate with?.
10-11-2010 03:52 PM
Yep, just realized this won't work.
The hardware: I have a custom made sensor package which contains a pressure transuder and an accelerometer. The sensor transmits the data wirelessly to a USB receiver which uses the an SI Labs microprocessor. We use the SiUSBx.dll ti read the data into LabVIEW. The commands are fairly basic: Open, Init, read, Write, Close.
The data is a simple array of int.
10-11-2010 06:35 PM
You could run the device on a Win PC. Use an usb sniffer to get the commands send on usb. Replicate them with VISA.
Well, I see the flaw, inbetween you have the microprocessor. So cut this guy out or get Mac drivers for it.
Felix