Shop OBEX P1 Docs P2 Docs Learn Events
Newbie - Stamp2 - VB via Debug — Parallax Forums

Newbie - Stamp2 - VB via Debug

ArchiverArchiver Posts: 46,084
edited 2001-05-17 20:20 in General Discussion
Please forgive what I hope is a very silly question.

I have a BS2 connection through a serial port to COM 1.

Using Stamp2.exe, I have a program reading input from an LDR circuit every 2
seconds and outputing to DEBUG - works fine.

I have the Serial Port Complete code for the template application amended
with RThreshold = 1 to ensure that OnComm fires. Port is set to COM 1 and
Baud is 9600,8,n,1. However, OnComm never fires!

I can make OnComm fire if I set 'MSComm1.Output="BLAH"' and then open the
'Change Node Set Up' window and click OK, with the BLAH being echoed.

Obviously, I can't have Stamp2.exe and the VB App running at the same time,
how can I check that the program is running on the Stamp, or find out what
is going on? I'm not an EE and don't have LEDs and stuff available.

Any pointers gratefully received.

Duncan
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-05-16 10:53
    Hi there Duncan

    I dont know the solution to the fireing of the event, but there is a
    VERY usefull tool you can use to monitor the serial data that goes
    through any port.
    Go to http://www.win-tech.com/html/listen.htm and download the
    listen32 version. You can monitor the port when the Stamp is running
    and see that you are getting the right incoming data and make sure
    that it is correct.

    As for the VB side of things, I know you propably done everything I
    am going to mention, but here's just a recap of the mscomm
    functionality, just in case .... (out of the VB Help)

    >Event-driven communications is a very powerful method for handling
    >serial port interactions. In many situations you want to be notified
    >the moment an event takes place, such as when a character arrives or
    >a change occurs in the Carrier Detect (CD) or Request To Send (RTS)
    >lines. In such cases, use the MSComm control's OnComm event to trap
    >and handle these communications events. The OnComm event also
    >detects and handles communications errors. For a list of all
    >possible events and communications errors, see the CommEvent
    >property.

    >You can also poll for events and errors by checking the value of the
    >CommEvent property after each critical function of your program.
    >This may be preferable if your application is small and self-
    >contained. For example, if you are writing a simple phone dialer, it
    >may not make sense to generate an event after receiving every
    >character, because the only characters you plan to receive are the
    >OK response from the modem.

    Also make sure that you opened the port (mscomm1.portopen = true) and
    when your code ends, make sure you close the port again. Otherwise
    the port sometimes end up being "unavailable" and you have to restart
    the machine or reset the port (I think you can reset the port in
    win2000 but not in prev OS's)

    Hope this helped
    Cheers
    Okkie




    --- In basicstamps@y..., "Duncan Spence" <spence_duncan@h...> wrote:
    > Please forgive what I hope is a very silly question.
    >
    > I have a BS2 connection through a serial port to COM 1.
    >
    > Using Stamp2.exe, I have a program reading input from an LDR
    circuit every 2
    > seconds and outputing to DEBUG - works fine.
    >
    > I have the Serial Port Complete code for the template application
    amended
    > with RThreshold = 1 to ensure that OnComm fires. Port is set to
    COM 1 and
    > Baud is 9600,8,n,1. However, OnComm never fires!
    >
    > I can make OnComm fire if I set 'MSComm1.Output="BLAH"' and then
    open the
    > 'Change Node Set Up' window and click OK, with the BLAH being
    echoed.
    >
    > Obviously, I can't have Stamp2.exe and the VB App running at the
    same time,
    > how can I check that the program is running on the Stamp, or find
    out what
    > is going on? I'm not an EE and don't have LEDs and stuff available.
    >
    > Any pointers gratefully received.
    >
    > Duncan
    >
    ______________________________________________________________________
    ___
    > Get Your Private, Free E-mail from MSN Hotmail at
    http://www.hotmail.com.
  • ArchiverArchiver Posts: 46,084
    edited 2001-05-17 05:17
    Make sure you have the mscomm1.inputlen set to 0
    Chris

    Original Message
    From: Duncan Spence <spence_duncan@h...>
    To: <basicstamps@yahoogroups.com>
    Sent: Wednesday, May 16, 2001 5:04 PM
    Subject: [noparse][[/noparse]basicstamps] Newbie - Stamp2 - VB via Debug


    > Please forgive what I hope is a very silly question.
    >
    > I have a BS2 connection through a serial port to COM 1.
    >
    > Using Stamp2.exe, I have a program reading input from an LDR circuit every
    2
    > seconds and outputing to DEBUG - works fine.
    >
    > I have the Serial Port Complete code for the template application amended
    > with RThreshold = 1 to ensure that OnComm fires. Port is set to COM 1 and
    > Baud is 9600,8,n,1. However, OnComm never fires!
    >
    > I can make OnComm fire if I set 'MSComm1.Output="BLAH"' and then open the
    > 'Change Node Set Up' window and click OK, with the BLAH being echoed.
    >
    > Obviously, I can't have Stamp2.exe and the VB App running at the same
    time,
    > how can I check that the program is running on the Stamp, or find out what
    > is going on? I'm not an EE and don't have LEDs and stuff available.
    >
    > Any pointers gratefully received.
    >
    > Duncan
    > _________________________________________________________________________
    > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
    >
    >
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-05-17 09:15
    Thanks,

    I'll give it a try.

    Duncan
    --- In basicstamps@y..., okkie@i... wrote:
    > Hi there Duncan
    >
    > I dont know the solution to the fireing of the event, but there is
    a
    > VERY usefull tool you can use to monitor the serial data that goes
    > through any port.
    > Go to http://www.win-tech.com/html/listen.htm and download the
    > listen32 version. You can monitor the port when the Stamp is
    running
    > and see that you are getting the right incoming data and make sure
    > that it is correct.
    >
    > As for the VB side of things, I know you propably done everything I
    > am going to mention, but here's just a recap of the mscomm
    > functionality, just in case .... (out of the VB Help)
    >
    > >Event-driven communications is a very powerful method for handling
    > >serial port interactions. In many situations you want to be
    notified
    > >the moment an event takes place, such as when a character arrives
    or
    > >a change occurs in the Carrier Detect (CD) or Request To Send
    (RTS)
    > >lines. In such cases, use the MSComm control's OnComm event to
    trap
    > >and handle these communications events. The OnComm event also
    > >detects and handles communications errors. For a list of all
    > >possible events and communications errors, see the CommEvent
    > >property.
    >
    > >You can also poll for events and errors by checking the value of
    the
    > >CommEvent property after each critical function of your program.
    > >This may be preferable if your application is small and self-
    > >contained. For example, if you are writing a simple phone dialer,
    it
    > >may not make sense to generate an event after receiving every
    > >character, because the only characters you plan to receive are the
    > >OK response from the modem.
    >
    > Also make sure that you opened the port (mscomm1.portopen = true)
    and
    > when your code ends, make sure you close the port again. Otherwise
    > the port sometimes end up being "unavailable" and you have to
    restart
    > the machine or reset the port (I think you can reset the port in
    > win2000 but not in prev OS's)
    >
    > Hope this helped
    > Cheers
    > Okkie
    >
    >
    >
    >
    > --- In basicstamps@y..., "Duncan Spence" <spence_duncan@h...> wrote:
    > > Please forgive what I hope is a very silly question.
    > >
    > > I have a BS2 connection through a serial port to COM 1.
    > >
    > > Using Stamp2.exe, I have a program reading input from an LDR
    > circuit every 2
    > > seconds and outputing to DEBUG - works fine.
    > >
    > > I have the Serial Port Complete code for the template
    application
    > amended
    > > with RThreshold = 1 to ensure that OnComm fires. Port is set to
    > COM 1 and
    > > Baud is 9600,8,n,1. However, OnComm never fires!
    > >
    > > I can make OnComm fire if I set 'MSComm1.Output="BLAH"' and then
    > open the
    > > 'Change Node Set Up' window and click OK, with the BLAH being
    > echoed.
    > >
    > > Obviously, I can't have Stamp2.exe and the VB App running at the
    > same time,
    > > how can I check that the program is running on the Stamp, or find
    > out what
    > > is going on? I'm not an EE and don't have LEDs and stuff
    available.
    > >
    > > Any pointers gratefully received.
    > >
    > > Duncan
    > >
    >
    ______________________________________________________________________
    > ___
    > > Get Your Private, Free E-mail from MSN Hotmail at
    > http://www.hotmail.com.
  • ArchiverArchiver Posts: 46,084
    edited 2001-05-17 09:18
    Thanks,

    I think that it may be already, but I'll check anyway.

    Duncan
    --- In basicstamps@y..., "Chris Anderson" <fes@g...> wrote:
    > Make sure you have the mscomm1.inputlen set to 0
    > Chris
    >
    >
    Original Message
    > From: Duncan Spence <spence_duncan@h...>
    > To: <basicstamps@y...>
    > Sent: Wednesday, May 16, 2001 5:04 PM
    > Subject: [noparse][[/noparse]basicstamps] Newbie - Stamp2 - VB via Debug
    >
    >
    > > Please forgive what I hope is a very silly question.
    > >
    > > I have a BS2 connection through a serial port to COM 1.
    > >
    > > Using Stamp2.exe, I have a program reading input from an LDR
    circuit every
    > 2
    > > seconds and outputing to DEBUG - works fine.
    > >
    > > I have the Serial Port Complete code for the template
    application amended
    > > with RThreshold = 1 to ensure that OnComm fires. Port is set to
    COM 1 and
    > > Baud is 9600,8,n,1. However, OnComm never fires!
    > >
    > > I can make OnComm fire if I set 'MSComm1.Output="BLAH"' and then
    open the
    > > 'Change Node Set Up' window and click OK, with the BLAH being
    echoed.
    > >
    > > Obviously, I can't have Stamp2.exe and the VB App running at the
    same
    > time,
    > > how can I check that the program is running on the Stamp, or find
    out what
    > > is going on? I'm not an EE and don't have LEDs and stuff
    available.
    > >
    > > Any pointers gratefully received.
    > >
    > > Duncan
    > >
    ______________________________________________________________________
    ___
    > > Get Your Private, Free E-mail from MSN Hotmail at
    http://www.hotmail.com.
    > >
    > >
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    > >
    > >
  • ArchiverArchiver Posts: 46,084
    edited 2001-05-17 20:20
    Checked this and it is already set to 0.

    Any other ideas? A silly question, if I load a program through
    stamp2.exe and then shut that application down, the loaded program
    does stay running, doesn't it? What about after a power down?

    Thanks,
    Duncan
    --- In basicstamps@y..., "Chris Anderson" <fes@g...> wrote:
    > Make sure you have the mscomm1.inputlen set to 0
    > Chris
    >
    >
    Original Message
    > From: Duncan Spence <spence_duncan@h...>
    > To: <basicstamps@y...>
    > Sent: Wednesday, May 16, 2001 5:04 PM
    > Subject: [noparse][[/noparse]basicstamps] Newbie - Stamp2 - VB via Debug
    >
    >
    > > Please forgive what I hope is a very silly question.
    > >
    > > I have a BS2 connection through a serial port to COM 1.
    > >
    > > Using Stamp2.exe, I have a program reading input from an LDR
    circuit every
    > 2
    > > seconds and outputing to DEBUG - works fine.
    > >
    > > I have the Serial Port Complete code for the template
    application amended
    > > with RThreshold = 1 to ensure that OnComm fires. Port is set to
    COM 1 and
    > > Baud is 9600,8,n,1. However, OnComm never fires!
    > >
    > > I can make OnComm fire if I set 'MSComm1.Output="BLAH"' and then
    open the
    > > 'Change Node Set Up' window and click OK, with the BLAH being
    echoed.
    > >
    > > Obviously, I can't have Stamp2.exe and the VB App running at the
    same
    > time,
    > > how can I check that the program is running on the Stamp, or find
    out what
    > > is going on? I'm not an EE and don't have LEDs and stuff
    available.
    > >
    > > Any pointers gratefully received.
    > >
    > > Duncan
    > >
    ______________________________________________________________________
    ___
    > > Get Your Private, Free E-mail from MSN Hotmail at
    http://www.hotmail.com.
    > >
    > >
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    > >
    > >
Sign In or Register to comment.