Author Topic: Win XP PRO SP3 as external event logger  (Read 1361 times)

0 Members and 1 Guest are viewing this topic.

Online soldar

  • Super Contributor
  • ***
  • Posts: 2598
  • Country: es
Win XP PRO SP3 as external event logger
« on: January 16, 2019, 04:57:15 pm »
I would like to use a an old PC to log events like closing of switches. Very simple requirements. Log, in a text file, time and change in switch status.

First problem to resolve is how to get the info to the PC.  I have a PC with two serial DB9 connectors. That seems to me like the simplest way to interface. I would have no problem building some external electronics if needed or buying something inexpensive. I suppose if I am going to get an external interface it could also be USB.

What software can I find that would do this? I am looking for something simple, quick and dirty.

 
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1794
  • Country: 00
Re: Win XP PRO SP3 as external event logger
« Reply #1 on: January 16, 2019, 06:54:10 pm »
I would attach an Arduino with some sensors to your switches. Then Arduino could write the data to serial and you could use PuTTy to capture the serial data to a log file.
 

Online soldar

  • Super Contributor
  • ***
  • Posts: 2598
  • Country: es
Re: Win XP PRO SP3 as external event logger
« Reply #2 on: January 16, 2019, 09:18:39 pm »
I am not familiar with Arduino and it is more effort than I can put into this. I am hoping for a very simple, low cost board or interface, be it RS232 serial or USB that will monitor some switches and log any changes.

I guess it would need some software.

Come to think about it controlling one or two outputs would be nice although not strictly necessary at this point.

Another thing that would be nice is the ability to send an email on any input change.

I would think this would be something relatively common but I do not even know what words to search for.
« Last Edit: January 16, 2019, 09:39:35 pm by soldar »
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Online MrMobodies

  • Frequent Contributor
  • **
  • Posts: 625
  • Country: gb
Re: Win XP PRO SP3 as external event logger
« Reply #3 on: January 16, 2019, 10:29:39 pm »
I know of something similar to measure voltage of serial battery chargers but can be altered by the device templates.

Logview (Free):
http://www.logview.info/forum/index.php?pages/home/

V2 logs all but only displays one sensor at a time.
It has a built in web server that can be turned on.

V3 Studio requires Net Framework 4, installs Mysql and has stability issues.

I don't think it does email.
« Last Edit: January 16, 2019, 10:34:42 pm by MrMobodies »
 

Offline digsys

  • Supporter
  • ****
  • Posts: 2049
  • Country: au
    • DIGSYS
Re: Win XP PRO SP3 as external event logger
« Reply #4 on: January 16, 2019, 11:07:03 pm »
These are a few methods I use / used for many years -
1/ Deluxe method - sensoriumembedded.com/products.htm  up to 24in, other devices that do I/O + analogue .. everything sent to HID .. then from there -
https://joytokey.net/en/    redirect / modify the Inputs to any keyboard command to any program. All done for you and extremely flexible.
2/ Write direct to an LPT port (buffered) - I do it on XP3 very often. I may still even have buffered / decoded LPT IO pcbs somewhere.
That gives you 8in (and/or op) plus a few LPT control lines. 378h - 37Fh , 278h - 27Fh
3/ Write direct to a serial port. 3F8 , 2F8   , 3E8 , 2E8. You get about 2-3 in / 2-3 op lines. Or make up a simple command to IO decoder. I may even have some
of those around.
4/ Various other hardware ports. Back in the XP3 days, we could easily write / read direct from literally any M/Board IC :-)
I'll see what I have around in the next day or 2
Hello <tap> <tap> .. is this thing on?
 

Online soldar

  • Super Contributor
  • ***
  • Posts: 2598
  • Country: es
Re: Win XP PRO SP3 as external event logger
« Reply #5 on: January 16, 2019, 11:15:19 pm »
MrMobodies, that looks like it might work but it does not explain what hardware I need or might work with it. I need to know what hardware I need because I want something really low cost.


All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline Flenser

  • Regular Contributor
  • *
  • Posts: 59
Re: Win XP PRO SP3 as external event logger
« Reply #6 on: January 17, 2019, 02:53:10 am »
Using your serail ports would likely mean you will have to build or buy an external circuit that converts the state of your switch to a serial transmission which probably isn't going to be "simple, quick and dirty".

Does your old PC have a parallel port?

A parallel port has 5 or 8 bits which can be read directly, depending on the parallel port type, and it's the sort of project people did with PC's before microcontrollers, and microcontroller projects, became common. So you might be able to find a simple circuit and some existing software on the web.

I've just had a quick look and found this which has a simple circuit and links to software for monitoring switches:
http://www.epanorama.net/circuits/parallel_output.html#input

The other project people did was parallel port logic analyzers. There are a _lot_ of logic analyzer projects but you will need to find one that logs continuously to a file or write/modify software yoursellf to do this logging.
« Last Edit: January 17, 2019, 03:16:00 am by Flenser »
 

Online soldar

  • Super Contributor
  • ***
  • Posts: 2598
  • Country: es
Re: Win XP PRO SP3 as external event logger
« Reply #7 on: January 17, 2019, 09:13:15 am »
Thanks Flenser for your input. I mentioned serial port input thinking it would be as easy as parallel port input but, after thinking about it, you are right and it is not so easy. Since I have no parallel ports I will forget about legacy serial and parallel ports.

Thanks digsys. That sensoriumembedded device looks like it might do what I want but it is a bit pricey and I would need to get the software separately. I think I will keep looking for now.

Ideally I think there would be a USB board with binary switch inputs. I am surprised this is not quite common and readily available at low cost.

Another option might be to hack a keyboard and put relay switches in parallel with some keys.

I am really surprised there is not more variety of offers for this type of interface to log inputs and maybe control some outputs.

I wonder if I could use a PLC module; something like https://www.ebay.com/itm/172919922474 . Maybe it could work autonomously and independent of the computer until I wanted to download that log data.  Anybody have any experience with that?
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline dunkemhigh

  • Super Contributor
  • ***
  • Posts: 1471
Re: Win XP PRO SP3 as external event logger
« Reply #8 on: January 17, 2019, 09:24:11 am »
Quote
Ideally I think there would be a USB board with binary switch inputs. I am surprised this is not quite common and readily available at low cost

Depends on what you call low cost - to DIY would cost you much more than you'd pad for some of these:

https://www.poscope.com/products/pokeys-devices/
 

Offline digsys

  • Supporter
  • ****
  • Posts: 2049
  • Country: au
    • DIGSYS
Re: Win XP PRO SP3 as external event logger
« Reply #9 on: January 17, 2019, 09:31:08 am »
Quote from: soldar
... I mentioned serial port input thinking it would be as easy as parallel port  ...
A serial port has 5x Inputs and 3x Outputs. You address those pins directly - NOT as a serial comms, you don't need any of that. Just read / write the registers.
You can use even the simplest of languages, even DOS. Just set up a timer interrupt for the poll time you need.
Since you have 2x serial ports, that's 10x Inputs and 6x Outputs. Simple buffers / level protection in / out. Very simple
Quote from: soldar
... I wonder if I could use a PLC module ... Maybe it could work autonomously and independent of the computer until I wanted to download that log data.  Anybody have any experience with that?
That's also a very cheap / easy solution, and you can get that type of thing in USB as well. Just check what level of software you get with it, or if it easy to write
your own. Also used heaps of those types of I/Face
Hello <tap> <tap> .. is this thing on?
 

Online soldar

  • Super Contributor
  • ***
  • Posts: 2598
  • Country: es
Re: Win XP PRO SP3 as external event logger
« Reply #10 on: January 17, 2019, 02:33:40 pm »
Depends on what you call low cost - to DIY would cost you much more than you'd pad for some of these:

https://www.poscope.com/products/pokeys-devices/
Thanks. That looks in line with what I am looking for but, like other things I have looked at, it seems not explained simply and clearly.

I found Velleman K8055 which looks like it connects using USB, has 5 digital & 2 analog inputs and 8 digital + 2 analog outputs. It comes already with some basic software and you can write your own using Visual Basic. Since I have no idea of Visual Basic I would have to learn. I do not know how much effort I would need to put into learning VB.

It sounds like an alternative would be to use and learn Arduino or Raspberry Pi but, again, it would be a new learning ting for me. 
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Online soldar

  • Super Contributor
  • ***
  • Posts: 2598
  • Country: es
Re: Win XP PRO SP3 as external event logger
« Reply #11 on: January 17, 2019, 02:40:54 pm »
digsys I guess you are right and I could access the serial port pins directly but the more I think about this the more I think it might be better to go with some USB solution which will not be obsolete before I even start.

If that PLC can keep time and log events then that would be just what I need because the computer would not have to be running all the time. Just connect from time to time and download the data. I don't know how to find out about this. I'll have to keep looking. If anyone can give me documentation it would be good.

I miss the old days of basic BASIC when you could do all this with peeking and poking and "GOTO 10".
« Last Edit: January 17, 2019, 06:07:18 pm by soldar »
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline dunkemhigh

  • Super Contributor
  • ***
  • Posts: 1471
Re: Win XP PRO SP3 as external event logger
« Reply #12 on: January 17, 2019, 08:16:01 pm »
I think we are all in danger of diving off the deep end without knowing if there's any water in the pool...

Perhaps it would be a good idea to give us an idea of a) what you  want as the end result, and b) your abilities/desires in regards to programming and  the like. At second glance, a 10 euro Logic8 clone from China and free logic analyzer software might do the thing (it would give you a history of what changed and when), and it's pretty instant to get going. But that's probably not appropriate :)

So, are you after an actual log file with, say, "timestamp, switch ID, state" on each line? Or a graph along the lines of an RRD chart?

Next, do you want to do any coding yourself and, if so, how deep into that would you go (for instance, accessing the data via some library DLL API)? Any languages you know or could learn (and would want to learn)?
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 13930
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Win XP PRO SP3 as external event logger
« Reply #13 on: January 17, 2019, 08:30:46 pm »
2/ Write direct to an LPT port (buffered) - I do it on XP3 very often. I may still even have buffered / decoded LPT IO pcbs somewhere.
That gives you 8in (and/or op) plus a few LPT control lines. 378h - 37Fh , 278h - 27Fh
3/ Write direct to a serial port. 3F8 , 2F8   , 3E8 , 2E8. You get about 2-3 in / 2-3 op lines. Or make up a simple command to IO decoder. I may even have some
of those around.

If your "old PC" has these ports onboard, it's not at all a bad way to go.

You will need to use a device driver like GiveIO to be able to use them on WinNT (XP, etc.).

This is what I did for the somewhat more elaborate project I did back in college:



The ribbon cable coming in from the left is a parallel port from the PC, which was running, some old (already, at the time) motherboard with a Duron 1.6GHz CPU I think, and WinXP.  On Win98, straight IO from user-land can be done, but on NT you need to ask the OS "pretty please".  Installation and use is straightforward.

For logging, of course, you'd just be polling the inputs, and checking for state change.  Or if you don't mind a little logic, an external latch to hold the trigger state, then a read-and-clear-latch operation from the PC would allow more freedom, since, keep in mind, we're talking a multitasking OS here, so you can't assume your program will be running on time, every single millisecond.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: MrMobodies

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 13930
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Win XP PRO SP3 as external event logger
« Reply #14 on: January 17, 2019, 08:36:27 pm »
I miss the old days of basic BASIC when you could do all this with peeking and poking and "GOTO 10".

I mean, you can easily pick up an old PC-compatible something or other, load up MS-DOS and QBASIC, and INP(&H3F8) or what have you.  The downside is, you'll need a compatible floppy drive to copy the files from, or else a serial connection (in which case we're back to the start), or a network card with compatibility to modern Ethernet or whatever (which isn't hard to find actually, but you will most likely have to find one, plus install the drivers).

This can almost be done in DOSbox -- serial IO works, with a USB adapter configured as the serial device.  I don't think it works as a bit-bang port though (RTS/CTS pins)?

I mean, if you have one, you can give it try though anyway. :)

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Online soldar

  • Super Contributor
  • ***
  • Posts: 2598
  • Country: es
Re: Win XP PRO SP3 as external event logger
« Reply #15 on: January 17, 2019, 08:51:36 pm »
dunkemhigh, yeah, I'm sorry I am a bit unclear on the idea. I started out thinking input through a legacy port would be easier but I am changing my mind. This exchange is helping me clarify my own ideas.

Ideally I would be knowledgeable and experience with Arduino but I've missed that boat. Maybe I should start down that way.

Let's see. For now the ideal would be something like a "$10 usb board" which with very basic programming just adds a line to a text file each time an input changes. Something like this would do:
Code: [Select]
.
 2019/01/17 12:31:23 PM - Input 5 =  1               
 2019/01/17 12:31:24 PM - Input 5 =  0               
 2019/01/17 12:32:26 PM - Input 1 =  1   
 2019/01/17 12:32:28 PM - Input 2 =  1     
 2019/01/17 12:32:27 PM - Input 1 =  0   
I can interpret each input as "door open" or whatever it is.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 13930
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Win XP PRO SP3 as external event logger
« Reply #16 on: January 17, 2019, 09:12:50 pm »
You could literally do that with Notepad, and a keyboard cut down to just the F5 key. B)  (Or an analog switch or relay closing the connections to the button.)

Well, almost.  Doesn't add the pin data, or start a newline.  Doesn't auto-save the file either, changes would be lost if the computer shuts down unexpectedly.

An AutoHotKey script could solve all of that, I think.  A hacky solution for a hacky method. ;D

The canonical heavy-weight solution these days would be either something like Labview, or the serial converter and a logger (which could be as simple as a Bash script, for those using Linux, I think?).

Arduino isn't hard to learn, it's a good excuse to pick up if you don't need this solved super urgently. :)

Tim
« Last Edit: January 17, 2019, 09:14:28 pm by T3sl4co1l »
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Online soldar

  • Super Contributor
  • ***
  • Posts: 2598
  • Country: es
Re: Win XP PRO SP3 as external event logger
« Reply #17 on: January 17, 2019, 09:21:42 pm »
You could literally do that with Notepad, and a keyboard cut down to just the F5 key. B)  (Or an analog switch or relay closing the connections to the button.)
How can I get Notepad to note the time when the key is pressed and when it is released?

Well, almost.  Doesn't add the pin data, or start a newline. 
If we had some ham we could have some ham and eggs ... if we had some eggs. :) I am afraid Notepad does not seem to get anywhere close.

The canonical heavy-weight solution these days would be either something like Labview, or the serial converter and a logger (which could be as simple as a Bash script, for those using Linux, I think?).
I might ask in the Linux forum. Maybe the software side would be easier. Good idea.

Arduino isn't hard to learn, it's a good excuse to pick up if you don't need this solved super urgently. :)
Yes, I have been thinking for years now that I should learn Arduino. Maybe this is the time to finally get my butt in gear.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 13930
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Win XP PRO SP3 as external event logger
« Reply #18 on: January 17, 2019, 09:28:15 pm »
How can I get Notepad to note the time when the key is pressed and when it is released?

Yeah, not release....... heh, well, it could be a parsing solution.  Hold down F5 and it spams timestamps... just find the last one that was <keyboard repeat rate> apart and you've likely found the keyup event.

Now let's throw our heads back and laugh at that mess of an idea... :-DD

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1794
  • Country: 00
Re: Win XP PRO SP3 as external event logger
« Reply #19 on: January 17, 2019, 09:30:30 pm »
Arduino's are so cheap and there is so much online and support for them. I think you will be surprised how easy! And I'm sure many here will help with code.
 

Online soldar

  • Super Contributor
  • ***
  • Posts: 2598
  • Country: es
Re: Win XP PRO SP3 as external event logger
« Reply #20 on: January 17, 2019, 09:31:42 pm »
I did this some forty years ago with a 6502 development system called AIM 65, in assembler, and it seemed extremely easy. I thought I would repeat the same idea.

Basically the idea is to have a log or record of events. When somebody rings the bell, when the cabinet for the water meter is opened and I know the meter has been read, when the cat goes in or out that cat door (if I had a cat), ... that kind of thing.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1794
  • Country: 00
Re: Win XP PRO SP3 as external event logger
« Reply #21 on: January 17, 2019, 09:35:51 pm »
The Arduino also has several adc inputs so you can read voltage levels. My favorite flavor is a Nano.
There is a real time clock library to make regular timekeeping quite easy.
 

Offline fourtytwo42

  • Frequent Contributor
  • **
  • Posts: 787
  • Country: gb
  • Interested in all things green/ECO
Re: Win XP PRO SP3 as external event logger
« Reply #22 on: January 17, 2019, 09:36:59 pm »
Maybe off subject by now but just a plug for winXP/SP3 I use it everyday as far as I am concerned it is the last stable release of windows!
 

Online soldar

  • Super Contributor
  • ***
  • Posts: 2598
  • Country: es
Re: Win XP PRO SP3 as external event logger
« Reply #23 on: January 17, 2019, 09:37:33 pm »
Arduino's are so cheap and there is so much online and support for them. I think you will be surprised how easy! And I'm sure many here will help with code.

Yeah, it seems like I really should get started. I am going to look into it. Thanks for the encouragement. Maybe you can suggest a particular model?
« Last Edit: January 17, 2019, 09:41:24 pm by soldar »
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Online OwO

  • Frequent Contributor
  • **
  • Posts: 621
  • Country: cn
  • RF Engineer @ OwOComm
Re: Win XP PRO SP3 as external event logger
« Reply #24 on: January 18, 2019, 02:14:39 am »
Oh god this isn't 1810, please don't recommend parallel port/MSDOS/BASIC based solutions, plus an old PC running for any significant time will cost you more in electricity than anything you would have saved by reusing old hardware. It's not worth it.

I would really recommend a Pee based solution (raspberry, orange, banana, any of the flavors). You have access to the GPIOs directly from userspace and can simply write a C or Python program to log the data to a file. It will take what, 30 lines of code? The only thing I would really add is input protection for the GPIOs. If this is really slow stuff (<1MHz), a large (~220ohm) series resistor and a diode clamp would be sufficient.

EDIT:  You can also easily have a script running in the background to periodically rsync the logs to a remote server or PC for ease of access, or even have a web interface where you can view the logs. None of this would be easy to do on WinXP.
« Last Edit: January 18, 2019, 02:20:57 am by OwO »
つぁおにずぞんしばだい。
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf