Author Topic: PIDCompute  (Read 12143 times)

oes

  • Newbie
  • *
  • Posts: 5
  • I'm a llama!
    • View Profile
PIDCompute
« on: September 21, 2007, 03:03:31 AM »
I'd like to call PIDCompute for 7 different channels in a for-next loop, something like this:

for I = 1 to 7
     E= ... 'Determine the error
     T=PIDCompute(I,E)
next 'I

I get an error each time I try to compile.  When I take the PIDCompute out of the loop and call the function with a channel number (rather than a variable, I), I get no error.  for example:

T=PIDCompute(1,E)
works OK.

I'd like to call the function in a loop with the channel indexed.  Is that not permitted?
Thanks!

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:PIDCompute
« Reply #1 on: September 21, 2007, 10:44:37 AM »
Some parameters used by TBASIC have to be integer constant and not variable due to the the way data are stored inside the PLC. i.e. some data may be stored during compiled time and not during run time and therefore the location of the data must be known during compilation. In such circumtances TRiLOGI compiler will not allow the parameter to be a variable.

Email: support@triplc.com
Tel: 1-877-TRI-PLCS