Okay, I have finally mocked something up in C to test the behaviour. Unfortunately, the results are inconclusive.
The program (less some repeating stuff):
Code: Select all
#include <stdlib.h>
#include <stdio.h>
#include "phidget22.h"
int main(int argc, char *argv[]) {
PhidgetReturnCode res;
const char *errorString;
PhidgetDigitalOutputHandle ch;
Phidget_DeviceID deviceID;
int state;
double dutyCycle;
double minDutyCycle;
double maxDutyCycle;
PhidgetDigitalOutput_create(&ch);
printf("Query based on Serial %d ...\n", atoi(argv[1]));
res = Phidget_setDeviceSerialNumber((PhidgetHandle)ch, atoi(argv[1]));
printf("Query based on Channel %d ...\n", atoi(argv[2]));
res = Phidget_setChannel((PhidgetHandle)ch, atoi(argv[2]));
printf("Open and Attach ...\n");
res = Phidget_openWaitForAttachment((PhidgetHandle)ch, 5000);
printf("Query for State ...\n");
// Show state and duty info...
res = PhidgetDigitalOutput_getState(ch, &state);
PhidgetDigitalOutput_getDutyCycle(ch, &dutyCycle);
PhidgetDigitalOutput_getMinDutyCycle(ch, &minDutyCycle);
PhidgetDigitalOutput_getMaxDutyCycle(ch, &maxDutyCycle);
printf("State: %d \n", state);
printf("Duty Cycle Value/Min/Max: %4.2f/%4.2f/%4.2f \n", dutyCycle, minDutyCycle, maxDutyCycle);
PhidgetDigitalOutput_setState(ch, 1); // Or setDutyCycle ... didn't seem to matter
// Repeat state and duty info
res = usleep(2500000); // Am aware of the warning this causes
// Repeat state and duty info
PhidgetDigitalOutput_setDutyCycle(ch, 0); // Or setState ... didn't seem to matter
// Repeat state and duty info
PhidgetDigitalOutput_delete(&ch);
return 0;
}
This results in an output of (generally - the 0/16/16 has a serial of 72253 and the current slots used are 3, 4, 5, 6, and 15):
Code: Select all
joel@phinet:~/Build $ sudo ./example 72253 3
Query based on Serial 72253 ...
Query based on Channel 3 ...
Open and Attach ...
Query for State ...
State: 0
Message: Success (0x00)
Message: Success (0x00)
Message: Success (0x00)
Duty Cycle Value/Min/Max: 0.00/0.00/1.00
Message: Success (0x00)
Message: Success (0x00)
Message: Success (0x00)
Message: Success (0x00)
State: 1
Duty Cycle Value/Min/Max: 1.00/0.00/1.00
Message: Success (0x00)
Message: Success (0x00)
Message: Success (0x00)
Message: Success (0x00)
State: 1
Duty Cycle Value/Min/Max: 1.00/0.00/1.00
Message: Success (0x00)
Message: Success (0x00)
Message: Success (0x00)
Message: Success (0x00)
Message: Success (0x00)
State: 0
Duty Cycle Value/Min/Max: 0.00/0.00/1.00
joel@phinet:~/Build $
This output is rather intended, since for when the states are checked, the values are high for when they are set high (0, 1, 1, 0).
However this seems to be the case only half the time. A third of the time, the output looks more like the high state is lost before sleep (0, 1, 0, 0), and the remaining sixth leaves the high state on after the set low (0, 1, 1, 1) - granted that value has yet to result in being set high when the program relaunches.
This does not seem to affect the ports I choose in the second parameter (aside from attach timeouts if I am not between 0 and 15, understandably). The most important note of all this however is that setting the state high momentarily for a port used by one of the fobs does not affect them. It makes me wonder if the fobs are seeing the circuits as closed regardless of what the state/dutycycle is set to.
Is this a useful addition to the issue?
EDIT: Ugh, by looking over
https://www.phidgets.com/docs/Open_Coll ... put_Primer I may have realized my issue. For example with the output to doorbell (that fob is a HeathZenith SL-7393 or similar), it is independently powered by 12VDC with the former momentary switch (both sides) to the 0/16/16. The other fob operates with the same principle. Because they are independently powered, I should really check for continuity between the fob ground and each side of that switch (my previous assumption is that one side already does this). If there is none on either side, I will (likely) need to connect the DigitalOutput ground with the fob ground.