tomtar Posted November 9, 2015 Share Posted November 9, 2015 Hi, I am entirely new to scrpting and DaqFactory hence my questions are very simple comparing with other subjects discussed on the forum: 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. I have a linear potentiometer that already displays the position of piston through a simple conversion. 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 More sharing options...
AzeoTech Posted November 10, 2015 Share Posted November 10, 2015 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.