Resetting The Potentiometer Value To Zero On Screen Button Push


Recommended Posts

Hi,

 

I am entirely new to scrpting and DaqFactory hence my questions are very simple comparing with other subjects discussed on the forum:

 

  1. What i am trying to do:
    I need to create a button with possibly quick sequence that will reset the potentiometer position reading to zero so partial piston stroke is shown.
     
  2. I have a linear potentiometer that already displays the position of piston through a simple conversion.
     
  3. I have an absolut readout from potentiometer shown on the graph already.

Thanks for any help on this.

 

Tom

Link to comment
Share on other sites

What you'll want to do is create a global variable to store that zero position.  So, create a sequence marked Auto-Start and put something like this:

 

global zeroPoint = 0

 

Then in the Quick Sequence for your button, and assuming the channel reading the potentiometer is simply called "pot", put:

 

zeroPoint = pot[0]

 

Then, whenever you want to display the adjust value, do the subtraction, so in a variable value it might be:

 

pot[0] - zeroPoint

 

and in a graph:

 

pot - zeroPoint

Link to comment
Share on other sites

Archived

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