LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 1097 when calling void **

Solved!
Go to solution
Solution
Accepted by topic author Khonzi

Still haven't looked at your VIs due to version issues, but I finally had some time to look more closely at the C code, and now I can at least make an educated guess about the problem you're seeing.  As I understand it, you're getting an error at xapi_getblock, probably due to the void ** pointer.

 

Does your documentation specify if, after dereferencing, you have a null-terminated string or (more likely) a fixed-size block?  In either case, I would use the GetValueByPointer VI twice.  The first call will return an I32 (or I64 on a 64-bit operating system) that is actually a pointer.  Feed that value to a second instance that retrieves the actual data.  If you have a null-terminated string, you can retrieve it as a string.  If you have a fixed-size array, either retrieve one element at a time or use MoveBlock to get the entire array at once.  Both these approaches are explained here: https://decibel.ni.com/content/docs/DOC-9091

0 Kudos
Message 11 of 35
(2,306 Views)

Thanks

 

It worked. I passed void ** as a int32* and it returned an address. I then used GetValueByPointer to get the data. Thanks for the help.

0 Kudos
Message 12 of 35
(2,285 Views)

Hi Khonzi

 

Trust you are well. I hope you are still able to assist as i see this topic was from 2012.

 

I'm having this exact issue with the Xapi driver as we speak. I have read your notes here, but I cannot seem to come right.

The GetBlock() method passes out a System.Byte*. You say you passed this to a Int32* and then used GetValueByPointer.vi. Can you explain what you mean by "passed this to a Int32*"? If possible a print image of this. I have everything working except this part.

 

Regards

 

Waz

0 Kudos
Message 13 of 35
(2,177 Views)

System.Byte does sound like a .Net datatype, so you are most likely in the wrong thread here. This is about using the Call Library Node to interface to the exported C interface from their DLL, not the .Net assembly through .Net node in LabVIEW.

 

If the type library of the .Net assembly would have been created proberly you should simply get back an Byte array in LabVIEW. Not sure what you really get back from your description. Attaching actual code to posts is always a good idea.

Rolf Kalbermatter
My Blog
0 Kudos
Message 14 of 35
(2,166 Views)
Thats correct. Khonzi used the C interface and I'm using the .Net interface. The methods however are almost exactly the same. I'm however going through Khonzi's code now to see if I can get his working with my sensor.
0 Kudos
Message 15 of 35
(2,161 Views)

While the APIs are similar, low level details about how pointers are handled will differ very much. In fact in .Net you usually don't have simple pointers anymore, unless the creator of the assembly decided to take some shortcuts and expose some underlaying low level unmanaged interface in his API.

Rolf Kalbermatter
My Blog
0 Kudos
Message 16 of 35
(2,158 Views)
I did manage to get Khonzi's sample working, but I get basically the same issue. My issue is I'm getting the System.Byte* in the .net version. Using the MoveBlock and the GetValueByPointer and not getting the results I expect. It seems I'm just locating random data. This is the same results as Khonzi's sample.
0 Kudos
Message 17 of 35
(2,144 Views)

Attach your code!

Rolf Kalbermatter
My Blog
0 Kudos
Message 18 of 35
(2,134 Views)

Hi

 

Attached is the code. I'm using Labview 2015. All the drivers and config files are in the zip file if you require to change the config file path or the dll path.

 

In the read case structure is the area that I'm having trouble with. I have done tried to pull the data out in 2 ways. One way with a for loop and a pointer vi and the other with the moveblock library. Both of which dont collect the right data and just point to random data. Please note i have played around alot with the types to try get something out so most likely there is a type issue here and there.

 

 

Regards

 

Waz

0 Kudos
Message 19 of 35
(2,128 Views)

hi,

 

I am building the application using the xapi , how we can understand that whatever data is coming is the actual data .

0 Kudos
Message 20 of 35
(2,059 Views)