SERIN trouble newbie VB visual basic
Archiver
Posts: 46,084
i want to send a number or a string to the stamp from VB. i can
recieve data rather well, but the stamp doesnt seem to get what VB is
sending. i used the code from <http://www.picobay.com/VB.html> I
dont know what code is not working i would suspect somethings wrong
with the stamp code ?
VB code:
Private Sub cmd_send_Click()
If MSComm1.PortOpen Then
MSComm1.PortOpen = False
End If
MSComm1.PortOpen = True
Dim SerData As Integer
SerData = 21
MSComm1.Output = Str(SerData) & "!"
MSComm1.PortOpen = False
End Sub
Stamp code:
'{$STAMP BS2}
low 3
low 4
low 5
low 6
here:
TheData var Byte
SERIN 16,16468,[noparse][[/noparse]DEC TheData] 'read data into TheData
if TheData = 21 THEN turnon
goto here
turnon:
high 3
high 4
high 5
high 6
goto here
i also tried the wait statement from the manual:
TheData var Byte
SERIN 16,16468,[noparse][[/noparse]WAIT("21")] 'read data into TheData
if TheData = 21 THEN turnon
recieve data rather well, but the stamp doesnt seem to get what VB is
sending. i used the code from <http://www.picobay.com/VB.html> I
dont know what code is not working i would suspect somethings wrong
with the stamp code ?
VB code:
Private Sub cmd_send_Click()
If MSComm1.PortOpen Then
MSComm1.PortOpen = False
End If
MSComm1.PortOpen = True
Dim SerData As Integer
SerData = 21
MSComm1.Output = Str(SerData) & "!"
MSComm1.PortOpen = False
End Sub
Stamp code:
'{$STAMP BS2}
low 3
low 4
low 5
low 6
here:
TheData var Byte
SERIN 16,16468,[noparse][[/noparse]DEC TheData] 'read data into TheData
if TheData = 21 THEN turnon
goto here
turnon:
high 3
high 4
high 5
high 6
goto here
i also tried the wait statement from the manual:
TheData var Byte
SERIN 16,16468,[noparse][[/noparse]WAIT("21")] 'read data into TheData
if TheData = 21 THEN turnon
Comments
<A
HREF="http://www.parallax.com/Downloads/Documentation/nv/v3/col/NV89-Data_Exchan\
ge_with_Visual_BASIC.pdf">
http://www.parallax.com/Downloads/Documentation/nv/v3/col/NV89-Data_Exchange_wi
th_Visual_BASIC.pdf</A>
-- Jon Williams
-- Parallax
In a message dated 2/24/2003 8:00:17 PM Central Standard Time,
danieljcyr@a... writes:
> i want to send a number or a string to the stamp from VB. i can
> recieve data rather well, but the stamp doesnt seem to get what VB is
> sending. i used the code from <http://www.picobay.com/VB.html> I
> dont know what code is not working i would suspect somethings wrong
> with the stamp code ?
[noparse][[/noparse]Non-text portions of this message have been removed]