LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ouvrir un fichier .va et envoiyer sa contenue via un port serie rs232

Salut, comment parcourir un fichier .var (ou .txt) (ensemble des données séparées par un ' ] ') et envoyer ses données (donnée du position 34) via un port serie RS232 ? merci

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

Hello, this question covers 2 different arguments for which I can give some hint. I'm afraid I'm not able to answer in french.

 

Step 1: read a text file and parse element by element. This can be done by using either standsrd C commands (fopen, frad, fclose) or by using CVI Formatting and I/O Library commands (OpenFile, ReadFile, CloseFile). In either case, unless the file is huge you can probably read int entirely in memory and proceed next to parsing the resulting string

 

Step 2: parsing the file and sending through serial. You can proceed by steps using strtok command. After each token is found you can transmit it over the RS232 with ComWrt command (prerequisite is to open the port with OpenComConfig at the beginning of the process and close it at the end with CloseCom)

 

All functions used are well documented and there are several examples that show how they can be used. I suggest you read the online help for each of then: inside the help you will find links to sample programs that demonstrate each command usage.

 

 

Last hint: if you are not familiar with the English language you can repost this question in the french board.



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 2
(2,703 Views)