Capture Data with Basic Stamp by RS232 and RS485 Comunications
Master
Posts: 12
· Hi !!!
· I have a problem with a device for to capture a data with my basic stamp· 2p by RS232 and RS485·Comunications.
· I have to send a ASCI command to device and the device send me data in table form.
· I need to capture the data from a Row and Column specify.
How can I do this?????
I need an example.
· I have a problem with a device for to capture a data with my basic stamp· 2p by RS232 and RS485·Comunications.
· I have to send a ASCI command to device and the device send me data in table form.
· I need to capture the data from a Row and Column specify.
How can I do this?????
I need an example.
Comments
Study SERIN.
Here is a program that I made to take the data that gets sent out from a GPS and then send it to an LCD (SERIN is related to the data collection, SEROUT is for the LCD activity):
[/code][/size]
Have you considered using that? After it is free. I think it is in with the Insturmentation products.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
My problem is painted in the document attachmented in·pdf formate.
I need help with this.
A gain i send the documents with the project that i need to do, because i thing that the other i sent with an error.
Thank you...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I need an example.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
my program is the follow:
' {$STAMP BS2p}
' {$PBASIC 2.5}
Msg VAR Byte
I VAR Nib(12)
Timeout1 CON 3750
Timeout CON 3600
Mando VAR Byte
P0 VAR Byte
P1 VAR Byte
P2 VAR Byte
P3 VAR Byte
P4 VAR Byte
P5 VAR Byte
P6 VAR Byte
P7 VAR Byte
P8 VAR Byte
P9 VAR Byte
P10 VAR Byte
M0 VAR Byte
M1 VAR Byte
M2 VAR Byte
M3 VAR Byte
M4 VAR Byte
M5 VAR Byte
M6 VAR Byte
Display PIN 0
Tx PIN 1
Rx PIN 2
SEROUT Tx,110,[noparse][[/noparse]"exit",CR]
MAIN:
GOSUB Clear
GOSUB Serial
GOSUB Clear
· SERIN Rx,110,Timeout1,MAIN,[noparse][[/noparse]SKIP 2,B0,B1,B2,B3,B4,B5,B6,B7,B8,B9,B10,B11]
· SEROUT Display,240,[noparse][[/noparse]B0,B1,B2,B3,B4,B5,B6,B7,B8,B9,B10,B11,CR]
· DEBUG B0,B1,B2,B3,B4,B5,B6,B7,B8,B9,B10,B11,CR
· PAUSE 1000
· GOSUB login
· GOSUB logged
· GOSUB Fase
· GOSUB Diagnostico
IF P5="k" THEN led
Normal:
DEBUG CR, "La demanda es Menor"
LOW 5
HIGH 6
PAUSE 100
GOTO main
Led:
P10="1"
IF P0>=P10 THEN LED1
GOTO Normal
LED1:
DEBUG CR, "la demanda es Mayor"
LOW 6
HIGH 5
PAUSE 100
GOTO Main
Clear:
SEROUT Display,240,[noparse][[/noparse]12,17]
DEBUG CLS
RETURN
Serial:
SEROUT Display,240,[noparse][[/noparse]12,"attn -D",CR]
SEROUT Tx,110,[noparse][[/noparse]"attn -D",CR]
DEBUG "attn -D",CR
PAUSE 1
RETURN
Login:
· SEROUT Display,240,[noparse][[/noparse]12,"attn -3Super3 -s",B0,B1,B2,B3,B4,B5,B6,B7,B8,B9,B10,B11,CR]
· SEROUT Tx,110,[noparse][[/noparse]"attn -3Super3 -s",B0,B1,B2,B3,B4,B5,B6,B7,B8,B9,B10,B11,CR]
· DEBUG "attn -3Super3 -s",B0,B1,B2,B3,B4,B5,B6,B7,B8,B9,B10,B11,CR
· PAUSE 1
· RETURN
Logged:
· SERIN Rx,110,Timeout,Login,[noparse][[/noparse]WAIT ("CIP"),B0 ]
· DEBUG B0
· SEROUT Display,240,[noparse][[/noparse]B0,CR]
· PAUSE 1000
· RETURN
Fase:
· SEROUT Tx,110,[noparse][[/noparse]"md -p",CR]
· SEROUT Display,240,[noparse][[/noparse]12,"md -p",CR]
· DEBUG "md -p",CR
· PAUSE 1
· RETURN
Diagnostico:
· SEROUT Display,240,[noparse][[/noparse]12]
· SERIN Rx,110,Timeout,Fase,[noparse][[/noparse]WAIT ("S"),SKIP 29, P0,P1,P2,P3,P4,P5,P6,P7, WAIT ("S"),SKIP 29, M0,M1,M2,M3,M4,M5,M6]
· SEROUT Display,240,[noparse][[/noparse]P0,P1,P2,P3,P4,P5,P6,P7,CR]
· SEROUT Display,240,[noparse][[/noparse]M0,M1,M2,M3,M4,M5,M6,CR]
· DEBUG P0,P1,P2,P3,P4,P5,P6,P7,CR
· DEBUG M0,M1,M2,M3,M4,M5,M6,CR
· PAUSE 1000
· SEROUT Tx,110,[noparse][[/noparse]"exit",CR]
· PAUSE 100
· RETURN
example:
I get
P0=5, P1=7, P2=3, P3=4 AND
M0=3, M1=2, M2=4, M3=1
THE ADD IS 8975.
I need to do the follow
W0=(5*1000)+(7*100)+(3*10)+(4*1)
W1=(3*1000)+(2*100)+(4*10)+(1*1)
W2=W0+W1=8975.
I cant do, because the number in the Ps and Ms are ASCII format, that is to say if P0=5 the number "5" isnt same to "5" in decimal.
how can I to make that my number in ASCII it will be same to number in decimal.?