LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I save do a Savepanel to a file that is formatted in ascii?

I would like to be able to do the equivalent of a SavePanelState, but have the variable/values be saved in an ascii file so they are readable outside of CVI.

 

Can this be done?

 

Thanks,
Carl

 

0 Kudos
Message 1 of 3
(2,703 Views)

There isn't a built-in function thatfo so that I know of, but you could create an automatic function that:

 

  1. Takes a panel handle as a parameter
  2. Iterates on all controls in a panel from GetPanelAttribute (..., ATTR_PANEL_FIRST_CTRL, &ctrlID); until GetCtrlAttribute (..., ctrlID, ATTR_NEXT_CTRL, &ctrlID); return ctrlID = 0
  3. Skips unneded controls (decorations, splitter, pictures and so on
  4. Retrieves the control type (whether string or numeric and which type) and its value in a proper variable
  5. Saves to a file the control ID and its value, and optionally the control constant name

I have done some similar operation some time ago and it's not difficult but implies some effort in determinig which control to operate on and how.

 

 

(Note: part of the site is down on maintenance now so that lines of code can be wrong but the basic concepts can drive you to the correct attributes to use)



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 3
(2,702 Views)

My personal approach is to use the inifile instrument driver for reading and writing .ini style files. It's very flexible at the price that every value requires its own function call.

0 Kudos
Message 3 of 3
(2,696 Views)