11-21-2015 07:50 AM
I am trying to merge all the errors coming from the Main vi and merge them so that error recording to a csv can be accomplished. I have made a vi for this attached. Now I am facing with 2 issues :
1.I want to code to run in such a way that whenever there is an error it is written to the csv . and when there is a new error is written beloww to the first one .Right now my new error is replacing the first error and every time there is just one entry in the log that is the latest error. e.g if there is a error at 10:00 am it is recording that , but when another error occurs at 11:00 am it is replacing the first error , I want this new error in the same file below the first one not to replace and completely.
2.I figured out by Merging errors i will only get the first error , so how to club multiple errors together .Like if 2 errors occured then both of them are recorded ?At present i have merged all error possibilities but at the ouput only the first error is recorded.
I have attached a rough code taking error references by creating them .(Just 2 at the moment but in real i have around 5-6 errors) .
11-21-2015 08:32 AM
RAUNAKBAHRI a écrit :
I am trying to merge all the errors coming from the Main vi and merge them so that error recording to a csv can be accomplished. I have made a vi for this attached. Now I am facing with 2 issues :
1.I want to code to run in such a way that whenever there is an error it is written to the csv . and when there is a new error is written beloww to the first one .Right now my new error is replacing the first error and every time there is just one entry in the log that is the latest error. e.g if there is a error at 10:00 am it is recording that , but when another error occurs at 11:00 am it is replacing the first error , I want this new error in the same file below the first one not to replace and completely.
2.I figured out by Merging errors i will only get the first error , so how to club multiple errors together .Like if 2 errors occured then both of them are recorded ?At present i have merged all error possibilities but at the ouput only the first error is recorded.
I have attached a rough code taking error references by creating them .(Just 2 at the moment but in real i have around 5-6 errors) .
For 1, use Set File Position.vi from the File I/O -> Advanced File Functions palette and set the file position to 0 bytes from the end. To have the errors on different line (to make it more readable) you should add a carriage return at the last input of the concatenate string function.
Number 2 is more complex and can depend on how you implemented you main vi code. Either use a queue to log the errors as they happened or create a Functional Global Variable (FGV) to add errors to an array of error (I suggest 3 cases: set errors, report errors and reset). Search the forum for FGV there are surely a lot of examples.
Ben64
11-21-2015 09:22 AM
hi Ben
Thanks for your response , part 1 works now . Part 2 i tried to look it up in the forum was not able to find anything in particular . As you said it is indeed complex atleast for me 🙂 . Is it possible to give an eg for the solution you gave ?
11-21-2015 10:18 AM