Supporting SpaceNavigator in LabVIEW

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
ojohnsen
Posts: 3
Joined: Thu Apr 24, 2014 8:24 am

Supporting SpaceNavigator in LabVIEW

Post by ojohnsen »

Hi there.

I'm trying to get support for the SpaceNavigator in LabVIEW, and after two days I'm still not getting anywhere.
I've tried making a wrapper dll in Visual Studio, simplifying the siappdll.dll functions. But no matter what I do, the SbInit function only returns 0 (i.e. no contact with device).
I've tried moving the dll around, from the project folder to System32 etc., but this makes no difference.

I've also tried using the joystick functions in LabVIEW for reading out the values. And this works, in a way. But rather than reading out the axis of the SpaceNavigator directly, I'm reading an accumulated value that is added the axis value of the mouse every 16ms. So I have to subtract the previous value from the value being read to actually get the axis value of the mouse. This causes timing issues, since I cannot guarantee that I will always read the values faster than every 16ms, which in turn means that the calculated axis value will be n times higher than what the axis actually is.

Can you please advice me on how to get access to the device in LabVIEW?

Thanks!

Best regards,
Øystein Johnsen.
ojohnsen
Posts: 3
Joined: Thu Apr 24, 2014 8:24 am

Re: Supporting SpaceNavigator in LabVIEW

Post by ojohnsen »

To elaborate a little on one thing that I've tried to do so far, is that I've just modified the 3DxTest demo that came with the SDK. I changed the output type to DLL, and added a simple function TestFunction() that returned the result of the SbInit() function. And I tried calling TestFunction from LabVIEW. But no matter how I tried building the software, it still returned 0. But when setting the program back to application type (exe), it worked just fine.
jwick
Moderator
Moderator
Posts: 3338
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Supporting SpaceNavigator in LabVIEW

Post by jwick »

The best place to start is by turning on the Log File. Make sure you are using 3DxWare 10. The log file option is in the systray. The log file is at %appdata%\3dconnexion\3dxware\3dxservice.log.

What you will probably see is that the driver has no idea who LabView is, so it sticks with the last application it knew about. You need to make a Cfg file for LabView to tell the driver what to do when it sees it in focus.

The first thing you need to decide is what transport protocol you will use to communicate with LabView. If you can write a plugin that LabView loads, the best protocol is the S80 protocol (which is what 3DxTest uses). In that case, make a copy of the AppDefCfg_S80.xml (%PROGRAMFILES%/3D...), rename it, change the name and executable name.

Other transport options are to have the driver call functions in a DLL or EXE that you write. This is useful if LabView has a COM interface, or if you want to write out to some other IPC mechanism. You can write a file. You can write to a named pipe. Whatever you need to communicate with LabView.
Post Reply