NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

how to specify in TS unsigned long? unsigned short?

thank you very much both Dugh and Eric,
 
I got it and set it up. 
 
One additional thing is a parameter which I need to specify for the function in the dll  ....sizeOf (myStructure).  How can I write it (or find  out the value)  in TS?
 
Thanks
Rafi
0 Kudos
Message 11 of 14
(1,274 Views)
I don't think there's anyway to get TestStand to fill this in automatically (though that is perhaps a good feature suggestion). What I'd do is write a simple C program to print out the size (which depends on structure packing, data alignment, etc.) and then hard code that into my type.

Something like

printf("%d - my struct size", sizeof(mystruct));

should work to find out what the size is.

It should never need to change unless you change the struct so once you've made that the default value for your type, you should be good to go. One thing you might want to do is set the Shared flag on that field of the type too, that way all instances will automatically point to the original type's version of that field and if you change the struct and change the size field in the type, the field change will automatically be reflected in all existing instances.

-Doug
0 Kudos
Message 12 of 14
(1,253 Views)

Thanks Dough,

That's a good answer and educating as well....

In the meantime, I encounter another problem.  Look at this function : 

 int     DLL_EXPORT HTSetCommand(  int iType1,int iType2,int iType3,int iType4,void* pData,int iHub, int iSlot, int iPort);

I need to specify a NULL for pData.

How shall I do it in TestStand?  (this will be one of the parameters of the function)

           Name:  pData

           Category:   ???

           Type:   ????

           Pass:  ?????

 

Thanks

Rafi

0 Kudos
Message 13 of 14
(1,248 Views)
TestStand doesn't list void as parameter category, but because pointers on 32-bit systems are the same size as a long you can declare the parameter as a 32-bit integer and pass it by value. The only valid argument value in this case is 0.

0 Kudos
Message 14 of 14
(1,229 Views)