954,541 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How can I determine the meanig of an error code?

I'm trying to use a DLL that I have used many times in other languages including C, Java, Perl, etc so I am pretty familiar with the library, but I didn't write it. It came from a comercial source.

I'm using ctyps to load the library as such:

from ctypes import *

piapi = windll.piapi32
findpoint = piapi.pipt_findpoint

findpoint
findpoint.restype = c_int
findpoint.argtypes = [c_char_p, c_int]

ptid = []
ptid.append(c_int())

retVal = c_int()

tag = create_string_buffer('\000' * 32)
ptid[0] = 0

tag.value = str(input("Enter a tag name:"))

retVal = piapi.pipt_findpoint(tag[0], ptid[0])


I have tried a number of different combinations on the arguments but all of them return a value of 2. The function should return 0 if successful, > 0 if the problem is with the data source and > 0 if the problem is a system problem.

So what system problem is "2"? Is there a listing of error codes to error messages in Python?

Thanks.

PS here's the header entry for the function: PIINT32 pipt_findpoint( char PIPTR *tagname, int32 PIPTR *pt );

DaveF0223
Newbie Poster
1 post since Apr 2009
Reputation Points: 10
Solved Threads: 0
 

If a call to the DLL returns '2' then that's not a Python error code, that's just what the DLL is returning. I'd suggest using the DLL in another language in the same way to see if you get the same error code.

jlm699
Veteran Poster
1,112 posts since Jul 2008
Reputation Points: 355
Solved Threads: 292
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You