Defining Setpoint for PID library!

I am trying to write a PID controller for my air throttle, I would like to use analog input (0) as my setpoint which is connected to potentiometer and can vary from 0 to +5 volts. all the examples in the website have a static setpoint defined in the void setup() function.
for this situation what should I do? I did try to write Setpoint = analogRead(0); but it didn't work.

Where did you put this statement? There are things that happen in setup to prepare the pins for reading. If the pin is read before it is ready, you would not get a meaningful value.

Also, if the statement is in setup, it is only executed once. Changing the pot setting would not change the set point.

Finally, you say

but it didn't work.

You really need to clarify what this means. Did the code fail to compile? Did the pin not return the expected result? Did the pin not get read at the expected time? Did the value read from the pin not get used correctly?

What evidence do you have that "it did not work"?

Yes, you do need to clarify.

I use the PID library quite successfully and while my Kiln is coming up to temperature… I keep adjusting the setpoint… I have no issues.

I used that code in the void loop() function, so I think it should read the setpoint every time that loop runs.
basically I have connected pin 11 to an oscilloscope, when I write a static value for the set point (like setpoint = 100) you can see the generated signal out of the oscilloscope, the other way I tried was to add the code Serial.print(output), which was returning number 0.00 when I defined my setpoint to read from pin 0; and it wasn't zero when the setpoint was static number 100

We need to see some code.

you can see this as an example:

#include <PID_Beta6.h>

//Define Variables we’ll be connecting to
double Setpoint, Input, Output;

//Specify the links and initial tuning parameters
PID myPID(&Input, &Output, &Setpoint,2,5,1);

void setup()
//initialize the variables we’re linked to
Input = analogRead(1);
pinMode(11, OUTPUT);
//Setpoint = 100;
//turn the PID on

void loop()
Setpoint = analogRead(0);
Input = analogRead(1);

Sorry for taking your time, it is working now! I don't know why but it just started to work! anyway if I want to use the functions like myPID.SetInputLimits(63, 836); it stops responding again!