07-26-2011 07:22 AM
Hello,
I made a program that contains a state machine, and I want to generate an error report in a TXT file. But what I want to do is book a special area in the txt file For each of the stages of the state machine such as the first step in the error report will occupy the line 1 to line 10 txt file.
I want to know if it is feasible to LabVIEW or not, if yes how can I do?
thank you
07-26-2011 07:56 AM
Yes you can use LabVIEW to do this. You could make different arrays of strings and when you are done writing to the array save them all every time.
07-26-2011 08:04 AM
hey Tim
can you give me an exemple please ?
Hicham
07-26-2011 08:18 AM
Show me what you have so far and I will help add to it.
07-26-2011 08:31 AM
i send you a demo program
what i want is to creat a error rapport andfile save it in a TXT file
for exemple whene the user push the bouton "prog pix" we excute the state machine and if there is an error save it into the txt in a specifie area for exxemple from line 1 to line 10 whithout delete the other line of the file
07-26-2011 10:23 AM
Hi hicham11303!
I've tried to make an example along the lines of the other advice given in the thread.
This is just a basic example which I hope will help you get started. You could also use a single 2D array of strings (as opposed to multiple 1D as in the example) and use the Enum value to select which row to update - this is probably more scalable than my solution here.
If you have any questions I'm happy to help!
07-26-2011 10:37 AM
07-26-2011 10:39 AM
Try this little gizmo I keep around.]
]
Just put it on the error chain- it logs up to Log max (10) errors to Error Log.txt in the default data directory. The newest error is on top in the file
07-27-2011 03:34 AM
hi
thank you for your answer, but in my vi in every stage i've different 1D arrays
i send you a screen print to see un exemple
07-27-2011 06:34 AM
COuld they all be different error files or do they have to be in one file?