LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write to text file

Hi!!!
 
I would to extract a program from an instrument. I know how to extract it into te buffer output but after I would like to save this program in a text file. However, my VI which have to save the program's intrument doesn't work....
 
If someone can help me....
 
 
Regards
0 Kudos
Message 1 of 9
(3,067 Views)
Hi diablo,

many problems:
1) In the moment you are writing the same text again and again into the file until you press the stop button...
2) As there is no wait statement in the loop you write as fast as possible - you're a cpu hogger!
3) As you don't use 'Set file position' you overwrite the file in every iteration!
4) As you don't use a shift register for the error cluster you will run into an error with every iteration again (if an error occurs)!
Look at the context help for the 'Write to text file' function - this will help you a lot!

This is a sketch of what to do:

Message Edited by GerdW on 04-26-2007 04:20 PM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 9
(3,056 Views)
Hi diablo,

point 4 is not correct - your loop will stop on an error - sorry. But I still prefer shift registers for error clusters!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 9
(3,042 Views)

I'm using labview 8.0

 

0 Kudos
Message 4 of 9
(3,042 Views)
Frankly, I have no idea why you are even using a while loop. Just save it once and be done with it.
 
I also have problems understanding your question. What is it that you want to save, "program's instrument" can mean anything. Do you want to save configuration settings? data?
 
"Doesn't work" also does not mean much without further details. Does it crash, generate an error (what is the error code), give incorrect results, etc.?
 
So, please be a bit more specific. It can also help if you attach the real program. 🙂
Message 5 of 9
(3,036 Views)
Hi,

yes, the loop isn't needed when you want to save just on answer.

When you want to save more than one answer of your device to the same file you will need the loop. But the it would be better to include to device communication in the loop - the string control in my example is just a representation for any kind of data source...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 9
(3,031 Views)
Hi altenbach !!!!!!!!!!!!!!
 
 
Actually, my instrument(FRA SOLARTRON 1250) have to be programmed with his special language. To enter programs we have to use a lot of buttons. That's why I would like to enter those programs thanks to labview and the gpib. So at the first I would like to read programs which are in the instrument and after rewrite them in the instrument.
 
Moreover, when I said it "doesn't work" it means that the document is empty after the application like I did nothing
 
Do you understand???

Message Edité par Szdiablo le 04-27-2007 02:11 AM

0 Kudos
Message 7 of 9
(3,014 Views)

Are you able to communicate with the instrument over GPIB using "Measurement Automation Explorer" (MAX)?

Is the VISA communication being logged?  Is that what your code (previous posts) is sending to the file?

How is the storage to the file being triggered?  What activates the storage?  Do you verify if there is actual data or an empty sting?

Sorry for the many questions...  Answering the above will shed a light on the matter (may point to the problem).

RayR

0 Kudos
Message 8 of 9
(2,990 Views)
Please see my answer in this thread. Sorry for non french speaking people : it is much easier - and faster - for me to write in french or german rather in english !

In summary :
  1. Mode set to open --> error if non existant file
  2. Text to save seems to be connected to the prompt input rather to the text input
  3. Unnecessary while loop
  4. Strong recommendation to read the LabVIEW help and to go through the examples
0 Kudos
Message 9 of 9
(2,983 Views)