LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 port

Hi
 
How to detect a device which is connected to RS232 port of our system.Is thereany in build vi in labview.
0 Kudos
Message 1 of 3
(3,018 Views)

There is no build in autodetection in rs232, so there are no ready build vis to detect a device connected to a rs232.

Depending on your device(s) (more information is always helpfull ) you can write your own routine. But this is specific to your task.

 

It's like a floor with a door for each RS232 port. You can find out how many doors you have (VISA find resource)

Now you have to look into every room to see who is in. (open port).But hey, sometimes a door is locked by another applicationSmiley Wink

If you have opened the door(port) the room behind is dark and you need to talk in the right language (protocol, baudrate, ...)  to find out if someone (something like the device) is in.

Some devices can be 'feeled' (Hardware detection, mostly used/supported by modems), however you still need to know the right language.

The number of possible languages is restricted, so you might be able to test each of them, but some devices ignore everything but one magic word you will hopefully find in the manual.

You see, a lot of BUT, HOWEVER.... RS232 is VERY old, thats why nearly everything has a RS232 port, but is far away from plug and pray just because it wasn't designed for it.        

If you only have one device with known settings:: 

1. VISA find resource, and get all available rs232 ports

2. Scan the ports with a device specific command that give you the information you need (a lot of devices support *IDN?\r\n, however RTFM of the device)

 

At least: NI has done so many things, so I'm not sure that MAX or some llbs can (not)  do it.

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 2 of 3
(3,009 Views)

yes polling is the only method of detection for most RS232.  If you are looking for a specific device that supports two woy communications and the *idn? is not supported, querry the device with a known command and validate its response.  An invalid response or a timeout will eliminate this problem.  RS232 is older than quite a few labview programmers and it will still be many years before it is completely eliminated (all though visa will make the transition to newer bus technology such as USB much easier).

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 3 of 3
(2,993 Views)