LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

comment récupérer les données d'un graph dans un tableau labwindows/cvi

bonjour,
 
j'ai fait une interface sous labwindows/CVI pour commander l'analyseur de spectre r&s fsh3, ensuite j'ai essayé de récuperer les données tracées sur le graph dans un fichier, pour un traitement ultérieur, voilà les lignes de programme que j'ai ajouté à l'interieur du callback du bouton sauver que j'ai ajouté à mon interface:
 
FileSelectPopup(prj_dir,"*.txt","","",VAL_SAVE_BUTTON,0,0,1,0,fichier);
status=OpenFile (fichier, VAL_WRITE_ONLY, VAL_TRUNCATE, VAL_ASCII);
FmFile(status,"%s<%*f[w10]",i,buffer);
CloseFile(status);
 
mon probléme est que quand j'ouvre le fichier ainsi enregistré, il ya rien dedant.
je pense que je dois d'abord récupérer les données tracées sur le graph dans un fichier et aprés faire le transfert array to graph.
 
veuillez m'indiquez la librairie qui me permet de faire ce transfert car j'ai cherché mais j'ai rien trouvé
 
merci d'avance
0 Kudos
Message 1 of 4
(4,022 Views)

Supposing my rudimentary comprehension of french language has not driven me oot of path Smiley Indifferent, you are concerned about retrieving data from a graph in order to store them on disk. You have a couple of attributes that can help you in this task, first of all the undocumented attribute that LuisG has described in this thread that gives you the actual number of plots in the graph. After you know this number, you can iterate on plots retrieving X and Y arrays using GetPlotAttribute function with the following attributes:

  • ATTR_NUM_POINTS to determine the dimension of the array where to store data (in case you don't know the type of data you can use ATTR_PLOT_XDATA_TYPE and ATTR_PLOT_XDATA_SIZE to determine the actual number of elements the array for X data has; similar attributes exist for Y axis)
  • ATTR_PLOT_XDATA and ATTR_PLOT_YDATA to retrieve the data

As explained by Luis, you cannot simply iterate from 1 to # of plots in case you have deleted some plot from your graph: plot handles are not reused so you may be missing some plots. Instead, you must place a loop with handles from 1 on and skip the handles that return an error, exiting the loop after you have counted and retrieved the correct number of plots.

I am attaching a small example that can help you.

 

Finally, in case you prefere to continue in french, you can access the french board.



Message Edited by Roberto Bozzolo on 03-26-2008 09:59 AM


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?
Message 2 of 4
(3,992 Views)

bonjour,

ok merci bien pour la réponse

0 Kudos
Message 3 of 4
(3,979 Views)
You're welcome!


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 4 of 4
(3,969 Views)