how to store data from BS2 to a file on PC
hi friends,
i am trying to use my BS2 as a data logger.
how can i transfer the stored data to my PC?
what PBasic command do i need to use?
please don't tell me that there is no such a thing!
regards
Farsad
i am trying to use my BS2 as a data logger.
how can i transfer the stored data to my PC?
what PBasic command do i need to use?
please don't tell me that there is no such a thing!
regards
Farsad
Comments
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
It's ·SEROUT.
thanks a lot for your comments. i decided to go with what Newzed said and use read + debug command and copy-paste the data to a file. it seems a little unprofessional but it works.
thanks again,
Farsad
I wish Parallax would simply give us a Debug option to write everything that appears in the Debug window to a comma delimited, ASCII file. It is a simple solution and one that many of us would use. Of course, there are other solutions that would also be useful where the one I suggested would not. Parallax's latest flash-thingy-to-a-PC is a good example.
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
A forum user 'CRUX' asked the same question recently and he used an application I wrote - it has worked out well for him - Also 'Jtsmith' has used an application I posted for a similar project.
Have a look at this thread-
http://forums.parallax.com/showthread.php?p=640960
The latest .NET version is here - writes to a HTML file -
http://forums.parallax.com/attachment.php?attachmentid=46405
or a simpler VB6 version is here - wrtes to a text file -to set it up.
http://forums.parallax.com/attachment.php?attachmentid=46237
If you have any problems just send me a PM - or ask other users of the application how to set it up and use it..
Regards,
John Twomey
LATEST UPDATE:
12 August 2007 added the following with new features !
http://forums.parallax.com/attachment.php?attachmentid=0
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
Post Edited (QuattroRS4) : 8/12/2007 3:47:20 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
I also gave an example in the aforementioned thread - showing an example of using 'debug' writing to a text file ....I agree with Franklin on the point made above ....
Regards,
John Twomey
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
It is dirt simple. I have done it (almost!) COUNTLESS times. Let Parallax figure out the format. From simple to complex it is very easy. They could even write to the SAME file every time and depend on the user to make sure the contents of the existing file are saved or renamed or deleted or whatever.
If I were doing it, I would quote everything that was quoted and put a comma or cr/lf (depending on the situation)·between things that weren't. If they wanted to spend a little time parsing the syntax of the Debug statement, they could make the PC file look exactly like the Debug screen.
I suppose they just never thought of it . . . it is just TOO easy. It would not eliminate any products, it would just provide a VERY convenient option and enhancement to the IDE/Debug environment.
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Regards,
·········· John Twomey
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
I'm not sure I see what you seem to feel is a problem or deficit. If you want to "direct" data output somewhere other than where DEBUG places it (which would seem to be the case) why not just use SEROUT? SEROUT permits the same sort of formatting as DEBUG. The capture program can be as simple as StampDAQ or StampPlot, both of which are available on the Parallax web site.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The discussion in the aforementioned threads covers that - the idea of this app is to log it to a file -- in this case a HTML file ... which if used in conjunction with a webservice can have the app update a live webpage on the fly.. The mention of debug to output the data just shows this an option with a 'debug -1' .... Obviously Serout works also ...and of course Serout is preferable .. it was merely shown in the thread of a couple of months ago as an option - so too was serout ..
Regards,
John Twomey
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
Well, of course you are right. My point is only that it would be easy for Parallax to make Debug do this thing. I am certainly more than happy with their IDE and Debug, but it would be NICE if it also allowed one to log to a PC drive using the programming cable via Debug.
As you implied, no big deal. [noparse]:)[/noparse]
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
---
Debug should be used for what it's named for... debugging.· The IDE stands for Integrated "development" Environment.· Both·of these things say to me:· Prototyping Tools.
When you start talking about creating a "logger", you are in the realm of "finished product" not development.· This means that you should be integrating· a serial logger that is customized for your product... close to what ·"quattro" is developing.· Communication with the PC should be done using the SEROUT/SERIN commands.· That is why they are there and why they are set up to use regular I/O pins and NOT the debug interface.
If Parallax implements logging into the Debug interface it will really start to dilute it's purpose.
---
Ok, done...
Of course, if you look at this differently again...· It would be real nice addition to the DEBUG screen if it could emulate a "line printer", IE:· like a calculator that uses paper output...· This way you can select debug modes, "screen mode" or ·"paper mode" and the paper mode will save what is received in a visual sequential buffer that can also·be saved to a file but not allow any cursor positioning statements...· just a raw dump of what is received and sent.
PW
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There's nothing like a new idea and a warm soldering iron.
On the other hand, if this "feature" WERE to be implemented along the lines I have suggested, then instead of newbies like me constantly asking how to perform the feat, they would probably complain about it and wonder why when they used it everything was so slow.
I have been involved in the software business--all phases, I think--for a very long time. Parallax has the best support I have ever seen, including my company's. (Of course, back when we were providing primary support, the technology that Parallax uses did not exist yada, yada, yada. Basically, they are better. A LOT better.) I imagine their support is market-driven and part of it is this forum. It is probably a complicated equation. (Yeah, sure it is. Chris and some guys are in the back room sucking down some long necks and coming up with ideas. The idea that gets remembered the next morning stands the best chance of being implemented . . . as I say, the equation is complicated.)
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
I like your idea the best. Now, get invited to that back room I mentioned.
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
·
·· I assure you this option has been explored before but there are a few issues surrounding it which differ based on the approach used.· For example the data on the screen could be viewed as text that you simply copy and paste and many people use this option.
·
·· However that is not the only way the data could be used and others have asked for the raw data including cursors movements, screen clears and other control characters that may not be printable but affect the output.· There are some other things I need not go into but suffice it to say the format in which the data could be saved can vary greatly and so do the wants/needs of customers.
·
·· The recommended course of action is to have a small application written on the PC which can log the data in the format the customer needs.· Such applications can even be written in QuickBASIC, although not as practical, but you would have serial access on the PC at up to 9600 bps.· The only issues I ever had doing this were the only supported COM Ports are 1 through 4 and the speed limitation of 9600 bps.· Other than that it is useable.· Then of course there’s VB, C++, etc.
·
·· I know not everyone has access to these tools or knows how to use them, but I believe Express Editions of Visual BASIC are available free from Microsoft and there are tons of tutorials out there on how to do things.· I hope this helps. ·Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Other *FREE* alternatives like ACTIVESTATE PERL or ACTIVESTATE TCL exist.
Activestate Perl with the PERL/TK Module and WIN32::SerialIO Module would allow COM PORT scripting with a GUI interface.
Activestate TCL/TK with EXPECT is a bit more obtuse since it has deep roots in UNIX, but it also has the benefit of being a scripting language with a GUI and needs no extra modules to work with Com Ports.
The benefit of the Activetstate solutions?
1) Free.
2) Your code would be largely device independent since PERL and TCL/TK also run on other platforms, like LINUX or the MAC.
3) Your resulting code is non-compiled. Meaning others could modify it to suit their needs and even learn from it because the source is available.
http://www.activestate.com for more info.
I may even eventually write up a quick tutorial on how these scripting languages could be used with the Stamp or SX/B.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There's nothing like a new idea and a warm soldering iron.
Post Edited (pwillard) : 8/9/2007 9:11:00 PM GMT
Gee. What about that back room and the long-necks? Is that the exploration procedure of which you spoke?
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
The application is specifically written for serial coms with any device ... Obviously a serout in a Stamp finished project is a preferred option .. the reason debug was mentioned was to show that this was also a possibility ... as you can see from the inital thread in march ... The whole purpose of this thread and indeed the one in march was 'writing to text files' on a PC which is where my input to the thread starts and ends ..... whether it be achieved via a 'debug -1' as explained or via the more traditional 'Serout' is entirely up to the end user.
Focus of this Thread:
The object of the thread is that Farsad wants to make a Data Logger - logging data to a file on a p.c - well the methods outlined above achieve that ..perhaps the finer points of do's and dont's of how to achieve this and whether Parallax should/should not include a means to do this is entirely a different issue.
Farsad - Have you progressed with your project ? If not - perhaps you can outline your issues here and it will bring a bit of focus back to the main question outlined in your first question.
Regards,
John Twomey
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
I was just trying to add food for thought since we seemed to be in a stream of consciousness discussion about the Stamp IDE and it started to look like the inability of the IDE to save DEBUG data to a file was a major lacking feature. I totally agree that a logging application designed from the ground up to be that kind of tool is the right way to go. Also, anytime one can avoid using hyperterminal... you are doing yourself a favor.
Farsad: As we have said. SEROUT is your best bet. A collector like John's should be just the thing on the PC side.
---maybe I should have stayed quiet on this... sorry folks.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There's nothing like a new idea and a warm soldering iron.
I think your apology was a bit premature.
Since this thread is about creating a datalogger for the PC, and you were offering viable options, your advice fits in with the discussion.
LATEST UPDATE:
12 August 2007 added the following with new features !
http://forums.parallax.com/attachment.php?attachmentid=48674
Regards,
John Twomey
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
Post Edited (QuattroRS4) : 8/12/2007 4:03:53 AM GMT
thank you for your very useful comments.
QuattroRS4,
your program sounds great and i think it's exactly what i need. i haven't had a chance to test it yet. as soon as i get my system work, i will let you know about the results.
thank you again,
Farsad