Is it possible to do this project with BS ?
AndyChen
Posts: 5
Dear all,
I'm blank with basic stamp (BS).
I have a project to do have no any experience with this before.
I have a scale device (weight indicator) sends data (weight) in fixed string continously via rs232 with specifed baudrate, parity and databit.
I need a module to be a checkweigher (weight checker). If the weight is out of range, it'll turn on a light turn the light off if it's in the range.
Is it possilbe to do this project with BS? what should I have/do ?
Please help me to do this project..
Thanks..
I'm blank with basic stamp (BS).
I have a project to do have no any experience with this before.
I have a scale device (weight indicator) sends data (weight) in fixed string continously via rs232 with specifed baudrate, parity and databit.
I need a module to be a checkweigher (weight checker). If the weight is out of range, it'll turn on a light turn the light off if it's in the range.
Is it possilbe to do this project with BS? what should I have/do ?
Please help me to do this project..
Thanks..
Comments
This is very possible with a BS2. I have worked on many scale projects, up to a fully automated, legal-for-trade system for large trucks.
You will just set the stamp to watch the serial data string, extract the weight component of it and do your comparison.
Your program will be very small: really a short loop with a SERIN command. I usually use the WAIT modifier to watch for the beginning of the weight indicator string ( its ascii 002 on many indicators ), grab the characters with the STR modifier, then look at the weight.
Regards,
Provided your scale data is one of those two formats, then your project can be done.
So it's very possible to do with BS. But as you know, I'm blank with BS.
Does this module connect standalone to the scale·(I mean there is no computer connected to module or scale) ?
How does it work ? I mean I just buy BS2 module, do programming, and relay circuits to lights up LED. that's it?
How much money should I spent for one complete module ?
May I contact you privately (email) ?
Thanks again for your help. Please don't be bored to help me..
Hopefully I got reply as soon as..
Thank you..
Regards,
Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Best regards,
Andy
1. The Scale baud rate is 9600 baud or below
2. It's 8N1, or 7E1
3. Yes, the BS2, once programmed, is a 'stand-alone' device. It encorporates an on-module eeprom for program storage, an on-module PIC processor with register-RAM for processing. The PBasic language is uses is fairly simple, but has built in SERIN/SEROUT command for doing RS-232 I/O on any pin. It even has an on-module oscillator, so all you have to do to run the device is add 4 AA batteries, or a single 9-volt battery. Oh, and it has an on-module low-dropout voltage regulator too, so it's even pretty forgiving about voltages.
The program should be something like:
LEDPin CON 2
ScaleSerial CON 16 ' 16 if using the 'programming port'
ScaleBaud CON 16384 ' You want the constant for "9600, Inverted" if using the 'progamming port'. Check the SEROUT documentation
ScaleValue VAR WORD ' 16-bit word variable. BIT, BYTE, and NIB are also available
LimitValue CON 1000 ' Or whatever value you decide to put the limit at.
Main:
SERIN ScaleSerial, ScaleBaud, [noparse][[/noparse]DEC ScaleValue] ' As long as the Scale is outputting its data with some kind of delimiter, like CR or space or comma, DEC can handle it
' There's several modifiers for data for SERIN, like STR, WAIT, so you can handle almost any situation.
IF ScaleValue > LimitValue THEN
GOSUB LightLED
ELSE
GOSUB OutLED
END IF
GOTO MAIN
LightLED:
LOW LEDPin
RETURN
OutLED:
High LEDPin
RETURN
Probably this kit: http://www.parallax.com/detail.asp?product_id=27207· will have everything you need (except for that pesky wall-wart supply, make sure you add $7.00 to get it from Parallax).
Not bad for $150 or so.
I'm going to learn BS2. It sound so interesting. unfortunately, I'm not an electrical technician. I'm just a software programmer. I'll try my best to learn it. and hopefully you all may halp me when I need. Please don't be bored to help me..
Thank you..
oh, if BS2 is programmed, can we re-programme it again ? you know, just for trial..
Best regards,
Andy
Yes, any of the Stamp modules can be programmed and re-programmed many, many times. Just by way of example, let's say you finish this project to your present satisfaction and 6 months from now you want to add something to it. Still no problem. Just take your existing program code (WHICH YOU SAVED SAFELY SOMEWHERE!) and update it with the new routines, and re-program the Stamp with it. Simple as that, and one of the more compelling reason for using the PBASIC Stamp modules!
So long as you are willing to do your part in reading and learning from what the responders post in answer to your questions, I doubt that anyone will get bored with you, or anyone else. We generally only get "bored" when we make suggestions, or offer answers and the suggestions or answers aren't heeded.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
You know I was wondering there is no body to anwser my question.. But I'm supprised that are many of you responded my post and gave me good information and explanation.
Thank you.. [noparse]:)[/noparse]
Best regards,
Andy