Hello,
I built a simple program in C# for "PhidgetInterfaceKit 0/0/4" (4 relays module).
GUI with 4 buttons, that every button changes the state of its relay number.
Every time the button clicked it use function of Relay.RelaySwitch(x);
When x is the relay number and Relay is a Class that have 4 instances of DigitalOutput (one for every channel)
DigitalOutput ch0 = new DigitalOutput();
DigitalOutput ch1 = new DigitalOutput();
DigitalOutput ch2 = new DigitalOutput();
DigitalOutput ch3 = new DigitalOutput();
and RelaySwitch() method is:
Public void RelaySwitch(DigitalOutput relayNum)
{
try
{
if (relayNum.State)
relayNum.State = false;
else
relayNum.State = true;
}
catch (PhidgetException ex)
{
Console.WriteLine(ex);
}
}
Everything works fine if I switch the same relay.
But when I'm switching fast few relays, the OS(Operational System) freezes until I get "PhidgetException 0x34"(Device not Attached)
Got any advice about what should I do, so the app won't crush?
Thank you.