View Full Version : Using Comport-Buttons as Inputdevice?
SteveV
October 13th, 2002, 01:55 PM
Hi Mark,
I'm thinking of using a similar setup to keep track of the on/off state of several pieces of HT gear that don't have discrete power on/power off IR codes.
I'm currently using registers to keep track of power state. "System On" and "System Off" MultiGroups check the current value of the reg and send IR out via the Slink-e to change the power state of the equipment, update the reg value, etc. While this has been working reasonably well, it does occasionally get out of sync. I would much prefer using a method that allows checking the physical state of the equipment rather than assuming the reg values are OK.
All of the equipment in question has contact closure when powered on/open contacts when powered off. Any thoughts on how I'd use the generic serial plugin to accomplish this? On a similar note; I seem to recall a parallel port plugin that allowed 8 switches to be monitored. Or did I dream it?
Thanks -- Steve
SteveV
October 13th, 2002, 01:55 PM
...If you want to do this, I could be persuaded to generate events during startup processing or a seperate command to allow you to capture the initial or current state of the lines. I'll probably add something like this in the next release (~2 weeks) anyway...
Ok what's it gonna take? :D Something that would allow me to read the current state of the lines would be ideal. Could this work?
1.) My remote sends the Slink-e a "System On" IR code.
2.) Girder executes the MultiGroup associated with this IR
3.) The MultiGroup contains a command that reads the state of the DCD line (via a variable I assume). If it's it's on: don't do anything. If it's off: Girder does a Goto that executes a Slink-e send action that sends IR out for Receiver Power Toggle.
As for the parallel port plugin, I could not get the reading of bits to work reliably and it is a polling plugin. The source is available on the download page (in the 3.1 input device section) if you want to have a go. :D
I only need to control 3 peices of gear at this point but I'll have a look.
Thanks, Mark!
-- Steve
SteveV
October 13th, 2002, 01:55 PM
Sounds like it'll work :)
Thanks -- Steve
Mark F
October 13th, 2002, 01:55 PM
The four mutiplexed buttons will generate modem events in the serial plugin. You will need to keep a state variable around and execute actions based on the current state.
This should be doable but not easy.
Mark F
October 13th, 2002, 01:55 PM
Assuming the 4 button wiring diagram on the page linked above, this wouldn't be very hard. The state change of the serial lines (DCD, RING, DSR, CTS) can be seen when the device is marked (in the receive properties of that device in the serial plugin) to generate modem events. Unique events are generated for the state changes (ON/OFF).
The biggest problem would be detecting the initial state. If you want to do this, I could be persuaded to generate events during startup processing or a seperate command to allow you to capture the initial or current state of the lines. I'll probably add something like this in the next release (~2 weeks) anyway.
As for the parallel port plugin, I could not get the reading of bits to work reliably and it is a polling plugin. The source is available on the download page (in the 3.1 input device section) if you want to have a go. :D
Mark F
October 13th, 2002, 01:55 PM
I was thinking of something slightly different. :-)
Currently, if one of the lines changes state, an event is generated. You could capture the current state of that line based on this event.
I will add a NEW command to the plugin that forces 4 events to be issued (one for the current state of each line - DCD RING CTS DSR) for the serial device the command targets.
At Girder start-up, you issue the new command and gather the current state of each of the lines into one or more variables (state variables) by triggering a unique command for each line change event.
During normal processing:
Your remote sends the Slink-e a "system-on" IR code
You interogate the particular state variable to decide whether to send the ON IR to the component or not
When the state of the line changes (the component turns on or off), an event occurs and same event handlers from the start-up processing sets the state variable
This will allow me to change the least amount of code while getting the current state information into your hands. Would this be OK?
tochaotic4u
October 13th, 2002, 01:55 PM
Hello!
If planing to do a mp3-Player projekt, an want to controll my mp3-player soft and other apps by buttons attatched to the comport like the 15 button version on this site:
http://www.meierspage.de/index2.htm?/meierspage/how2s/winamp_steuerung/winamp_steuerung.htm
Does anybody know how to do it with girder? Perhaps by the Serial-Port Plugin or does anybody did something like this?
ThanX,
tochaotic4u
Mark F
October 22nd, 2002, 12:09 PM
This is an older thread but I have implemented the new command AND an interface that can be queried through LUA in the 3.0.6 version of the serial plugin. :)
SteveV
October 22nd, 2002, 12:22 PM
Thanks Mark--I've been silently watching the other thread but haven't had a chance to try anything yet. Hopefully, I'll have time to play with the new plugin within the next couple of days :)
Thanks again -- Steve
Mark F
October 22nd, 2002, 01:17 PM
Great. The readme.html file has a lot more information than before so it may actually be useful this time. :)
Mark F
November 28th, 2002, 03:43 AM
I created a device support file for the serial plugin for the hardware described in this thread. It should be the first post on this page (http://www.girder.nl/phpBB2/viewtopic.php?t=206&start=31).
The support file generates unique events for each button press and each button release.
Enjoy. :D
Powered by vBulletin® Version 4.1.8 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.