News:

  • May 01, 2026, 11:41:41 AM

Login with username, password and session length

Author Topic: H4 ECOM Error Message  (Read 16704 times)

toruk

  • Newbie
  • *
  • Posts: 3
H4 ECOM Error Message
« on: January 13, 2015, 11:01:28 AM »
I had a perfectly performing program that communicates with the H4 ECOM via some programming I borrowed with the original owners permission.  Something has changed and I do not know how to handle the problem.  It is a Visual Basic program developed in Visual Studio to communicate with and record the status of a board wash system which has the H4 ECOM in it.  The command:

Rc = HEIQueryDevices(pTransportStructure, aDevices, DeviceCount, HEIAPIVersion)

Returns a code for RC =10022

Dim pTransportStructure As IntPtr   'pointer to HEITransport structure this structure will be located in the unmanaged heap

pTransportStructure = Marshal.AllocHGlobal(Marshal.SizeOf(TP))

DeviceCount = MAXDEVICES
MAXDEVICES = 100

HEIAPIVersion = 3

What does this error code mean?  Is there is list of response codes that I can have to add to my code in the case of errors or any other response than 0 which the code is looking for.

If Rc <> 0 Then
            DisplayList.Items.Add(String.Format("Error {0} trying to query network", Hex(Rc)))
        Else
            If DeviceCount = 1 Then
                DisplayList.Items.Add(String.Format("Found{0} device", Str(DeviceCount)))
            Else
                DisplayList.Items.Add(String.Format("Found{0} devices", Str(DeviceCount)))
            End If

            If DeviceCount > 0 Then

Your help in this matter is greatly appreciated.

Thank you,
Toruk

MikeS

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 261
    • Host Engineering, Inc.
Re: H4 ECOM Error Message
« Reply #1 on: January 13, 2015, 01:29:23 PM »
Errors in the 10000 range are Winsock errors - you can find them listed in Winsock.h.

10022 = Invalid Argument: Some invalid argument was supplied.

Since that is not one of our Ethernet SDK error codes I can't tell you for sure what actually is wrong, but that sounds to me like a generic response to a call that has a parameter that is empty, or null, or out of range, or contains some invalid text, etc.

What I can do, if you're interested, is provide you with the source code to the Ethernet SDK so that you can trace into the API calls and see where the problem really is located. To get the source code go to our main website (www.hosteng.com) and follow the link on the left side to "Request SDK Source".
Good design costs a lot. Bad design costs even more.

toruk

  • Newbie
  • *
  • Posts: 3
Re: H4 ECOM Error Message
« Reply #2 on: January 15, 2015, 11:45:41 AM »
MikeS, thank you for your reply and attempt to help.  The aDevices array was initialized for up to 100 devices and each element set to 0.  Device count is set to 100.  HEIAPIVersion is set to 3.  What argument is invalid?  None appear missing except for the array which was initialized as above, but has no values in the array and stepping through my code shows the array to be nothing more than an initialized array of 100 items set to 0 with nothing else written to it anywhere in my code.

I upgraded the program from a version on this PC to a new PC which has been up and running for over a year.  When I try the code from my office it works.  We are now investigating what might be blocking access to the H4.  These PC's can be in different OU's inside of AD.  My PC is in a different OU than the Shop Floor PC and perhaps it is restricting it's access.  One of my IT support Techs thinks it might be something called HIPS blocking it.  We are pursuing that aspect now.

Thank you for the pointer to the Winsock.h file.  I have copied all of the error codes and put them in Select Case statement for my error display.  Now my code will report the Error String for each code generated.

Toruk

toruk

  • Newbie
  • *
  • Posts: 3
Re: H4 ECOM Error Message
« Reply #3 on: January 16, 2015, 07:07:21 AM »
MikeS:

We figured out the problem.  It was caused by the HIPS restrictions placed on the PC.  It was blocking access to the H4 ECOM which caused an apparently erroneous error of 10022.  Once the restrictions were removed, it started working again.  One of our Engineers was able to figure out which rule was blocking it, it returned to normal functionality.  I did add the errors codes from the Winsock.h file for which I again thank you for pointing me too!

Toruk

MikeS

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 261
    • Host Engineering, Inc.
Re: H4 ECOM Error Message
« Reply #4 on: January 16, 2015, 08:17:17 AM »
awesome.
Good design costs a lot. Bad design costs even more.