05-02-2012 03:07 AM
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
Solved! Go to Solution.
05-02-2012 09:14 AM
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.
05-02-2012 09:34 AM - edited 05-02-2012 09:39 AM
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
05-02-2012 11:43 PM
Hi,
Thank you for your answer. Yes, relative path was a problem, when I cahnged to absolute, works fine.
Thank you.
best regards,
branar
05-03-2012 07:47 AM
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.
05-03-2012 08:00 AM
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.