LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using labview to control a third party library that has been programed in c intended for java

 Capture5.PNGCapture6.PNG

Capture4.PNGCapture6.PNG

 

I am trying to use a third party library that is written in C and intented for Java programing. What I am trying to do is to find the location of a device and open the device. In enumerate USB program, I used the FDD_enumeratWInUSB fucntion, it asked for a input GUID and supposes to return a file path. However, it seems that I am not doing it right. It doesn't not want to return me a path. 

In the open device program,I used FDD_DevOpenWinUSB. if I input a devpath it can't open the device.  I tried to bypass the eumerate step, and directly input a path into opend Device program. It doesn't work either. I have trieCapture1.PNG

Capture2.PNG

Any one knows what I am missing or what else I can try to make it work?

I attached the entire docment that decribes the third party library. 

0 Kudos
Message 1 of 2
(2,636 Views)

First, do you know the GUID of your device?

 

The function you're trying to use returns a pointer to a linked list, where one of the elements of the linked list is a null-terminated string. Unfortunately, this is a structure that will be difficult to work with in LabVIEW. Do you have some C programming experience? If you don't understand pointers in C, you will either have to learn about them or find a C expert to help you. I don't have time at the moment to try to work through all the details to provide example code, and even if I did I couldn't test it. You'll initially need to pass a pointer-sized integer, by pointer, to the Enumerate function as the devList parameter. Then, you'll take the returned value of that parameter, and using a combination of GetValueByPointer and MoveBlock (search for these on the NI site), you could go through the levels of pointers until you get to the string that contains the path. If you have more than one device you'll need to iterate through the rest of the linked list the same way.

 

As an aside, the Java portion of your question is irrelevant. The vendor has supplied a DLL with C prototypes for use in almost any language, and additional Java library specifically for Java, but you're calling the DLL and not the Java library.

0 Kudos
Message 2 of 2
(2,620 Views)