LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

creer ,ouvrir , ecrire un fichier .txt sur CVI 2017

bonjour,

comment je peux creer un fichier et envoyer des informations qui sont deja dans le buffer ?

merci d'avance 

0 Kudos
Message 1 of 10
(3,231 Views)

You can write to files either using CVI Formatting and I/O Library functions (OpenFile, WriteFile, WriteLine, CloseFile) or the equivalent standard functions from the ANSI C library (fopen, fputs, fclose); each library offers additions functions for specific tasks.

The CVI library is a bit more user fiendly but is not portable if you intend to reuse your code in a compiler different from the CVI one.



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 10
(3,222 Views)

ces fonctions permet d'ouvrir ou d'écrire dans un fichier mais comment je peux creer un fichier txt ?

0 Kudos
Message 3 of 10
(3,216 Views)

je veux que le fichier soit cree dans un dossier particulié

0 Kudos
Message 4 of 10
(3,213 Views)

@chayma  ha scritto:

ces fonctions permet d'ouvrir ou d'écrire dans un fichier mais comment je peux creer un fichier txt ?


There is really nothing different between a .txt file and other files with regard to handling: you open, write and close them with the usual commands, appropriately defining the specific attributes for that file type (pass VAL_ASCII to OpenFile command or select one of the available file types in fopen: "w", "a" or other).



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 5 of 10
(3,202 Views)

@chayma  ha scritto:

je veux que le fichier soit cree dans un dossier particulié


You can use FileSelectPopup or FileSelectPopupEx to let the user choose a destination for the file to be created: the commands will return the full pathname to pass to openFile or fopen.

Alternatively you can use MakePathname to generate the pathname of the file to be created.



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 6 of 10
(3,201 Views)

As a last suggestion, it is preferable that in this international board you use the English language. Users of this board usually do not speak French (neither do I) and relying on automatic translators could lead to misunderstanding and errors.

If you do not speak English, French boards exist where you can post in your native language.



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 7 of 10
(3,198 Views)

thanks

can you give me an exemple for using FileSelectPopupEx or FileSelectPopup ?

0 Kudos
Message 8 of 10
(3,192 Views)

Hello chayma,

normally I would suggest you to search in the example finder (Help >> Find examples... menu function), but it returns no results for those functions.

 

As an alternative, more direct way of getting help, you can do this: write down the command you want to investigate and press Ctrl+P (or right-click on the command and select Recall function panel, which is the same): the function panel window will open with the required parameters for the selected command (you can right-click on each of the parameters exposed to look at the help for it). Now right-click on a empty area of the function panel window and you will get the help for the whole function: if any example exists that makes use of it, it will be listed at the bottom of that window, with a button that will open a new CVI instance with the suggested project. In your case, FileSelectPopupEx help will list 7 examples for yo to study.

 

You can use this method to look for examples on a specific CVI function.



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 9 of 10
(3,183 Views)

ok thanks ^^

0 Kudos
Message 10 of 10
(3,166 Views)