02-19-2018 11:08 AM - edited 02-19-2018 11:31 AM
Hello guys,
I have been tring to interface the logitech dll by reading the sdk, but it has always been a challenge for me to adapt data types, can you help me for the 2 in the pictures for exemple ?
At the end of the project I intend to post a full library to drive the logitech wheels.
Update : I tried the generation wizard, it is doing almost the same things as I do but still no result (I try the is connected at index 0, always false/0)
Regards
02-21-2018 11:16 AM - edited 02-21-2018 11:24 AM
Hey M.atthieu,
Interfacing a dll is not always an easy job, in any language...
One advice would be to find a code (even written in C or C++) that calls this dll. There are probably some on this dll maker website. Then it is easier to copy the synthax.
Other than that, can you send us the dll and your small LabVIEW code with the call function node?
Thanks
Junior
02-22-2018 02:57 PM - edited 02-22-2018 03:01 PM
So what does not work? At least your LogiIsConnected() function looks mostly right except that it may use stdcall instead of cdecl calling convention. The documentation snipped you show doesn't mention that and it is very much possible that the whole manual doesn't mention it. If it is not documented you have to try out, the wrong one should give you an error dialog or possibly crash LabVIEW when you run the function.
LogiGetFriendlyProductName() is nastier. It uses wchar* parameters which are wide char strings. LabVIEW strings however are ASCII (8 bit characters). So it will be not trivial to call this function from LabVIEW. And the documentation f*cks up here. It shows a wchar* return datatype but says that the function returns a true if it succeeds and false otherwise. A clear documentation error, but which of the two is wrong????
02-23-2018 03:15 AM - edited 02-23-2018 03:16 AM
Hey !
Well it is working (at least is Connected and Has Force Feedback), what I did and and what the wizard did is OK but wasn't using the good initialisation function, I will continue testing all the function regarding what you said with the difference of the documentation and what should be expected and post an update when everything will work (I hope !)
I posted a picture of a quick test to see the behavior...
Keep you posted !