Highlighted
Outstanding Contributor.
Outstanding Contributor.
762 views

How detect an event from a external hardware

Jump to solution

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

0 Likes
1 Solution

Accepted Solutions
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: How detect an event from a external hardware

Jump to solution
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.

View solution in original post

3 Replies
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: How detect an event from a external hardware

Jump to solution
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
0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: How detect an event from a external hardware

Jump to solution
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.

View solution in original post

Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: How detect an event from a external hardware

Jump to solution
Post closed
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.