Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Virtual USB

Hello -

 

I hope I describe this correctly so please forgive me in advance....

 

I want to create a 9 button front panel VI that will send a predescribed hex string/number to the computer to act as a command in a third party software package.

 

The key is that it needs to be sent through a USB port so the 3rd party software will react correctly. I believe the correct terminology would be a virtual keypad input device that would be interfaced through a virtual USB port. Does that make sense? The third party software needs me to tell it the Com port to look at for the commands to be coming from.

 

I would like to see it as a device on my Windows device and printers screen as a com port. I would also like to be able to watch that virtual port to see the string that was sent.

 

I did quite a bit of searching here but don't see anything as I am asking for it. I am wondering if my terminology is leading me astray in my searching.

 

I tried to add a port in MAX with no luck. It seems to add it but in the VI, it doesn't show up as an available port and my devises and printers screen doesn't show it either. I tried to add Com2 in the MAX screen shot attached and trying to see it in the Visa resource control in the other picture.

 

Thanks in advance for any help you may be able to give me.

 

Steve

Download All
0 Kudos
Message 1 of 11
(6,105 Views)
A keypad is not the same thing as a com port so that part of your description does not make much sense.

There are virtual com port programs available but I can't remember the names of any right now. Try Google. VISA cannot create one but should be able to use one. Unless of course, you have a couple of actual USB-Serial converters. You would just use one to write to the other.
Message 2 of 11
(6,089 Views)

Dennis - Thank you very much. I spent all day today heading that direction and made much progress.

 

Based on your help, I was able to open virtual ports and from two independent VI's I could communicate and control through it. I was also able to publish it and control the VI remotely which is a big part of what I am trying to accomplish also. Tons accomplished for me! THANKS!

 

After getting that far, I was not able to get the software to see the input. I investigated further with that software support group and it seems that what my other software is looking for is a game controller/joystick input device.

 

Is there a way for me to create a VI and have it show up as a game controller / joystick / keyboard device for windows from LabVIEW? It seems it needs to be recognized as such and show up in the devices and printers screen to be recognized and to be able to use it as input.

 

 

Thanks;

Steve P

0 Kudos
Message 3 of 11
(6,054 Views)
That's a whole new challenge. There are joystick functions for reading but I don't know of a way to write to one, real or virtual.

What is the other program supposed to do with the joystick input?
0 Kudos
Message 4 of 11
(6,042 Views)

Dennis – I am hoping that when a person of your experience levels suggests this could be a challenge, that will motivate a few to overcome it and tackle the challenge!

 

So for a little background, as a hobby, I develop input devices for the gaming community. These are up to 64+ inputs that are comprised of push switches, toggles, rotaries, slides and more. I package them, discrete wire them to a microprocessor, program them and offer them to the gaming community for flight simulators, racing rigs, etc. I call it a hobby because if I break even on cost I am lucky. I just enjoy it to help the guys that contact me. This is an external device obviously that interfaces through USB. Windows sees it as a gaming device. (Keyboard, joystick, etc.) (I attached a sample picture of one.)


The user assigns one of the inputs to a particular function within the setup screen on their software to controlk that function during their gaming simulation experience.


Over the past year or so, I have been using LabVIEW to create custom virtual dashboards to output telemetry information. These are performance parameters that the software outputs. This has been going well so I thought I would try another step.


My attempt here is to create a virtual interface front panel to do the same thing as my external micro-processer controlled hardware box does. That is why I wanted to try to pass the data through the USB port per the help you gave me above with the serial port emulator. I have all of that working per the attached pictures but the gaming software doesn’t see it as an input or react. Again, per the additional research, the software needs to see it as a gaming device in the devices and printers screen. This is how my external box shows up also.

 

Thanks for any help or direction you can give to get me there.

 

Steve P

Download All
0 Kudos
Message 5 of 11
(6,023 Views)

Hello SRPtip,

 

I am hoping you can clarify something for me about your application so that I can look for the appropriate resources. At this point, is the main issue that Windows is not recognizing the device at the virtual COM port? Also, are you using the VISA driver to communicate with the device?

 

Thank you,

0 Kudos
Message 6 of 11
(5,959 Views)

We only can help you i you show code. frontpanels are nice but the trick is in the coding.

Depending on your microprocessor protocol, is that pure serial (rs232) as I can seee on your frontpanel or not,

Or is your problem that your device is not seen as a serial port?

 

I had a problem ith a teensy (kind of arduino) in which I had to open the serial port on the microprocessor side, otherwise it would be recognized as a hid device instead of a serial port.

greetings from the Netherlands
0 Kudos
Message 7 of 11
(5,936 Views)

Siana / Albert –

Thanks for the response. I have included the code that is associated with the front panel VI’s that I originally sent a screen shot of.


I plugged in my current hardware button box and did a screen shot of the Windows device manager. It shows the virtual ports I created and also my external button box device. I opened the “Devices and Printers” screen and it shows my current hardware device on it (SimGarage but no instance of the virtual ports). I clicked on the device and have a shot of the properties for my current box. It shows it as a “Keyboard. Game Controller” category.
So again, the intent is to create a VI front panel that I can use in place of the hardware I am currently using.


I believe what I am asking for is to be able to create a VI that will be recognized as a Game Controller / Keyboard device and have it show up in my devices and printers screen as a device. My assumption is that this is the only approach to allow the simulator software to see it and recognize when I try to assign one of the VI Boolean buttons as a control for that function.


Thanks again and I appreciate any help / suggestions you may have.

 

(It seems I can only attach 3 files so I will have this and another to follow for the remainder of the attachments.)


Steve P

Download All
0 Kudos
Message 8 of 11
(5,930 Views)

Other attachments....

Download All
0 Kudos
Message 9 of 11
(5,928 Views)

So it is a hid device.

One way is to have a hid device dll in c# and use dll calls to interface.

This is not trivial

 

especially when closing LV it can generate errors.

I would like to give more detail but it is developed for a customer who doesn't allow me to publish his code.

greetings from the Netherlands
0 Kudos
Message 10 of 11
(5,919 Views)