Author Topic: System Variable Index Out-of-range  (Read 10878 times)

sntang

  • Newbie
  • Posts: 3
  • I love YaBB 1G - SP1!
    • View Profile
System Variable Index Out-of-range
« on: July 19, 2003, 07:56:53 AM »
Hi,

I recieved the "System Variable Index out-of-range" error during simulation run when I use INPUT[n] in TBASIC function where n is 28 to 48

I discovered if I changed to INPUT[1] or INPUT[2] the error is gone.

Is this a bug in the TRiLOGI?

Physically my PLC have 48 inputs and I need to use the command INPUT[n] to monitor input#28 to #48.

Please help. What to do to overcome this error?

Thanks.
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: System Variable Index Out-of-range
« Reply #1 on: July 20, 2003, 11:51:14 AM »
INPUT[n] returns a 16-bit word.

  INPUT[1] represents input bit 1 to 16,
  INPUT[2] represents input bit 17 to 32

  ...
  INPUT[16] represents input bit 241 to 256

The maximum allowable index for INPUT[n] is n = 16.
Going beyond that or if N < 0 will result in run time error.

To read the status of a single bit, it need to use either the TESTBIT or TESTIO command. TESTBIT commands requires you to input the bit position (0 to 15) of the bit within a word. TESTIO command is easier if you have already defined the label name for an I/O on the I/O table.
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS