persistence feature at factoyexpress


Recommended Posts

I have just upgraded to 5.31 and tried the persistence feature on the chanels. I found several issues;

1)persistence number makes the graph display just that points stated at persiscence value;

if history is 500 and persistence is 10, the graph will display only the last recent 10 points and will erase the 11th when a new one is inputed.

2)clearhistory function does not clear either the table values on the chanel neither the graph if the persistence number on that chanel is diferent than 0.

Am I doing something wrong or is it how it is suposed to work?

Link to comment
Share on other sites

1) Persistance is designed to be bigger then history (or the same) only.

2) ClearHistory() does not affect persistance data, so if you call clearhistory() on a channel with persistance, nothing will really happen. This was done so you don't accidently clear a year's worth of accumulated data. To clear the persistance, use the channel parameters to set the persist to 0, then back to your setting (perhaps doing ClearHistory() in between:

MyChannel.PersistAmount = 0

MyChannel.ClearHistory()

MyChannel.PersistAmount = 10000

We are looking for feedback on whether this helps prevent people from losing their persist data, or is just a pain to those looking to clear the history. Perhaps we'll add a parameter to clearhistory() to force persist data cleared.

Link to comment
Share on other sites

The Persistence feature in DFx is for quick access of large amounts of data with-out using your electronic memory (RAM) excessively. For this new feature to work properly you must allocate a persistence number that is greater than the history length. The data loaded into the history is store on your computer's RAM and the Persistence data is stored on you hard drive.

Since the persistence feature has been designed to be seamless when you call the data it will have priority over the history. This is why your displayed data length is only 10 values and not 500.

If you set your history length to 500 and your persistence length to 600, your graph will display 600 points.

Once you have revised your DFx document to were the persistence length is longer than the history length the ClearHistory call should clear both data storage locations.

Go into DFx's help and read about the persistence feature (Channel History and Persistence) if you are still a little unclear on the persistence feature.

Link to comment
Share on other sites

mmm,

I increased the persistence value more than the history value;

history = 84600

persistence = 90000

(this is because I need the data to be captured on 4 days at 5 sec intervals...) Do you think it will cause some problem that hi values?

this is the RESET button quick sequence code;

AIN0.PersistAmount = 0

AIN0.ClearHistory()

AIN0.PersistAmount = 90000

AIN1.PersistAmount = 0

AIN1.ClearHistory()

AIN1.PersistAmount = 90000

It does not work as I expected... the graph and the table values on the current session remain there, although I think the data from the previous sessions gets cleared at the first time I click reset.

I need the reset button to clear all data. Is it posible?

Link to comment
Share on other sites

I found the bug;

the first time I click on the reset button it works perfectly. But then no matter how many times I click it does nothing. But if I change the action quick sequence lets say to something like this;

AIN0.PersistAmount = 0

AIN0.ClearHistory()

AIN0.PersistAmount = 90001

AIN1.PersistAmount = 0

AIN1.ClearHistory()

AIN1.PersistAmount = 90001

then it works again the next time I click it once. Then nothing again. So it only works once.

I tried making a sequences conection and calling that sequence from my reset button... but same problem, only the first time does what is supposed to do. Then nothing.

Link to comment
Share on other sites

solved;

I introduced new action on the Reset button;

increment V.pesamount variable

then the sequence;

AIN0.PersistAmount = 0

AIN0.ClearHistory()

AIN0.PersistAmount = V.pesamount

AIN1.PersistAmount = 0

AIN1.ClearHistory()

AIN1.PersistAmount = V.pesamount

V.pesamount is initiliced to 90000 at initialize sequence. I don?t think this Reset button will be hit more than 10 times per week so even with no shutdown on the computer, this should work on very long time... :lol:

If there Is a "better" solution please tell me.

Link to comment
Share on other sites

Yeah, the better solution is probably for us to just make it so ClearHistory has an option to clear the persistance. What you are seeing is that the file is not getting cleared out unless you change the length of the persist file. I think if you put a read() right before the clearhistory() it would work too, but I'm not sure. As I said, the best choice is for us to simply fix the problem, which we'll do for 5.32.

Also, FYI: you really should use variables instead of V channels. V channels have very limited use ever since we introduced variables. They are largely there for backwards compatability and a few select uses.

86400 for the history is no problem. Its 16 bytes per data point, so that's only about 1-1/2 meg. Persistance is solely limited by harddisk size. You could safely have a 10 million points in your persistance. Above 100 million you run into subsetting problems as described in the help (because the index gets confused as time), but this is easily worked around. The trick when using persistance values larger than the history is that in order to access the data past the history length you have to subset. So if you graph MyChannel vs. Time you will only see the data in the history, not the persist file. If you graph MyChannel[0,100000] vs Time, then you'll get values past the end of your history and from the persist file. This is done so you don't accidently try and load 10 million points into memory at once. Please review the section on channel persistance and history in the help for more information and recommendations.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.