PDA

View Full Version : Serout format



aftab
- 22nd August 2007, 04:25
This is in reference to the example:
http://www.rentron.com/four-channel-ad.htm

In this example of Analog-Digital conversion what is the format of RESULT[X]
that is sent to the computer serial port ? i.e. binary or ascii ?


SEROUT GPIO.5,N2400,[1,RESULT[0],2,RESULT[1],3,RESULT[2],4,RESULT[3]]



Unsure of the format, if I put # like:


SEROUT GPIO.5,N2400,[1,#RESULT[0],2,#RESULT[1],3,#RESULT[2],4,#RESULT[3]]


will the result to PC serial port be in ASCII format ?


I would like to get it in ASCII format.

Thanks

paul borgmeier
- 22nd August 2007, 06:29
I believe the examples on Bruce's website are sending data through the serial port to a VB written application that does the ASCII conversion, not to hyperterminal.

If you want to send to hyperterminal (examples)


X = 65
Serout GPIO.5,N2400,[65] 'sends "A" to hyperterminal
Serout GPIO.5,N2400,[#65] 'sends "6" and then "5" to hyperterminal
Serout GPIO.5,N2400,[X] 'sends "A" to hyperterminal
Serout GPIO.5,N2400,[#X] 'sends "6" and then "5" to hyperterminal

mackrackit
- 22nd August 2007, 06:56
From the manual for more clarification..


SEROUT supports three different data types which may be mixed and
matched freely within a single SEROUT statement.
1) A string constant is output as a literal string of characters.
2) A numeric value (either a variable or a constant) will send the
corresponding ASCII character. Most notably, 13 is carriage
return and 10 is line feed.
3) A numeric value preceded by a pound sign ( # ) will send the
ASCII representation of its decimal value. For example, if W0 =
123, then #W0 (or #123) will send “1", “2", ”3".

aftab
- 22nd August 2007, 07:12
Hi,

VB Commctl has this binary input which I have never used.
Will do experiment and post here.

Rentron's(Bruce) examples are great--I could not find other website with that quality of examples.

Thanks for the info.

Aftab.