NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass a constant, #define or enum values from CVI dll to teststand

Please provide me the procedure to pass a constant or #define'd or enum values to teststand. Consider, there is a function written in C which accepts a variable as a parameter. The CVI dll is used as a module for the step. My requirement in teststand is to get all the possible values for that variable in teststand as a drop down box to select the value.

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

Hi Vicky,

 

You can configure your code module in CVI so that the enum is populated in your call step by creating a fp file for your data.  This process is explained in detail in the following article:

 

TestStand and LabWindows/CVI Enumeration Data Types

 

The second link in this article provides a CVI example demonstrating this.  Let me know if there is anything else I can do to help!

Al B.
Staff Software Engineer - TestStand
CTA/CLD
0 Kudos
Message 2 of 7
(4,889 Views)

Hi Ballington,

 

Thanks for your reply,

 

i have tried with the enums and it works. thats great!

 

The enum acts as a container that can be passed from code module to the teststand. My problem is to get the constant variables and #define's in teststand.I want these varaibles as a drop down list for a parameter in "Value expression" column of step settings as the same way as the enum is being passed. pls help with this.

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

Hi Vicky,

 

Glad to hear the enum method is working!  Unfortunately, TestStand cannot read the #define values directly since they are not a part of the function prototype, so we will have to stick with the current enum method in order to populate the Value Expression field with enum items.

Al B.
Staff Software Engineer - TestStand
CTA/CLD
0 Kudos
Message 4 of 7
(4,869 Views)

Hi AI B,

  I am test stand user and I had a problem I would like to ask you.

    I had enum type in C CVI dll and I use FP to interfere with test stand by drop down box select in test stand. After I select value in test stand, I got wrong index in test stand. EX: I define enum type is A .. D (index 0 .. 3) and I chose C (index 2) but I got other than 2. Do you know what wrong about that and how I fix this problem. Thanks for you help.

 

 

Binh T Pham

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

Please show me your new link because I can not load from this link. Thanks

0 Kudos
Message 6 of 7
(3,671 Views)

I've been working on implementing the guide you shared, but I'm having some difficulties and was hoping to get some guidance.

The guide suggests adding inputs and outputs to match the "function", but I'm a bit puzzled about how this applies to an enum.
Can you provide some clarification on how enums can have inputs or outputs?

Also, would it be possible for you to share a screenshot or a step-by-step breakdown of what went into the example? I'm aiming to replicate the example as closely as possible, but despite my efforts (and those of my co-workers), we haven't been successful.

I appreciate any insights or visual aids you can offer to help us better understand and implement the guide effectively.

Thanks for your time and assistance.

Best regards

 

0 Kudos
Message 7 of 7
(1,203 Views)