Bi-directional comms BS2 & VB6 anyone?
4 yrs later
Posts: 14
I resumed working on a project that I left off on 4 years ago - ANd I've searched the archives to see if anyone has come up with anything new on the topic, but w/o success. Perhaps I've missed something.
I have a 3 axis machine that I thought i could control w/ a PC, via a BS2 serial interface.
Using VB6's MSComm OnComm is fairly straightforward, but I'm having trouble with the PC seeing it's own serial output.
The board I made (years ago) supports the stamp and stepper drivers, but has it's com port set up exactly as a BS2 carrier board'srogramming connector.
I'm guessing that when the PC sends data into the Sin pin, an OnComm event is read through the 4.7K resistor and out via Sout pin. Since this winds up in the receive buffer, the VB code thinks it's an error, not seeing the handshake byte it expects.
Has anyone actually done a similar bi-directional comm project that worked out well, or am I just rusty on my VB?
I have a 3 axis machine that I thought i could control w/ a PC, via a BS2 serial interface.
Using VB6's MSComm OnComm is fairly straightforward, but I'm having trouble with the PC seeing it's own serial output.
The board I made (years ago) supports the stamp and stepper drivers, but has it's com port set up exactly as a BS2 carrier board'srogramming connector.
I'm guessing that when the PC sends data into the Sin pin, an OnComm event is read through the 4.7K resistor and out via Sout pin. Since this winds up in the receive buffer, the VB code thinks it's an error, not seeing the handshake byte it expects.
Has anyone actually done a similar bi-directional comm project that worked out well, or am I just rusty on my VB?
Comments
Data to Stamp - 150|Q| + CR
On reception, VB2 sees |Q| in the string and dumps it the string.
Note, StampPlot uses an ASCII 13 for a delimiter, so if it sees a string ending in |Q| it knows to ignore it and wait for the next string.
After 6(?) years of doing everything under the sun with StampPlot, it's never come up as an issue.
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies
Tell me, do you think it's possible to generate a plot of a shape to scale and then send the points to the stamp one by one - of course with a reply from the stamp after the machine has reached each point?
So, you could lay it out, use Excel graphing to see it visually, then have the BASIC Stamp read each consecutive cell as it performs that move. Just work your way down the column. Sound like a good fit?
As far as the echo issue, it uses directives at the start of each command sent to it (such as CELL,GET,A2), so when the value is echoed back, if it doesn't have a leading directive, it will not be used.
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies
Post Edited (Martin Hebel) : 2/25/2007 6:00:48 PM GMT
Sure does. I don't need a major GUI production, and the ability to calculate shapes with Excel is actually a pretty good idea. At some point, however, I'll want to be able to generate coordinates from a graphics file - ultimately an export of a 2D ACAD file or some such...
I started watching the port with my BitScope - and am surprised at what I'm seeing. While I can see data sent by either device (I am guessing this is due to pins 1 & 2 being tied together through the resistor on the BS2) on the same channel, at times i see nothing, other times I see multiple bursts. I'm not sure if I am dealing with an error in my VB, or if it's the way the API responds....
I will keep watching for the StampDAQ update - you will announce it's release, right?
Thanks once more,
-Chris
http://www.parallax.com/html_pages/downloads/software/software_plxdaq.asp
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies