Hello voyage;
Open the project you want to modify (offline, of course); go to the Blocks folder, see if OB35 exists.
If it is not there, right-click on the Blocks level in the navigation tree at left, insert an OB, name it OB35 (you can ajust its cycle time in the processor's properties, in the Hardware Config editor).
Double-click on OB35 in the blocks folder; go to an unused network; from the library copy FB41, paste it into the unused network; the block call should be marked in red, as you need to assign a new instance DB number to it, associated with this call of the FB. Indicate a new, unused DB number (look at the DBs in the Blocks folder, choose a new one). This will be the interface for your first PID loop (you can give a symbolic name to the Instance DB you chose, to recognize the loop in your program). Go to the next network, do the same for your second PID loop.
Now click on the first call of FB41, and press F1; a help window should open describing the different parameters of this FB. Looks complicated, but you will find that there is a way to simplify your requirements. There is a flowchart linking all the parameters in a single diagram.
Start at the left uppermost parameter, work your way down.
The first parameter is SP_Int, decribed in the help file as a REAL value holding the setpoint; create a variable of REAL type where you will write the setpoint value and write the address or the symbol of that value here. Then it can be changed in the program or an HMI.
The next values are paired: PV_IN and PV_PER, and a selection is made between the 2 on the value of PVPER_ON; PV_IN is a REAL value, scaled from -100.00 to +100.0% (as if you choose to scale the 4-20 mA signal from the field in a seperate block, FC105 "Scale" for example); PV_PER (process value peripheral) is a WORD value that takes the unscale input from the analog input directly (you scale the input with the values in CRP_IN and PV_NORM); you select between the 2 options by changing the value in the BOOL parameter PVPER_ON.
And so on, and so on...You want Integral action, start by setting I_Sel to TRUE (actually use a BOOL address in your memory area and write 1 to it)., then assign an Integral gain to TI (reset time, a TIME format variable, with a value larger than the CYCLE parameter). You don't want derivatie action, place D_SEL to FALSE. And so on, step by step. CYCLE must be set to the same value as the time cycle for OB35, as previously mentionned.
There is a little twist you have to watch out for, besides the MAN_ON parameter that Ken mentioned; the COM_RST parameter (BOOL) should be set once in OB100 (First scan OB), and reset at the last network in OB35, so that it is active only once for the first execution of the PID logic. If other FB41 are already programmed, use the same bit address as they use for this parameter.
I really hope this does not make the issue even less clear to you,
Daniel Chartier