How detect an event from a external hardware

Hello:
I return to the forum with the continuation of the problem I had but now I am going more advanced.
I bought a new IoBoard to a new vendor that has an API (NuxIOAPI.DLL) and now I can already enter it in the application and send some controls to it (type releto, activate a port, etc).

Now the problem I have is the reverse: how to receive an IoBoard event.
The command that is required and that is in the documentation is as follows:
ValueEnteredEvent (object sender, ValueEnteredEventArgs, and)

Can anyone help me?

Thank you
Alberto Ferraz

  • Hi again:


    I just got some instructions on how to handle the event.
    One of the instructions I need to use is the following:

    _NuxIO.ValueEnteredEvent = new NuxIO.ValueEnteredEventHandler (OnValueEnteredEvent);

    I have tried different ways and I could not.

    Then to detect the event the statement is as follows:
    Private void OnValueEnteredEvent (object sender, ValueEnteredEventArgs e)
    {
    If (e.Type == 2) ListBox.Invoke ((MethodInvoker) () => listBox.Items.Add ("IP:" e.IPAddress "RS232:" e.Value)));
    If (e.Type == 3) ListBox.Invoke ((MethodInvoker) () => listBox.Items.Add ("IP:" e.IPAddress "I8 Activated")));
    If (e.Type == 4) ListBox.Invoke ((MethodInvoker) () => listBox.Items.Add ("IP:" e.IPAddress "I7 Activated")));
    }


    I'm waiting for some tips.

    Thanks
    Alberto Ferraz
  • Verified Answer

    Hello:

    I have already talked to the API / DLL programmer and what is really missing is setting the event so that when a procedure occurs it does.
    What is programmed and what you need to convert is the following:

    EVENT DEFINITION:
    _NuxIO.ValueEnteredEvent = new NuxIO.ValueEnteredEventHandler (OnValueEnteredEvent);

    PROCEDURE TO BE PERFORMED WHEN THE EVENT IS DETECTED:
    Private void OnValueEnteredEvent (object sender, ValueEnteredEventArgs e)
    {
    If (e.Type == 2) ListBox.Invoke ((MethodInvoker)) => listBox.Items.Add ("IP:" e.IPAddress "RS232:" e.Value)));
    If (e.Type == 3) ListBox.Invoke ((MethodInvoker)) => listBox.Items.Add ("IP:" e.IPAddress "I8 Activated")));
    If (e.Type == 4) ListBox.Invoke ((MethodInvoker)) => listBox.Items.Add ("IP:" e.IPAddress "I7 Activated")));
    }

    So I think I do not have much time to complete the process.
    I look forward to your help.