02-18-2010 04:55 PM
I am using a simple read/write vi to send and receive messages over RS232 (VI along with its screenshot is attached). The target is a linux based system. Most of the time, the messages which are sent to the target are received correctly (based on the response from the target). However, sometimes the target responds that the format in which the message was sent is not correct. The messages which are sent can be very long and have to be sent in a certain format (an extra . or / or a space can cause an error). i have used port mon to sniff the messages which are being sent and i cannot tell the difference between the correct one or the instance where it fails.
i do not see this problem while using the hyperterminal. i have tried to match the 'configuration' settings for the vi serial to the hyper terminal also.
Can you see any problem with my vi? Can i make it more robust? i am trying to narrow this down to it being an issue with the target, vi or a limitation from serial.
P.S. the xxx in the vi you noticed are there to avoid mentioning any product specific terms.
Also attached are the following logs:
SerialLV.txt: Portmon log from LabVIEW
02-18-2010 04:56 PM
02-18-2010 05:30 PM
02-19-2010 09:29 AM - edited 02-19-2010 09:30 AM
02-19-2010 09:37 AM
What is the length of the wire run?
Ben
02-19-2010 09:53 AM
02-19-2010 10:01 AM
The number I carry around in my head for RS-232 (probably a spec somewhere) is 2500 pF cable capacitance which is ultimately what gets you. For a normal cable that is at least a hundred feet. If you are willing to deal with slower communication you can use hundreds of feet.
Most problems I have encountered with cables have been at the ends, and even those are rare.
02-19-2010 10:06 AM
yeah i found this online:
These are the standards for length.
DTE stands for Data Terminal Equipment, any sending or receiving device
attached to the end of the cable.
Serial Cable Length Limits (RS-232, V.35, RS-530, RS-422/449)
Table below lists the maximum permissible cable lengths for various
protocols at various representative data rates. These lengths are as
specified in the EIA RS232C, CCITT V.55 and RS422 interface standards.
Material requirements:
* Conductor size and type: 24 AWG, twisted pair.
* Nominal capacitance: 15.5 picofarads per foot (between conductors of
each pair);
27.5 picofarads per foot (from each conductor to shield).
* Nominal DC resistance (each conductor): 24.0 ohms per 1000 feet.
* Nominal DC resistance (shield): 2.35 ohms per 1000 feet.
* Shield type: Overall braided with drain wire.
* Approval: Underwriters Laboratories (UL).
DTE Data Rate [kb/s]---Maximum DTE Cable Lengths [ft]
-----------------------RS232C---V.35----RS449/422---RS530/42 2
56 or 64-----------10----------4000---------4000-----------4000
224 or 256-------N/A---------3500---------1700-----------1700
896 or 1024-----N/A---------1700-----------350-------------350
N/A - not applicable (these rates cannot be used for RS232C interface)
NOTE on RS-232 Serial Cables
At lower peripheral speeds of up to 9600 baud, serial interfaces can
usually operate over cables up to 50 feet long. Use of special high
quality cable may in some cases allow this limit to be extended to as
much as 150 feet.
02-19-2010 10:13 AM - edited 02-19-2010 10:14 AM
02-19-2010 10:20 AM
If dropping your baud rate reduces the occurence of errors you may be onto something.
Another thought from years ago (17 maybe)...
Serial ports on Unix systems resrved some characters for waking up the OS and starting a login, so... are there any odd characters being passed?
Ben