NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
HIBEN
Posts: 9
0 Kudos

random character serial

Hello everybody,
 
I receive data from a RF receiver connected to the RS232. This receiver normally receive a precise message every 30sec. I carried out the same experiment using the hyperterminal application on windows and it worked fine.
 
However, when using a modified version of the basic serial write and read VI of labview (see attached), the readings on the read string box are corrupted by random characters I can't get rid of!
 
I'll be grateful for any help.
Thanks

Trusted Enthusiast
Albert.Geven
Posts: 3,142
0 Kudos

Re: random character serial

Hi
I did not have time to look at your diagram but saw that you use the continuous run button.
You probably open and close your serial port for every read/write.
do  not do this.

You should open the port before you enter a while loop in which you do the reading/writing and after stopping the loop also close the serial port.

You probably mix up the characters after/during the open.
greetings from the Netherlands
Knight of NI
Dennis_Knutson
Posts: 29,306
0 Kudos

Re: random character serial

Do what Albert say and instead of posting an image that nothing can be done with, do what I recomended here. Saving the front panel as a jpg and posting a second file was just a waste.
Member
HIBEN
Posts: 9
0 Kudos

Re: random character serial

Sorry about that.

There you go

Knight of NI
Dennis_Knutson
Posts: 29,306
0 Kudos

Re: random character serial

Now try running it with a loop around the read and not doing the VISA Configure Serial Port and VISA Close all of the time. You might also want to check on the format of the data being sent by the instrument. Some do not send ASCII characters as data.
Member
HIBEN
Posts: 9
0 Kudos

Re: random character serial

I tried with a loop around the read but i still receive unwanted characters. 
Knight of NI
Dennis_Knutson
Posts: 29,306
0 Kudos

Re: random character serial

Double check the com port settings (i.e. baud rate, parity, etc.) and make sure it matches exaclty what you have set in Hyperterminal. Also, do like I mentioned and check the manual for the instrument and verify the format that the data is sent as. Do you have Hyperterminal set for any type of terminal emulation? What is the make and model of instrument? Do you have a programming manual you can attach or provide a link to?
Member
HIBEN
Posts: 9
0 Kudos

Re: random character serial

baud rate (4800), parity (none), data bits (8), stop bits (1), flow control (none) are the same as in Hyperterminal.

 

The terminal emulation set on my Hyperterminal is VT100.

 

The instrument I use is a Bim2-433-160 Tx/Rx from Radiometrix (datasheet attached) and it is connected to a max232 to make the rs232 connection possible. The data is sent as ascii.

 

Thank you

Knight of NI
Dennis_Knutson
Posts: 29,306
0 Kudos

Re: random character serial

Well, I don't see anything in that data sheet that talks about serial communication at all so I'm not sure where the expected baud rate and protocol is gotten from. Set the terminal emulation in Hyperterminal to ANSI. See if you get same thing.
Member
HIBEN
Posts: 9
0 Kudos

Re: random character serial

And how can I do change to the hyperterminal to ANSI emulation ? 
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page