11-14-2007 03:49 AM
11-14-2007 06:12 AM
11-14-2007 06:32 AM
Thanks, but I also must find last row in this file. This is so complicated. I think there is command like retentive flip flops or counter in PLC. Is there any example which show something similar and that can help me?
Thanks to anybody who answer me and help
Emir
11-14-2007 06:33 AM - edited 11-14-2007 06:38 AM
mujo wrote:
In PLC world there are retentive counter which keep variable values in case of power off - I want to find something like that. I make my counter vi but can not to solve this problem . )
In LabVIEW, there are Functional Globals that can be setup to retain count, but since you've mentionned "power off", then I would recommend writing that value to a file after every iteration. You could have a special vi that has one input, the count value and writes it to file.
Actually, how time-critical is this software? A better implementation would be using the Producer Consumer loops, where the consumer loop could take care of logging the count value to file. It would open the file and just update the value in parallel to the rest of the process. Of course, you could do more with it, but that's beyond the scope of this question.. 🙂
11-14-2007 06:40 AM
11-14-2007 07:27 AM
11-14-2007 07:35 AM - edited 11-14-2007 07:39 AM
11-14-2007 07:38 AM
Hi Emir,
I have encountered your request before to preserve values through a power fail like PLC. That feature is not in LabVIEW (yet ).
Please post an example of of how you are writing the file and what you have tried so far.
One method to find the last "record" written to a file is to to repeatedly read records from the file, storing the read records in a shift register and monitoring the file read for an error code of "4" End of File. When the code sees the error 4, the previous record was the last value.
If that doesn't help, post your code and files so someone can help.
have fun!
Ben
11-14-2007 11:18 AM