Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suggestions 2

Status
Not open for further replies.

Swi

Programmer
Feb 4, 2002
1,963
US
My father-in-law has a security system set up (Zmodo).

He would like to have his PC wake up and set focus on the Zmodo application when his motion sensor is tripped.

I have no experience doing anything like this. What would be the best way to handle this? Should I have him send something to a COM port?

Thanks in advance.

Swi
 
Should I have him send something to a COM port?

Naaaah! It's not 1989 any more, hacking COM or LPT ports is very last century :)

There is a plethora of USB input devices from devices such as;

(used to come with a driver kit that included a VB class as an API). I used it a few time when I did that sort of stuff for a living (Using a PLC or a Venom micro-controller ( is overkill sometimes).

Or the highly versatile Rasberry PI (
Or you could hack together a simple device that used a PS2 mouse or keyboard port if you were desperate for some solder fumes.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Or you could use a joystick port because PC joysticks are digital inputs.

The files from a project I was working on eleven or so years ago are attached.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Thanks for the responses.

Thanks.

Swi
 
They certainly are, Sensory Software used to produce a piece of kit called 'Joy Box' that was a 'breakout box" and provided six switch inputs into the fifteen pin 'D' joystick port. They also produced a USB version that had 12 switch inputs. I wrote a VB6 application that used two of them as inputs for turnstile counting (23 turnstiles) at the old Bloomfield Road stadium for Blackpool FC which provided the police and the safety crews a real time graphical display of exactly how many people were in each area of the ground, the capacity of that area and an estimate of how long before it reached capacity, based on the last five minutes 'flow'. All from reading digital inputs from the Windows 'joystick' API.



Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
I'm afraid I'm going to have to disagree. Pins 3, 6, 11 and 13 on the 15 pin adapater are analog, and the value is represented by a variable voltage on the pin (which is then passed through an ADC process), and the value polled; it was the source of much angst in programmers because it was a less than accurate way of presenting the X/Y coordinates, which was one of the reason joysticks had to calibrated - and recalibrated. (and of course it can treated as digital simply by how one might interpret the presented value, e.g. 0V = 0, any other voltage= 1).

And there were various tricks that could be used to increase the number of buttons supported without resorting to using the analog pins. For example the 15 pin port theoretically only supported 4 buttons. But if instead of wiring each button directly to a pin (normal usage), we use the 4 pins to represent a binary number we can support 15 buttons/switches (although with this simple example we lose the ability to detect simultaneous key/switch presses)
 
Sure, BUT the API from where the INPUT that can be read by ANY software IS digital ie: a number. As you pointed out yourself the value from the physical device is passed through an analogue to digital conversion process (ADC) before being presented for the software to read.

Compact discs are digital inputs but the audio is analogue.

But back to the joystick, if you read the PC gameport pinout specifications you WILL find that ALL the physical switches have seperate inputs where, if you place a on/off device between +5ve (pins 1,8,9,15) and an input pin, say pin 2 which is 'button 1' on the physical joystick, you WILL have a DIGITAL input. Digital being 1 or 0 in digital logic terms.

Whether the PHYSICAL device is analogue or not the signals that can be read by software ARE digital and it is very simple to make an 8bit digital input using pins 2,3,6,7,10,11,13,14 of the gameport. The port pins have internal 'pulldown' resistors that bring the input to (TTL) logic level 0 if no input signal is present. SO how is that NOT digital?

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
> is passed through an analogue to digital conversion

Well yes of course, since a PC is digital all signals end up being digital at some point - but this does not make the original signals nor their inputs digital.

For example, I'm sure you wouldn't argue that the typical microphone audio input on a PC was a digital input, even though it also gets passed through an ADC process before the PC can work with it.

>bring the input to (TTL) logic level 0 if no input signal is present
I pretty much covered that when I said "and of course it can treated as digital simply by how one might interpret the presented value, e.g. 0V = 0, any other voltage= 1".

I therefore continue to disagree that the PC gameport is/was a purely digital port (I have no quibble with the fact that once the input is processed, converted and presented by an API it has entered the digital domain).

 
Not worth it, he'll just keep up the gyrations and convolutions trying to salvage his untenable assertion. Doesn't matter anyway, what PC ships with legacy game ports anymore?

And none of this matters since "waking up" a PC in the manner desired is pretty clunky. Assuming that's what was meant of course. Surely nobody is leaving PCs running 24 by 7?


As far as I know security systems typically offer some way to alert a mobile device such as a phone or tablet. That would seem to be far more useful anyway.
 
dilettante,

This is actually for my father-in-law. He does not have a smart phone or tablet and normally does keep his PC up 24/7.

Basically when his computer goes to sleep (which he wants) if the system is tripped he wants his PC to wake up and refresh the screen so he can see what is going on.

Swi
 

Not worth it, he'll just keep up the gyrations and convolutions trying to salvage his untenable assertion
I know the feeling

And the assertion is NOT untenable if you actually looked up the original joystick design, yes on the first ones the yoke control was analogue, that went away in around 1985/86 when the Atari style of digital (switched) joystick was used, now if you still have a fully working 30 year old joystick good for you, but after 'reverse engineering' many joysticks in the late 80s early 90s when developing a system. I KNOW that the gameport, which is STILL fitted on some sound cards for use as a MiDi port, it makes a very easy to read 8bit digital input.





Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
PCs can have many levels of "sleep" state, all the way down to where they can be awoken via LAN adapter or even modems and COM ports (wake-on-LAN, wake-on-Ring).

But it sounds like you just want to leave the PC fully "hot" 24 by 7, always logged on, and when some program detects an external event just change the power state of the monitor(s):

Code:
PostMessage HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, POWER_ON

If we assume all of that then it becomes a question of the options this "security system" has for signaling devices.

But this sounds like something that already has a client that runs on the PC, possibly just connecting to IP cam units that can signal stuff like motion events.

I'm not sure I see any role here for a VB6 program at all.
 
Thanks for the information. I will have to take a closer look.


Swi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top