NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

is there a max number of parameters that can be passed to a C function in test stand v. 1.0.1

I have had an issue with test stand version 1.0.1 (yes, I know; it's quite old) and calling a C function thru an action step. when I call this function with 18 parameters, it seems to hang. I have called a function with 16 and it seems to work. Is this a limit of the software? I am calling the function from a windows DLL that we've created. When I try to pull the function from the dll into test stand I also get a { error...but I get that in the other function's call and it seems to work fine. Any ideas?

0 Kudos
Message 1 of 7
(3,634 Views)

Hi Chris,

 

I apologize but I'm having a bit of trouble understanding your question.  It sounds like you are trying to call a C function from TestStand and you are wondering if the number of parameters (18) is causing an error you are seeing?  I assume that this function is part of a .dll.  It sounds like the windows DLL you mention is where this function resides.  I'm unsure what you mean when you say that you get a "{ error..." when you try to pull the function into TestStand but you get that same error in the other function's call.  What other function's call?  This works even though it causes an error?  Please explain the problem in a little bit more detail and I'll do my best help.  Thanks!

 

Cheers,

0 Kudos
Message 2 of 7
(3,606 Views)

ok, upon re-reading what I posted I can clearly see your confusion. haha. I think there are two separate issues.

 

1) Are there a maximum number of parameters one can use when calling a C function from a DLL? Yes, i'm trying to call a C function from test stand.

 

2) when I select the "module" tab, and select which DLL contains my function, the prototype has no information associated with it (by clicking the reload prototype button). I'm not sure why, as I'm using a declspec to send the function information out of the dll, but that's another topic. So I click on the source file tab and point the window to the .cpp of my function (within the DLL's project workspace) and when it begins to parse the file, I get an error about mis-matched curly brackets and if I wish to continue, and skip the rest of the parsing.

 

I click "OK" and when I go back to the module tab, I am able to see all my functions, along with the parameters in the drop down menu below. I fill in all the parameters and everything looks ok; no syntax errors, or anything else seemingly suspicious. I then run my test stand code and when I get to the step which calls this function, the system hangs and cannot proceed.

 

Any thoughts as to what might cause these issues? 

0 Kudos
Message 3 of 7
(3,597 Views)

Hi Chris,

 

As for your first question, I haven't been able to find any more information about a max number of parameters in TestStand 1.0.1.  If you have access to the source code, you could always pass a group of parameters as a struct.

 

The second issue you mentioned sounds very unusual.  Perhaps you could calling a very simple .cpp file with a function that simply adds two numbers and see if this works.  This would help isolate the problem.

 

Cheers, 

 

 

0 Kudos
Message 4 of 7
(3,562 Views)

I realize this thread is fairly old, but I'm having the same problem as #2 with TestStand 4.2.1 calling a dll created in CVI 9.0.  One of the other symptoms is the error message (Step.Result.Error.Msg) is not getting displayed by TestStand when a runtime error occurs.  When this happens, I get the error popup window with the proper error code, but it always says "No Details Provided".  I have stepped through the code to force an error and can see everything getting copied into my error message string, but TestStand does not display it.  Any ideas?


@chrispiccirillo wrote:

I have had an issue with test stand version 1.0.1 (yes, I know; it's quite old) and calling a C function thru an action step. when I call this function with 18 parameters, it seems to hang. I have called a function with 16 and it seems to work. Is this a limit of the software? I am calling the function from a windows DLL that we've created. When I try to pull the function from the dll into test stand I also get a { error...but I get that in the other function's call and it seems to work fine. Any ideas?


 

0 Kudos
Message 5 of 7
(3,050 Views)

Make sure your prototype specified in teststand matches the one in your dll exactly. In order for teststand to display an error message in Step.Result.Error.Msg, you also need to set Step.Result.Error.Occurred to true.

 

-Doug

0 Kudos
Message 6 of 7
(3,039 Views)

@dug9000 wrote:

Make sure your prototype specified in teststand matches the one in your dll exactly. In order for teststand to display an error message in Step.Result.Error.Msg, you also need to set Step.Result.Error.Occurred to true.

 

-Doug


Doug -that turned out to be the problem.  Step.Result.Error.Occurred was getting set, but Teststand would not load the prototype correctly.  My ErrMsg and ReporText variables were swapped.  Clicking "Reload Prototype" didn't work.  I had to select a different function in my dll, then re-select the correct function and only then would the prototype update.

0 Kudos
Message 7 of 7
(3,036 Views)