NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Communicating with an HID Device on cRIO

I have an NI cRIO-9033 device, and an external device I am trying to communicate with over USB-HID. I am using the hidapi library linked below. I have built this library into a .SO file (see bottom link for procedure on building the .SO file), and calls to the library seem to execute without error, so I believe that part is working correctly. 

 

However, when I try to actually connect to my device, the hid_open command returns a 0 indicating that the device was not found. The hid_open command accepts a VID and PID as input parameters - I have these properly defined and have used them to communicate with the device on a windows machine.

 

I added a .rules file to the \etc\udev\rules.d directory, named 10-local.rules, as well as a duplicate one named 95-local.rules. (I have found different recommendations on what naming convention to use, so I tried both) The content of the rules file is below.

 

SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="C900", GROUP="plugdev", MODE="0666"

 

When I plug the device into the cRIO, and run 'lsusb' from an SSH terminal, I get the following output - note that bus 001 device 004 shows the proper VID/PID combo, so it does seem like the cRIO is recognizing the device.

 

Bus 001 Device 002: ID 0424:2240
Bus 002 Device 001: ID 1d6b:0003
Bus 001 Device 004: ID 0451:c900
Bus 001 Device 001: ID 1d6b:0002

 

So far, I had mostly been running in the development environment through the LabVIEW project, but have also tried building a simple test panel into a startup exe, deployed and run, and I get the same result - no device found. 

 

Anyone have any ideas? Direction to go, things to test? I'm a bit out of my element here working with Linux, so any help is greatly appreciated.

 

https://github.com/signal11/hidapi

 

 

https://forums.ni.com/t5/NI-Linux-Real-Time-Discussions/2019-C-C-Compile-Tools/td-p/4034719

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

Completely guessing here, but Linux is case-sensitive. Try using "c900" instead of "C900"

Charlie J.
National Instruments
0 Kudos
Message 2 of 2
(1,783 Views)