LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ring, attribute value

Solved!
Go to solution

I want to substitute the Label strings of the Ring (Label/Value Pairs) after starting the program with strings read from the Excel Spreadsheet or some text file. I know how to implement this part but I don't know how to set Label using attribute command. I found  command to set the Label of the ring but I want to modify Labels of Label/Value pairs so the user can modify them depending on the devices names:

 

Value        Label

1               Device1

2               Device2

3               Device3

 

Thank you for your help.

 

Leszek

0 Kudos
Message 1 of 4
(3,492 Views)
Solution
Accepted by topic author Leszek56

Hi,

 

have a look at InsertListItem (), ReplaceListItem () and DeleteListItem ().

 

Good luck,

 

Wolfgang

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

Wolfgang,

 

Thank you very much. It was pretty easy to implement, but it was not obvious for me to find the solution, because I was looking for atributes.

 

So I read the string from the Excel and I subsitute the default labels from Label/Value pair with the string read from Excel using "ReplaceListItem"

 

 error = ExcelRpt_GetCellValue  (rawDataWorkSheetHandle, "B2", ExRConst_dataString, &value_1);
  error = ExcelRpt_GetCellValue  (rawDataWorkSheetHandle, "B3", ExRConst_dataString, &value_2);  
  error = ExcelRpt_GetCellValue  (rawDataWorkSheetHandle, "B4", ExRConst_dataString, &value_3);  
  error = ExcelRpt_GetCellValue  (rawDataWorkSheetHandle, "B5", ExRConst_dataString, &value_4);  

 

  status = ReplaceListItem (AgilisInterfaceTabHandle, TAB_AGILIS_CHANNEL, 3, value_1, 0);    //Replace laser 1 name
  status = ReplaceListItem (AgilisInterfaceTabHandle, TAB_AGILIS_CHANNEL, 2, value_2, 1);    //Replace laser 2 name 
  status = ReplaceListItem (AgilisInterfaceTabHandle, TAB_AGILIS_CHANNEL, 1, value_3, 2);    //Replace laser 3 name  
  status = ReplaceListItem (AgilisInterfaceTabHandle, TAB_AGILIS_CHANNEL, 0, value_4, 3);  //Replace laser 4 ame  

 

Leszek

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

I am glad all went smoothly - a quantum of solace may be that e.g. tables, tabpanels etc. require even more search/experience: the more complex the control...Smiley Wink

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