LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

using attribute as pointer to IviRangeTable

Hello,

 

I have an instrument with two types of sensors, with different characteristics. I would like to have two range tables, say:

 

static IviRangeTableEntry sensor1_frequency_tableEntries[] =
 {
  {500e+6, 6e+9, 0, "FREQ", 0},
  {IVI_RANGE_TABLE_LAST_ENTRY}
 };

static IviRangeTable frequency_table =
 {
  IVI_VAL_RANGED,
        VI_TRUE,
        VI_TRUE,
        VI_NULL,
        sensor1_frequency_tableEntries,
 }; 

 

and

 

static IviRangeTableEntry sensor2_frequency_tableEntries[] =
 {
  {500e+6, 18e+9, 0, "FREQ", 0},
  {IVI_RANGE_TABLE_LAST_ENTRY}
 };

static IviRangeTable frequency_table =
 {
  IVI_VAL_RANGED,
        VI_TRUE,
        VI_TRUE,
        VI_NULL,
        sensor2_frequency_tableEntries,
 }; 

 

Then when I initiate my IVI-driver I check what sensor is attached to the instrument. Now, to my question. I would like to set an attribute to point to the current range table. Something like this:

 

switch (type)
     {
     case 1:
     
      checkErr ( Ivi_SetAttributeViInt32(vi, VI_NULL, BT4500B_ATTR_FrequencyRangePointer, VI_NULL, &sensor1_frequency_table));
       break;
      
     case 2:
      checkErr ( Ivi_SetAttributeViInt32(vi, VI_NULL, BT4500B_ATTR_FrequencyRangePointer, VI_NULL, &sensor2_frequency_table));
      break;
    

    default:
                  
      break;
     }

 

Does anyone know what (if any) type of attribute I have to use? Or any other ideas?

 

Thanks in advance

 

Fred Niemelä

System Engineer

Saab Aerotech

0 Kudos
Message 1 of 2
(2,900 Views)

Hi,

 

What type of instrument do you have?  You can check the different specifications on the IVI Foundation website.

0 Kudos
Message 2 of 2
(2,883 Views)