LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

In CVI 6.0 Can I Add to the a Control's Data Types

Hi,
 
In the Edit Input Control dialog, is it possible to expand on the Data Type's defined for this control?
 
Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 1 of 3
(2,911 Views)

HI Ray,

  I assume that you're refering to the .fp file when you're talking about setting the input control's data type?

If so, then from the cvi 7.1 (I don't have 6.0 installed here but the principle should still hold if my memory is correct) help file under Instrument Driver Fundamentals : Data Types

You must specify a data type for each parameter in each instrument driver function. All data types the instrument driver uses must be intrinsic C data types or data types that you define in the .h file and list in the .fp file. Specify the data type of a parameter when you create its corresponding control on a function panel. This data type also must be consistent with the function prototypes in the instrument driver header file.

LabWindows/CVI uses the data type information to implement the variable declaration and run-time checking capabilities when users operate function panels. When you declare a variable from a function panel, LabWindows/CVI presents options based on the data type you specify for the function panel control. When you run a function from a function panel, LabWindows/CVI verifies that the data type of the value you enter in the control matches the prototype of the function.

Data types are divided into three classes: predefined data types, user-defined data types, and VISA data types.

For example, again from the cvi 7.1 help file

Creating a User-Defined Data Type

Complete the following steps to create a user-defined data type for use in a function panel.

  1. Define the data type with a typedef statement in the instrument driver header file.

    Using the previous example of the waveform_var data type, include the following code in the include file for the instrument driver.

    typedef struct {
    double waveform_arr [500];
    float t_zero;
    float t_delta;
    } waveform_var;
  2. Add the data type to the instrument driver function panel file using the Options»Data Types command in the Function Panel Editor. (must have the actual function panel for the function itself open to get this in the menu system)

    Make the waveform_var data type available in the function panel file. Select Options»Data Types in the Function Panel Editor and enter waveform_var in the Type box of the Edit Data Type List dialog box. Click Add.

Now you can select the waveform_var data type when you create function panel controls for this instrument driver. Also, users can interactively declare a variable of waveform_var data type from any function panel control that you define as waveform_var.

Hope that helps

If the options aren't there in cvi 6, then please let me know, and I'll get it installed to try it out.

Thanks

Sacha Emery
National Instruments (UK)

// it takes almost no time to rate an answer Smiley Wink
Message 2 of 3
(2,880 Views)

Sacha,

Thanks for the help.

I am using CVI 6.0 and your notes were a great help.

All sorted.

Regards

Ray FarmerSmiley HappySmiley HappySmiley Happy

 

Regards
Ray Farmer
0 Kudos
Message 3 of 3
(2,857 Views)