io ports
adys
Posts: 395
hi
How can i listen to io ports changes ?
is this suppose to work?
button_event[dvKJPreAmpIO, 1]
{
push :
{
SEND_STRING dvDebug, "'IO ON'"
}
release :
{
SEND_STRING dvDebug, "'IO OFF'"
}
}
from some reason it does not work...
I tired also to change the io setting with no success....
send_command dvKJPreAmpIO,"'SET INPUT 1 LOW'"
send_command dvKJPreAmpIO,"'SET INPUT 2 HIGH'"
What am I doing wrong?
the wire is connected to the + and to the 1 of the IO on the NI3000
thanks
ady.
How can i listen to io ports changes ?
is this suppose to work?
button_event[dvKJPreAmpIO, 1]
{
push :
{
SEND_STRING dvDebug, "'IO ON'"
}
release :
{
SEND_STRING dvDebug, "'IO OFF'"
}
}
from some reason it does not work...
I tired also to change the io setting with no success....
send_command dvKJPreAmpIO,"'SET INPUT 1 LOW'"
send_command dvKJPreAmpIO,"'SET INPUT 2 HIGH'"
What am I doing wrong?
the wire is connected to the + and to the 1 of the IO on the NI3000
thanks
ady.
0
Comments
For using the IO ports as inputs:
If you are using "LOW", a short between IO port 1 and gnd (not +12v)will cause a push.
If you are using "HIGH", a short between IO port 1 and gnd will cause a release and the port will read a push when you open circuit the IO pin. That's what I see, anyway.
To use the port as an output requires that the port be set to "LOW".
So, I think maybe what you are doing wrong is connecting to the +12v pin instead of the gnd pin. That's assuming that you are trying to detect a contact closure.
Example:
This example is for a PCS2 which is connected to IO 3 and uses waits and cancel waits to eliminate executing events until the PCS stabilizes from the initial AC current in rush when the TV is first turned which genereates an "ON", which then drops off enough to generate an "OFF" and final reaches an adequate level again which generates the "ON" state which it then maitains.
We added an external 12 DC source and now it works...
That was the problem. Our IO trigger didn't gave enough power.
Now I undestand we could do it by connecting it to the GND and not the +?
Ady.
How you hook it up depends on what you are trying to do. As the name implies, you can use the ports as either inputs or outputs. If you are using the port to detect a contact closure (for example. a relay output that is closing or a sensing switch attached to a door or "air wall" ), it is most common to monitor this by connecting the switch/relay to the IO port pin and gnd and using 'LOW'. When the "detector's" circuit is closed, you will detect a button push. When it is opened, you will detect a release. You can program this in two ways (at least). You can detect the change in IO port state as either a button event or a channel event. Or, for quick and dirty, you can just use the state of the IO port as if it were a parameter if it's controlled by a current or video sensor.
I believe that if you set the port 'HIGH' that it will be on if nothing is connected to it and that it will be turned off (a button release) if the port pin is connected to ground (either directly or by an external device like a switch or relay output).
As an output, the IO port can be used as a very light duty relay. When you turn the port on, it appears like a contact closure (a logic low). So, you can control another device that is looking for a logic low or you can control power to a device so long as it draws no more than 200 ma.