01-26-2009 08:20 AM
Hi,
I am trying to read from txt file some frequency values. but it counts that as a sum of character. for example; 1500000 in the txt file is read to be 7. what can I do? I attached my vi file and txt file. Thank you ver much.
Solved! Go to Solution.
01-26-2009 09:44 AM
02-03-2009 04:01 AM
Hi again,
I am so sorry. My programming is bad as well as my english. I can not understand so clearly. I wired Read From Spreadsheet to Index Array. It reads only first value from txt (or xls) file. I couldn't connect in a "for loop" or a "while loop". so it doesn't read the other rows. I added the VI file. how can I make read the all rows automatically. thanks again...
02-03-2009 09:37 AM
I don't see where you have tried to do anything.
Here's the simple modification I was talking about. I also changed the Write to Spreadsheet so that it would not create a new file each time.
Loops and arrays are fundamental concepts in any language. I would suggest you spend some time with the free tutorials.
02-04-2009 09:01 AM
Thanks Dennis for all of your advice. I read that site carefully. But you know that my English is not so perfect. I successed to use Read From Spreadsheet. But I can not use Write To Spreadsheet function same time. I think I am right way and I think I will stop to disturb you any more, soon. I added the revised file again. please, tell me where my mistake is, and how I can correct this problem. Thanks a lot again. good luck
02-04-2009 09:24 AM
02-09-2009 12:47 AM
Hi,
Thank you for every thing. The vi file you added works fast. but some values of frequency have being repeated and some of those have not being read. I added the vi file, read.txt and write.txt. Please compare read and write files (the third column in the write file). both read.txt and write.txt have 57 values. I think the program is too fast to read the response. what can I do to solve this situation. thanks again. good luck.
02-09-2009 09:34 AM
02-09-2009 10:03 AM
Hi,
Denis is right there is no problem of reading now (just look what you are reading and you will see there is no error). Just put some Probe to see what are you reading from your instruments and if what you obtain after your String to Fract/EXP is good or not (certainly not ). Use probe or put indicators to see if you receive good answer from instruments and if your conversion is good or not.
Why the program will be to fast if you wait for RQS ?
Regards
02-11-2009 09:02 AM
It works better in average mode. The program have measuring twice some frequency inputs in this sitution, rarely. Measurement doesn't carry out when I was remove '%' at the first command string.Likewise there are some problem when I was remove/change 'FR%.4fEN' and/or 'OL%.3fEN'. Additionally, always there is last result of measurement or zero at first line in new measurement, in spite of I reset instrument and computer manually or I added GPIB CLR function to program as a first command. I added some probes and indicators but the same problem have going on.
I attached the last states of program and read-write files.
Thank you so much for meritorious help.