LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending ASCII commands through USB hub

Vista does not have HyperTerm?  I wonder if MS goofed that one with windoze 7...  Yikes!!  That's a basic application for any OS.

 

As Dennis mentionned, you should use a Terminal Emulator application to debug the com port setting and cable.  Also to "try out" the commands.  I would do that before using MAX, although MAX should give you the same thing once you know the cable and settings are okay.

 

What is connected at the other end of the serial cable?

0 Kudos
Message 11 of 20
(2,253 Views)

The computer is connected by USB to a "hub" that consists of 4 rs232 ports labeled 1-4. The rs232 go to 3 separate hardwares.

When I open HyperTerminal and select COM 5. I use the command *idn? it returns ORLABS SC10 Version 1.0. I have also been able to send commands to it. Great! I want to write functions to press a button instead of a string of commands. The thought was to have an event structure when a button is pressed it outputs the command to the com port. Will this work?

CLD Certified 2014
0 Kudos
Message 12 of 20
(2,238 Views)

It should work.

 

You will have to set the com port to the same ones as you are using in HyperTerm.  I think there is a way to redefine the COM port numbering.  It is in the properties of the device driver...  I think... I'll have to loo it up.  Did this a couple of years ago.  

0 Kudos
Message 13 of 20
(2,235 Views)
Can you provide a screen capture (.jpg or .png) of MAX|Devices and Interfaces|Serial & Parallel to show what it sees with your serial adapter plugged in? It should show the four comm ports that this adapter represents. Then you can open VISA sessions to them to write to them. I would get a little more involved, building an "Action Engine" to contain the "visa open" for each, rather than doing an open, read/write, close, each time. But if you can read/write to the comm port from Hyperterminal (which MSoft, in their ultimate wisdom, removed from Vista, grrrr!) then you should be able to from LabVIEW. You won't be able to have both, LabVIEW and Hyperterminal, open the same comm port simultaneously.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 14 of 20
(2,234 Views)
When I removed the usb hub and plugged it into another usb input on my computer the com ports changed form 5,6,7 to 13,14,15 then again to 17,18,19. Why? How do I prevent this?
Message Edited by ADrexelDragon on 04-19-2010 12:49 PM
CLD Certified 2014
0 Kudos
Message 15 of 20
(2,231 Views)

Basically, don't plug it in to another usb port. I'm not trying to be funny, but unless the port has some serialization in it's USB chip set Windows will assign it a different com number when it is plugged into a different usb. I ran into this last fall with a different brand USB - Serial adapter, Windows was even giving it new port numbers when the usb bus "glitched". I ended up replacing my USB - RS485 adapters with National Instruments ones, which get recorded in the registry with a specific port assignment allocated to their specific serial number.

 

I have a current thread that is about a related issue, where the devices we are testing have a built in usb to serial adapter, and what we see with them, because they have serial numbers for identification purposes, is that as a new unit is plugged into be tested Windows issues it a unique port number. Unfortunately there are only 255 allowable port numbers, and we shall pretty quickly hit that number as we manufacture new units. Not sure what happens then.

Message Edited by LV_Pro on 04-19-2010 04:17 PM
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 16 of 20
(2,200 Views)

ADrexelDragon wrote:
com ports changed form 5,6,7 to 13,14,15 then again to 17,18,19. Why? How do I prevent this?

- sigh -   Happens to all of us.

 

I'm happy to stay away from windoze...  But that's not always the case...

 

The USB-> Serial Adapter is nor connected to this PC, so I'm kinda picking my brains..

Let's see...

 

(XP) Control Panel > System > Hardware > Device Manager > USB Controllers OR Ports...

Look for the driver for the hub you are using.   Right-click and select properties.

You should be able to find a Tab that lets you select the COM port number that matches the physical port number on the hub.

At least that what I recall on the unit I have..

 

Message 17 of 20
(2,197 Views)
So you two are saying that I should just keep my Comports as controls instead of constants so I can change them easily? There is no way to maybe "initialize" or "configure" the ports and assign them accordingly?
CLD Certified 2014
0 Kudos
Message 18 of 20
(2,183 Views)
I the other "Com" thread where we chatted I had a link to my episode last fall. There were some suggestions on handling Windows assigning new com numbers, but as they weren't addressing the real issue (the USB motherboard bus glitches that caused the reassignment) I didn't explore them, resolving the problem by replacing my apparently good USB-RS485 adapters without serial numbers with National Instruments one. The final resolution to the whole problem was to install a PCIe USB adapter card for my Data Acquistion stuff to plug into, the motherboard's native usb being unreliable, but that isn't the issue you are having here. You may want to check if there is anything helpful there. Alternatively is a VISA pulldown control to allow the selection at runtime. Not optimal but ... We have that in a current test program. If it is unable to communicate with the unit it pops up a screen with the VISA control and instructs the user to select the correct one. I does require the user to have an idea which one, and in your case with more than one it could be confusing.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 19 of 20
(2,167 Views)

What I was saying is that I was successful at renumbering (bad word, I know) COM 6, 7, 8 & 9 to COM 3, 4, 5 & 6.  I had to do the renaming of the ports for each of the port, where the trick was to rename port 6 to some higher available number first.  I also made sure there wer no other ports using the name COM3.  And when the driver complained about using the new name, I ignored the warning.  It worked. 

 

I have a student using it at the moment and I should be getting the unit back at the end of the month.  I'm sure I will have tochange the names / number again. 

 

I'll fix the above steps if I missed something along the way.

0 Kudos
Message 20 of 20
(2,149 Views)