LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

states matchine rapport

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

0 Kudos
Message 1 of 13
(3,038 Views)

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.

Tim
GHSP
0 Kudos
Message 2 of 13
(3,024 Views)

hey Tim

 

can you give me an exemple please ?

 

Hicham

 

0 Kudos
Message 3 of 13
(3,016 Views)

Show me what you have so far and I will help add to it.

Tim
GHSP
0 Kudos
Message 4 of 13
(3,009 Views)

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

 

0 Kudos
Message 5 of 13
(2,998 Views)

Hi hicham11303!

 

I've tried to make an example along the lines of the other advice given in the thread.

 

StateMachineSnippet.png

 

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!


Regards,

Peter D

0 Kudos
Message 6 of 13
(2,974 Views)

With a single 2D array:

 

StateMachineV2Snippet.png


Regards,

Peter D

0 Kudos
Message 7 of 13
(2,965 Views)

Try this little gizmo I keep around.]

]1.png

 

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


"Should be" isn't "Is" -Jay
Message 8 of 13
(2,962 Views)

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

 

 

 

 

0 Kudos
Message 9 of 13
(2,924 Views)

COuld they all be different error files or do they have to be in one file?

Tim
GHSP
0 Kudos
Message 10 of 13
(2,911 Views)