NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Function Call Module

Solved!
Go to solution
Spoiler
 

Hi All,

 

I was tried to find right answer form previous posts, but seems to be that anyone no reply to my needs, so my post is here:

I use external dll to select function from there. Function name was given in string, without parameters. Here is code:

tsErrChkMsgPopup( TS_StepGetModule (StepHandle, &errorInfo,&cviModule)); error = TS_CVIModuleAsCommonCModule (cviModule, &errorInfo, &commonCModule); error = TS_CommonCModuleSetModulePath (commonCModule, &errorInfo, "MTWF4P.dll"); error = TS_CVIModuleSetModuleType (commonCModule, &errorInfo, TSConst_CVIModuleType_DLL); error = TS_CommonCModuleSetSourceFilePath (commonCModule, &errorInfo, "MTW4P.dll"); error = TS_CommonCModuleSetFunctionName (commonCModule, &errorInfo,szRow); error = TS_ModuleLoadPrototype (commonCModule, &errorInfo, NULL, &removedfromCache);

When put function name, seems to be that seq. editor does not recognize parameters (missing all parameters, i.e.. testData and test Error). Suggestion was that need to be reload prototype (last row in code), but this was not help. (no error was appeared during debugging).

I use two objects (cviModule and commonCModule), because needed functions are not available to only one object.

Can anyone help me with this ?

 

best regards,

branar

 

 

0 Kudos
Message 1 of 6
(3,653 Views)
Solution
Accepted by topic author branar

Most likely the problem is that you didn't specify a full, absolute path to the DLL. Also, you don't need to set the SourceFilePath property. That property specifies the source file (.c) for the function and TestStand uses it for the Edit Code and Create Code features.

0 Kudos
Message 2 of 6
(3,647 Views)

Note, you can use a path relative to the sequence file rather than an absolute path if the sequence file is saved on disk first.

 

-Doug

0 Kudos
Message 3 of 6
(3,640 Views)

Hi,

 

Thank you for your answer. Yes, relative path was a problem, when I cahnged to absolute, works fine.

Thank you.

best regards,

branar

0 Kudos
Message 4 of 6
(3,620 Views)

As Doug mentioned you can use a path relative to one of the TestStand search directories. In general, relative paths are preferable because it makes it easier for you to change file locations and to deploy your test system.

0 Kudos
Message 5 of 6
(3,613 Views)

Hi,

For reason that search directories not need to be updated, I was used c:\Temp\ to avoid calling directly from bin\ (where dll is located)or some other directory. However, I will try to use relative path also. Thank you.

 

best regards,

branar

 

P.S. Can you check my another post http://forums.ni.com/t5/NI-TestStand/How-to-insert-step-to-given-position/m-p/1947263? Until now, there are no answers.

0 Kudos
Message 6 of 6
(3,609 Views)