10-15-2008 05:22 AM
Hi,
I am a fan of using function globals. In my program I'm using for every product examination after the test is finished the set action for writing the data to a uninitialized shift register and I want to read those data 3 times in every measurement. But after everytime I read the data back via the get method, my shift register is overwritten. I have attached a screenshot of this FGV. Do I have a chance to avoid to overwrite the data only in the set case and not in the get?
Kind Regards,
--
Joachim
10-15-2008 05:33 AM
10-15-2008 05:35 AM
10-15-2008 06:25 AM
Hi Ed,
thanks for the reply. this doesn't solve the problem. when I write back the 3rd element from the shift register like in the attachment only the first get gives me the correct result. the second time I read the data via get the data are shifted and i get the wrong data.
Regards,
--
Joachim
10-15-2008 07:03 AM
Joachim,
the shiftregister in your code has a history. So you dont only keep the data from n-1 but from n-2 and n-3 as well.
When you call "get" you retreive n-3 if the current call is the n-th one....
Question 1: Is that really what you want?
If YES, i recommend you not to use the shiftregister for keeping the history. Easy note: You can only write one value to it, but in order keep your historyu unchanged, you'd have to write three values.
So i recommend you to use a shiftregister to keep an array. That array includes your history.
hope this helps,
Norbert
10-15-2008 07:07 AM - edited 10-15-2008 07:08 AM
Norbert B wrote:Joachim,
the shiftregister in your code has a history. So you dont only keep the data from n-1 but from n-2 and n-3 as well.
When you call "get" you retreive n-3 if the current call is the n-th one....
Additionally, every time you call the VI the history gets moved one place backwards, be it the set, get, or any other command.