Accessing Phidget objects leads to "Device not attached" error in a Multiform C# Application
Posted: Sun Mar 31, 2019 7:09 am
Hi,
I have 1019_1 Phidget I/O board and I have written a C# program to interface with this board. My Application makes use of 2 Digital Outputs and 1 Digital Input. It is a multiform Application meaning I hide and move to new forms regularly. There is one main Form from which I move to many child forms. I have defined and attached my I/O in the main form and will be using it in a child form. However, As soon as my main form closes, the device gets detached and then attached again after some time. Sometimes it just remains detached and the detached method is not even called. This causes a "device not attached" error. So my question is - what is the right way to attach a device and keep it attached until I close or exit the application? Please do let me know if you need more information. Thanks in advance for the help.
Regards,
Faizan.
I have 1019_1 Phidget I/O board and I have written a C# program to interface with this board. My Application makes use of 2 Digital Outputs and 1 Digital Input. It is a multiform Application meaning I hide and move to new forms regularly. There is one main Form from which I move to many child forms. I have defined and attached my I/O in the main form and will be using it in a child form. However, As soon as my main form closes, the device gets detached and then attached again after some time. Sometimes it just remains detached and the detached method is not even called. This causes a "device not attached" error. So my question is - what is the right way to attach a device and keep it attached until I close or exit the application? Please do let me know if you need more information. Thanks in advance for the help.
Regards,
Faizan.