Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.msdos.programmer > #478

Re: A Warning System

From DOS Guy <DOS@Guy.com>
Newsgroups comp.os.msdos.programmer
Subject Re: A Warning System
Date 2012-02-12 13:19 -0500
Organization Aioe.org NNTP Server
Message-ID <4F380296.4FB64DBF@Guy.com> (permalink)
References <jh5ifv$f2a$1@orkan.itea.ntnu.no> <Xns9FF69EBA73534auricauricauricauric@88.198.244.100> <jh8qjh$mu9$1@orkan.itea.ntnu.no>

Show all headers | View raw


Knut Schroder wrote:
 
> A typical txt file is like:
> 
> Date/Time,Zn,Pb,Cu,All Units in ppb
> 19.01.2012 13:27:43, 547.3, 19.4, 9.5
> .......
> .......
> 19.01.2012 16:00:42, 515.5, 20.5, 8.3
> 19.01.2012 16:15:42, 524.5, 17.4, 9.2
> 19.01.2012 16:30:42, 731.7, 28.0, 10.6
> 
> The first line is a heading with Date/Time and the different
> polluting metals, and then the lines with the subsequent
> measuring results.

Is a new file created for each day, or is all of this being spewed into
a single (and increasingly large) text file?

Do you have any control over the design and programming of the program
that creates this file? (I assume not).

It looks like you have a new line being created every 15 minutes.

The basic program could therefore open the file for read-only access
maybe every 10 minutes (just so it doesn't miss any data) and read the
file to the end each time.

How critical is the time delay between when new data is written to the
file and when the file is read by this hypothetical warning program?

Also note this:  It's not uncommon on NT-based systems for log data to
be spooled to a file and NOT be "visible" or accessible to another
program or process until the NTFS file system has performed some
journaling action, which could happen maybe after an hour or more has
passed.  I see this a lot when it comes to web-server log files.

> Say the legal maximum levels of the three metals are 650.0, 40.0
> and 20.0 respectively. Then the alarm should be given after the
> last measurement. Auric__ kindly offered to adjust the program 
> appropriately.

Now that we know the number of variables present on each line, crafting
the proper code to read each line is easy.

> The beeping is of course the easiest way to do this, but it will be
> a great advantage if also a relay could be opened (or closed). 
> Could that be arranged through USB or another way? With such a relay,
> a discharge of sewage to a lake can be stopped and it is also very
> simple to connect it to a cheap alarm system using SMS-messages,

I would think that the simplest way to operate a relay from a compiled
basic program running under an NT-based OS is to send a control command
out through a com port (RS-232 port) to a control board that has the
appropriate relay.  Could also be done by sending through the LPT
printer port.

(NT-based OS's will present a virtualized com port to any 16-bit DOS
process or program, but in the end the DOS program will be able to send
data out of the computer's com and LPT ports as if this virtualization
layer is not present.  This would not be the case for other hardware
ports...)

I'm sure there are dozens if not hundreds of possible retail solutions
for this - here's the first one I found using a google search:

http://www.controlanything.com/Relay/Relay/RS232_Relay_Controllers

This assumes that the discharge valve to be controlled with the relay is
located relatively close to the computer (maybe 100 yards or meters at
maximum?).

And again I note that you seem to want sms messages to be sent.  It
would be easier to automate the sending of an e-mail from the computer
instead of an sms message.  It's not an easy thing to set up a
programatic interface to an sms message system.

Back to comp.os.msdos.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

A Warning System Knut Schroder <Knut.Schroder@chem.ntnu.no> - 2012-02-11 12:12 +0100
  Re: A Warning System DOS Guy <DOS@Guy.com> - 2012-02-11 08:33 -0500
  Re: A Warning System "Auric__" <not.my.real@email.address> - 2012-02-11 22:34 +0000
    Re: A Warning System Knut Schroder <Knut.Schroder@chem.ntnu.no> - 2012-02-12 17:49 +0100
      Re: A Warning System DOS Guy <DOS@Guy.com> - 2012-02-12 13:19 -0500
        Re: A Warning System DOS Guy <DOS@Guy.com> - 2012-02-12 17:12 -0500
      Re: A Warning System "Auric__" <not.my.real@email.address> - 2012-02-13 03:25 +0000
        Re: A Warning System "Auric__" <not.my.real@email.address> - 2012-02-13 03:30 +0000
          Re: A Warning System Knut Schroder <Knut.Schroder@chem.ntnu.no> - 2012-02-13 18:08 +0100
            Re: A Warning System "Auric__" <not.my.real@email.address> - 2012-02-14 05:25 +0000
              Re: A Warning System Knut Schroder <Knut.Schroder@chem.ntnu.no> - 2012-02-29 13:41 +0100
                Re: A Warning System "Auric__" <not.my.real@email.address> - 2012-02-29 13:20 +0000
                Re: A Warning System DOS Guy <DOS@Guy.com> - 2012-02-29 23:33 -0500
                Re: A Warning System Sjouke Burry <s@b> - 2012-03-01 05:04 +0000
                Re: A Warning System DOS Guy <DOS@Guy.com> - 2012-03-01 10:01 -0500
                Re: A Warning System Knut Schroder <Knut.Schroder@chem.ntnu.no> - 2012-03-11 09:51 +0100
  Re: A Warning System pete@nospam.demon.co.uk - 2012-02-12 15:20 +0000

csiph-web