Attach event problem
Posted: Thu Aug 16, 2018 2:33 am
Hi,
I experienced some problem using the Attach Event Handler on my c# app.
When I defined the Attach Event subscription, the callback event method 'onAttachedHandler' work correctly but the channel ch0 don't want to open, a Phidget timeout exception is raised:
Phidget22.PhidgetException: PhidgetException 0x00000003 ( Timed Out)
If I remove the Attach Event subscription, the channel ch0 start to open correctly.
Someone could take a look?
I experienced some problem using the Attach Event Handler on my c# app.
When I defined the Attach Event subscription, the callback event method 'onAttachedHandler' work correctly but the channel ch0 don't want to open, a Phidget timeout exception is raised:
Phidget22.PhidgetException: PhidgetException 0x00000003 ( Timed Out)
If I remove the Attach Event subscription, the channel ch0 start to open correctly.
Code: Select all
using Phidget22;
using Phidget22.Events;
namespace HubTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
VoltageRatioInput ch0 = new VoltageRatioInput();
ch0.Channel = 0;
ch0.Attach += onAttachHandler; //without subscription ch0 will open fine
try
{
ch0.Open(500);
status.Text = ch0.ChannelClass.ToString();
}
catch (PhidgetException ex)
{
status.Text = "Stato:" + ex;
}
}
void onAttachHandler(object sender, Phidget22.Events.AttachEventArgs e)
{
status.ForeColor = System.Drawing.Color.Green;
}
}
}