NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to define void* pData in TestStand?

Hi,

 

I'm writing a step in TS using the Flexible DLL interface.  One of the parameters of the function I'm intending to access is void* pData.

 

My question is how to define a TS parameter to match the dll parameter.  The value I need to pass, by the way, is NULL.

 

Thanks

Rafi

0 Kudos
Message 1 of 7
(4,015 Views)

Hi,

 

I think you can use "Nothing" (without quote)

it is a reference to a void object

 

a2 

0 Kudos
Message 2 of 7
(4,014 Views)

Hi A2 and thanks for the prompt answer,

 

I don;t understand where to write "nothing".. 

 

When using a Flexible DLL interface, you list your parameters in TS window called 'Edit c/c++ DLL'.  For each parameter used, there is on the right side the definitions for that parameter.  The first thing to define after the name, is, 'Category' which followed by 'Type' and than 'Pass'.

 

My question is how define *void in TS.  what is the Category?  What is the Type? And what is the Pass?

 

thanks again,

Rafi

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

Hi,

 

Sorry for my uncomplete response

 

Name : pData 

Category : Object

Type : ActiveX Automation IDispatch Pointer

Pass : By Value

 

Value : Nothing (and not NULL) 

 

I'm not sure for all these values, I think category must be object, but not for type and pass 

 

a2 

 

 

0 Kudos
Message 4 of 7
(4,004 Views)

TestStand does not currently support void pointer parameters. However, if all you want to do is to pass a NULL pointer you can workaround the limitation by creating a Numeric pointer parameter and pass the value Nothing. Make sure Pass is set to By Pointer.

 

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

Old topic but I have always the same problem today:

 

I have a function in a DLL with "Flexible parameter".

void DLLEXPORT MyFunction (void *pvParam)
{
char *pcFilename = NULL;
pcFilename = (char *) pvParam;
// Some code to use pcFilename  
// ...

I want to call this function in teststand, passing a string in parameter pvParam

 

I assign object reference variable with a string variable to avoid validation type error in seqEdit:

OPR31_3-1687272736554.png

 

I have tried to set a variable object reference  and pass it as a pointer 

 

OPR31_0-1687272456891.png

OPR31_1-1687272499635.png

but I have this runtime error at execution:

OPR31_2-1687272582832.png

 

 

I have tried a lot of other variable category without success (Category Object, , IDispatch... but there is an error detected at analysis)

 

Someone has an idea / a method to solve this kind of problem?

Thank you.

0 Kudos
Message 6 of 7
(624 Views)

up

0 Kudos
Message 7 of 7
(532 Views)