Re: [Hampshire] C development

Top Page

Reply to this message
Author: Roger Munford
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] C development

On 13/06/14 08:34, James Courtier-Dutton wrote:
> On 13 June 2014 06:55, James Courtier-Dutton <james.dutton@???> wrote:
>> On 12 June 2014 18:56, Roger Munford <rogermunford@???> wrote:
>>> 100 years ago I wrote a data logging programme for DOS which ran on a Sharp
>>> pocket PC. It was written in C and assembler. I now have a need for this
>>> programme and would like to revive it for use with the Raspberry Pi.
>>>
>>> I haven't done anything like this for some time and would like some advice
>>> on current techniques to get the job done as soon as possible.
>>>
>>> The first thing is a suitable IDE. I have had some experience with Eclipse
>>> but it may be a bit heavyweight for quick results. However if extra effort
>>> pays off in the end it might be worth it.
>>>
>>> I will also need a lightweight graphics library. The original plotted data
>>> on the display which was done with functions like drawline(x1,y1,x2,y2) and
>>> writechar(x,y,char) etc. That sort of level. Having said that, the Pi has a
>>> lot more capability and I could use an existing display package.
>>>
>>> The data came from various sources, some serial and some small devices which
>>> were connected to the parallel port. The smallest timing period was 1 second
>>> and I used the timer interrupt to initiate the read commands because there
>>> was a lot of processing going on, updating the display and also the logger
>>> had a modem attached so that data could be collected remotely. Is this the
>>> way to go with linux or is there a better/easier technique.
>>>
>>> Originally I just recorded the data sequentially in a file but I was
>>> wondering if there was any advantage in using something like sqllite.
>>>
>>> I would be grateful to hear for any advice.
>>>
>> Hi,
>>
>> A quick solution would be to use DOSBOX.
>> It can be run on the raspberry pi and runs old DOS x86 programs
>> directly. It has good support for serial ports, not used the parallel
>> support, but it should be ok.
>>
>> Then, if you wish to re-implement your program natively, then some
>> things I would do:
>> 1) You won't need assembler any more.
>> 2) Separate out data collection and data visualization into two
>> separate programs. Maybe use a database in between, or it the data
>> rates are too high, use CSV files.
>> 3) There are many data visualization programs already out there, you
>> might not have to do any work in this area.
>>
> If you choose to use DOSBOX, http://www.dosbox.com
> I have some patches that make it work better with data logging applications.
> My patches make the timestamps use the linux system clock, instead of
> DOS "ticks" which can be out by about 10 minutes each day.
>
> If you instead choose to re-write the application, you might wish to
> consider displaying the output in a web browser, ie. write a web app,
> or provide the output via the REST web services protocol.
> You could then display the output on a smart phone, tablet or any
> other web based device.
>
> Kind Regards
>
> James
>

Thank you very much for the suggestions. Sadly I threw away the floppies
with the compiled version of the programme but kept the source so I
can't try it with DOSBOX. I very much like the idea of splitting the
data acquisition and displaying via a web browser for the reasons
outlined. I can imagine that something like sqlite would do for storing
the data because my sampling period will be a few seconds and it would
be easier to manipulate the data.
I am also thinking of using Arduinos for remote data acquisition so that
would fit in nicely.

Thanks again

Roger


--
Please post to: Hampshire@???
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--------------------------------------------------------------