LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB HID Sending 20 BYTE string

Hi All

 

Myself and our external electronics contractor have developed a custom switch matrix. The switch matrix has approx. 151 electromechanical relays.

 

There is a PIC on board and USB HID interface.

Our electronics contractor is currently on holiday for 3 weeks. He made a quick C code interface that allows the user to switch the relays.

 

To switch the relays a 8BIT hex value needs sending to the switch matrix, each of the first 19 BYTEs. Each Bit corresponds to the relay to turn on and off. The last bit of the 19th BYTE is not used because there is 151 relays (19 X 8 =152)

 

When plugging the PCB into the labtop via USB (only usb interface on the PCB) it is not seen by NIMAX. I have the VID and PID numbers for the USB HID interface.

USB_CONFIG_PID  0x0022

USB_CONFIG_VID  0x0461

 

I can use the NI VISA driver wizard to create an INF file for the USB HID interface. I can find the instrument and verify this by ensuring the VID and PID numbers are correct. I then save the INF file. and the NI VISA driver wizard automatically closes

 

when I go into NIMAX I can now see the PCB under devices and interfaces.

the following ID is returned.

 

USB0::0x0461::0x0022::NI-VISA-10002::RAW

 

I have the following questions;

 

in Labview using a VISA open command, the device above is not seen on the visa resource name.

I need to send 20 bytes of information to the device for example

 

BYTE 0 - 00

BYTE 1 - 00

BYTE 2 - 00

.....

BYTE 18 - 2C

BYTE 19 - 00

 

How can I do this.

 

On the C application this works, its very manual but it works. It also returns the information you have sent.

 

Any help would be gratefully appreciated.

 

 

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