The Shop > Electronics & IC Programing
de'tokenising'
<< < (2/3) > >>
awemawson:
David,

From the web site description:

The output data is a continuous stream in simple text format (sensor number followed by temperature reading to 2 decimal places). Simply capture the data to a text file and then import it into Excel to produce tables and charts of temperature readings over time.

Write a diddy to capture the data, and either average sixty readings and use the result, or only save one reading in sixty, to get your 1 reading per minute requirement
RussellT:
If it outputs a continuous data stream then your "term" program is presumably just sampling the input 60 times a minute - there could be a lot more data than that.  I still think writing a new program to sample the port data would be straightforward - but if you have the source code for the existing program it should be even easier.

Russell
DavidA:
Thinking about this.
The way to go for me seems to be to,  as suggested,  write a short BASIC program that takes a reading every minute then stores the reading to a sequential file.
As the readings are to be part of a continually running data gathering exercise,  and I don't want this single aspect hogging the computer,  I am going to try set it up using the clock (Time string) to trigger the read program. If I allow half a second every time the seconds section of the string (A$=time$: b$=a$(right$,2) or something similar  reaches 00 then I will have fifty nine and a half seconds free for other things.  A long time even for an old 486.

Thanks for the help on this one.

Dave.
porker:
I guess you have found that the C source code is linked to at the bottom of the page under Software options. The simplest way would be to modify that program but I took a look and it looks like it runs in a tight infinite loop so not letting another process come in as you want (I'm more of a Linux person so not sure whether programs are allowed to 'hog' all the CPU time or not - I know older versions of Windows they could).
I don't know whether there is a CRON equivalent for Windows to allow you to easily schedule your program to execute every 60s, capture a temp reading and append to a file. That's how I would do it.
Interesting to see the sensor itself outputs a digital signal and the PIC is just sending out on the RS232 line. Neat.
DavidA:
Porker,

Yes,  you are right .  The original is more or less a stand alone program that hogs the machine it is running on.  Not what I want at all.
I'm going to go with the idea of creating a BASIC prog that I can use as a sub-routine and call it every minute from the main program  to take one set of readings from each of the four inputs. Then save these to a file.

What I do at the moment (or when I use the device) is to let it run for a while,  then use a small BASIC program to create a new file from every sixtieth reading of the original.  Much more manageable when I pass this to my spreadsheet for graphing.

Those sensors are quite nifty,  and relatively expensive.

At the moment I am getting my 'den' ready for the coming cold weather.  I just won a set of six driving wheel castings on Ebay,  so I will have to get back into the modelling frame of mind,
What with that and the car,  there isn't even time to think about getting old.

Dave.
Navigation
Message Index
Next page
Previous page

Go to full version