04-25-2012 09:21 PM
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
04-26-2012 06:16 AM - edited 04-26-2012 06:17 AM
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.