LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error log

hello,

i need to create error log that save all the errors which produced by the automatic error handler ..

can any one suggest a simple method to do that ?

thank you .  

0 Kudos
Message 1 of 13
(5,012 Views)

Hi, 

 

You can built "subvi error", and when error will occur, take the informations that you want and save it in the ASCII file (text file). Use the function : "Set file Position" to avoid overwriting of the datas.

 

Regards,

Fred.

 

Kudos are welcome!Smiley Wink

Message 2 of 13
(5,004 Views)

thank you Fred for reply,

the problem here that when i save the information in txt file i will need a method to display these information where it is difficult to do with text file .

i need to display the error code, source and message in three seperated fields which is difficult when the info are in txt file .

Regards

0 Kudos
Message 3 of 13
(4,992 Views)

Ok, I see. In this case, You should use "CSV file". by using the function "Write Delimited Spreadsheet" You can format data of your cluster and save it.

 

  • if you want to read immediatly after saving, there is not problem because after reading, you can overwrite and write another error.
  • But if not, you must firly read the datas in your file and put them in a table>write the new error like the last element of your table> and write the new table in your same csv file.

 

Regards,

Fred.

 

Kudos are welcome!Smiley Wink

Message 4 of 13
(4,982 Views)

what you said was exactly what i have tried, the problem was to break down the data which produced by cluster in 3 fields ..

i used ; as delimiter to be able to seperate the 3 fields from each other but the data have been sperated depending on ; and on starting new line and then the data did not make sense any more.

Regards

0 Kudos
Message 5 of 13
(4,962 Views)

Try this code below.

You can then use csv (or text file if  you want : the data will be separeted by the comma on each line. "status","code","source")  and you have many fuction in the palet Programming>>String to help you for reading.

img.PNG

Message 6 of 13
(4,950 Views)

thank you Fred ,

as i said the problem is not when i try to save the info from the cluster in the text file .. the problem comes when we try to display these info ..

when i do have for example 100 errors how can i display every single error alone ? we must find a way to go through the text file and somehow must the programm recognize where the data of an error begin and where they finish and display these data in three seperated fields or two the code of the error and the source of it ... so when i tried to use read Delimited Spreadsheet depending on the delimiter the program sees two type of delimiter :

1- my delimiter ;

2- new line

 

0 Kudos
Message 7 of 13
(4,937 Views)

Use the "for loop" if you want to read all "error" in your file and you will be able to display each error. or index your array to read an error precisely. Convert the "code" of the "error" in number (if you want).

 

How would you like to read ? (ex:when you push button it display the next error or when you give the number it display the corresponding error). 

 

img2.PNG

 

Kudos are welcome!Smiley Wink

Message 8 of 13
(4,929 Views)

this an example how i want to display the errors and for example the drop down list display the last 10 errors ..example..PNG

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

Do you want to save date and hour (if yes, let me know) ?

One of your solution is below,

img3.PNGimg4.PNG

 

Don't forget the error handling.

 

Regards,

Fred.

 

Kudos are welcome!Smiley Wink

 

Message 10 of 13
(4,914 Views)