Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Can the LabWindows/CVI PID Control Toolkit Support More Than 5 PID Control Loops?

Primary Software: LabWindows/CVI Add-ons>>PID Control Toolset
Primary Software Version: 1.1
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
I am currently trying to use the LabWindows/CVI PID Control Toolkit to control more than 5 instruments. However, it appears that the PID Control Toolkit only supports up to 5 control loops. Is it possible to use more than 5 control loops?

Solution:
Note: This workaround is not longer required in the CVI PID Toolkit version 2.0 and higher. The content below is applicable only for versions of the toolkit prior to 2.0.


Yes it is possible to have more than 5 control loops when using the LabWindows/CVI PID Control Toolkit.

The default number of control loops for the PID Control Toolkit is set at 5. These default parameters are shown below in the PID Control Configure function panel and the PID.c source code. The input parameter, Loop Select (0-4), selects the current control loop that is being worked on. Default options for this parameter are numbers 0 - 4.



The PID.c source code uses the constant NLOOPS to determine the number of control loops that can be used.



In order to use more than 5 control loops, the numeric value associated with NLOOPS needs to be changed. Follow the steps below to update the number of control loops and the corresponding function panel.

  1. Launch LabWindows/CVI and select File >> Open >> Function Tree (*.fp)....

  2. Browse to and open the file pid.fp. The Function Tree Editor window will appear as shown below.



  3. Browse to Instrument >> Edit... to open the Edit Instrument dialog box shown below.



  4. Select the Attach and Edit Source option button to edit the PID.c source code.

  5. In the PID.c source code, locate the constant section near the top of the program and find the text #define NLOOPS 5. Change this numeric value (5), to the number of control loops that is needed and save the file.

  6. Switch back over to the Function Tree Editor window and double-click on the Configure function panel to open the function panel for editing.

  7. Double-click on the "Loop Select (0-4)" control to edit the properties. The dialog box shown below will appear.



  8. Change the "Control Label" text parameter to reflect the updated number of control loops.

  9. Select the Value Set option and update the maximum value parameter for the "Loop Select" control. The input for this parameter is the numeric value of NLOOPS - 1. This will ensure the range of inputs runs from 0 - (NLOOPS - 1).

  10. Save the updates by browsing to File >> Save All.

Anytime the PID Instrument Driver is now included in a LabWindows/CVI project, the updates will be shown.

Refer to page 1-9 of the "LabWindows/CVI PID Control Toolkit Reference Manual" for further explanation.


Related Links:
LabWindows/CVI PID Control Toolkit Reference Manual


Attachments:


PID Control - Configure.gifPID Source.gifEdit Instrument.gifFunction Tree.gifEdit Control.gif


Report Date: 10/05/2005
Last Updated: 01/24/2006
Document ID: 3Q47L26S

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit