NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

passing (pointers to) structures from TestStand to CVI

Hi !
 
I want to pass a (a pointer) a structure from TestStand to a CVI-dll. The function header was created by TestStand but still it gives error -17311. Please see the attachment. I'm afraid I'm missing something very simple...
0 Kudos
Message 1 of 4
(3,495 Views)

Hello Han,

 

It looks like you have done most of the work for passing a Struct as a parameter from TestStand to a DLL. I think you are missing just one thing.

 

Have you seen the KnowledgeBase document, “Calling Functions, in a C/C++ DLL, that have a C Struct as a Parameter from TestStand”? The second section describes how to set the properties of your custom data type to allow it to be passed as a C Struct. Once you set the properties, your function call should work properly.

 

Regards,

 

Eric

0 Kudos
Message 2 of 4
(3,477 Views)

Thank you for replying Eric.

In the attachments you can see I marked the member variables of the struct to be passed as a struct (???) But I have found the problem and as I feared it was very basic:

At the moment of defining/creating the struct (under 'Locals') I chose 'container' as type where I should have chosen 'types' - BaanTabRecTS, the very type I had created myself. When I re-created the variable sBTRts with type BaanTabRecTS the member variables of the struct where automatically shown and, this time, in darkish blue where when I had created the variable as a container they where light blue (hard to see in my attachments though).

 

0 Kudos
Message 3 of 4
(3,452 Views)

Hello Han,

It sounds like the function call working appropriately. In the sceenshots, I could not see that the Local had been created as a Container instead of a BaanTabRecTS. I assume that you would want to pass the members of the struct as the expected type and not as structs.

Eric

0 Kudos
Message 4 of 4
(3,436 Views)