NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TSAPI Error -17808: Wrong Number of Positional Parameters

I am trying to determine some more details as to why I am receiving this error. The error is generated whenever I try to access any method from the TSAPI.

I am passing the sequence context into a COM Automation Server, and if I attempt to call a method, then this error is generated. Accessing properties seems to work fine.

Can someone provide more details regarding this error. I have searched through the documentation and the discussion forum but have not found anything explaining this.

Thanks in advance for any help.

Jeff
0 Kudos
Message 1 of 4
(3,452 Views)
From your screen shot I assumet that you are calling methods on the sequence context from within a VB generated Active-X server? What is the syntax and surrounding code for the failing method call? Are you accessing an array element?

Scott Richardson
Scott Richardson
https://testeract.com
0 Kudos
Message 2 of 4
(3,452 Views)
Scott,

Unfortunately it's a litte bit more involved than that.

I am trying to use test code written in a scripting language called Python.

Python has good support for COM on win32, and is able to implement COM Servers and Clients.

However, the one thing that Python doesn't do is use or generate a type library.

So, using your suggestion to a question I posted a day or two ago regarding accessing a COM Server that has no type library, I wrote a simple VB DLL wrapper around the COM Server that's implmented in Python.

On the surface, this seemed to work out ok. The next problem I encountered however was when I tried to call methods off of the sequence context.

I pass a reference to the sequence context all the way down to my Python COM Se
rver, and then try to call methods on that server.

Any method call results in Error -17808. It is very likely that this is a problem in Python, however, I was looking for some more details on this particular error to try and work towards a resolution.

At this point, I am about to fall back on writing a C++ ATL COM Server that wraps up the Python Interpreter and call my scripts that way. I was hoping that I could get the Python Server to work though, because it would give full access to the sequence context from Python, without having to write all the code to expose the context to Python via the C++ DLL.

So, there's the story. I could give you some code if your interested, I don't know if you're familar with Python at all. I've looked to the Python community for some help on this as well, but haven't made any progress on that front.

The only other piece of data that seems odd is that any access to a property, for example, SequenceContext.Id, seems to work fine.

Howeve
r, the following line of code produces the error:

#Python Code accessing Sequence Context.
context.SetValNumeric("Locals.MyParm", 0, 10.0)

Jeff
0 Kudos
Message 3 of 4
(3,452 Views)
Jeff -
I assume that you are calling SetValNumber not SetValNumeric. The error is occurring because the number of named parameters(optional) is zero, and the number of positional parameters(non-optional) passed is zero, and the first parameter could not be found. The prototype would expect 3 total.

When you say that properties work, just gets or also sets?

You may want to try this to see if this works:
context.AsPropertyObject().Locals.MyParam = 10.0

Scott Richardson
Scott Richardson
https://testeract.com
0 Kudos
Message 4 of 4
(3,452 Views)