06-13-2016 12:34 PM - edited 06-13-2016 12:47 PM
Hello,
I am using cDAQ-9188 chassis with a NI 9862 CAN module.
I am trying to use a set of VIs that are interfacing with this CAN hardware into a managed Interop DLL (built by LabView) to export the functionality to managed applications (there is no managed libraries for NI-XNET yet, as far as I know).
I could create the DLL easily following Labview instructions. It's a bit more difficult to use it.
The very first issue comes with access to the CAN interface.
In LabView, the can interface looks on the LV UI like a combo box, and allows to select with CAN board we are using (CAN1, CAN2, etc...).
In the managed interop DLL, I create a function
void CANOpen(LVBaseRefnum interface, bool, out LVBaseRefnumsessionRead, out LVBaseRefnum sessionWrite);
So, I need to create a Renum that designates the CAN interface I plan to use. HOW DO I DO THAT? a Refnum is basically just a 32-bits cookie, how can I get to the actual interface?
Appreciate your help, NI!!
Sam Dahan
06-14-2016 07:07 PM
Hi Sam,
Which VI are you trying to wrap with CANOpen? I would have to check to see what that VI is expecting to get an idea of which reference it's looking for. Off the top of my head, you might be able to pull that reference using the System Configuration API.
- GiantDeathRobot
06-15-2016 11:57 AM
I wrote a VI called CANOpen, and that DLL function is basically the wrapper for it.
I was looking for a programmatic way to select the correct CAN interface in the XNET Interface control.
I think I got one - not sure if it's the right approach but it seems to work for me so I went with it. I created a property node linked to the XNET interface object and selected the "Value" property. Then I assign a string control vaklue to the property node. It seems to work.
Thanks for your interest!
Sam