From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Define variable with void data type.

Hi,
I would like to define a variable and a structure with void data type.
How could I define it?
 
regards.
0 Kudos
Message 1 of 7
(3,808 Views)
Hi Labview_Vish,
 
TestStand doesn't have any void data type defined. But what exactly are you using this for?
 
Hope to hear back
 
SijinK
National Instruments
0 Kudos
Message 2 of 7
(3,797 Views)
HI SijinK,
Thanks for the reply.
 
I want to call some "dll" in the TestStand. In this "dll", function requires some variable of void data type as input.
e.g.  dll - Test.dll
Function  - short int Func_a (void var_a, long var_b, void *var_c, custom_struc *var_d)
 
I want to call this function in the TestStand. Using "C/C++ Dll" adapter module and "Action" step type, I will call this dll and its function.
For passing values to this function, I need to define some variable with respective data type.
Please let me know how could I do this.
 
Regards.
0 Kudos
Message 3 of 7
(3,791 Views)

HI labview_vish,

You would have to pass the void and the void * parameters as integers from TestStand. This has worked for me before. Please let me know how things went when you tried this.

SijinK

National Instruments

 

0 Kudos
Message 4 of 7
(3,777 Views)
In C, the void* data type is used as a generic pointer to memory.  This is generally used for functions like malloc that have no way of knowing what the contents are of the memory you would like to use.  In order to correctly pass information to your DLL, you need to know more about the function you are calling.  This parameter could really refer to anything.  Is it supposed to be an input parameter or an output parameter or both?  Is it supposed to be a single value or an array of values?  Perhaps it's type is supposed to be specified by another parameter to the same function.  In any case you will need to edit the prototype directly in TestStand and give it the appropriate type for your application.

--Peter

0 Kudos
Message 5 of 7
(3,759 Views)
Thank you, Peter and SijinK.
Currently I can define the Void or Void* as interger and it work for me. But in future I might need to define as the specific datatype as mentioned by Peter.
 
 
0 Kudos
Message 6 of 7
(3,740 Views)

Hi,

 

Peter is right "In any case you will need to edit the prototype directly in TestStand and give it the appropriate type for your application". Also take a look at this KnowledgeBase

 

Kind regards

Heinz

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