Using your test code, create a few more displays for the sample data, say "sample1.2 thru "sample1.9"(you currently only show "sample1" and "sample1.1".
Now leave the "enable" off. Everything is fine. No data is entered when "push to take sample" is pressed. Go ahead, press "push to take sample" a few times. It works as expected.
Now, turn the pot to have some sample data other than zero, say 15.
Now, turn "enable" on. The value of the pot goes into "sample1". Do NOT press "push to take sample" yet.
Now, turn "enable" off.
Now, turn pot value to zero (note: actually, you can turn pot to any value, and it won't change the results of this test)
Now, press "push to take sample"
We see that the value of "sample1" is moved into "sampl
e1.1" with the push of "push to take sample"
Press "push to take sample" again, we see the value move to "sample1.2"
each press of "push to take sample" will insert the value of "sample1" into the sample stack (sample1.1, sample 1.2, sample1.3, etc.) even though "enable" is off, the samples are put into the sample stack.
So, the value of what the pot was when "enable" was on, is moved into the sample object, even if "enable" is now off.
Attached is my SampleTest project. There is a switch on the left side to enable or disable the "work-around" I talked about in my origional post. Leave it disabled to see how the sample object works nativly.
The project functions similar to your sample project.
I hope this helps show how I think the sample object doesn't function as described in the Developers Manual.
Rich Anderson
Automation Controls Engineer
Anamax Group