Internet PLC Forum

General => Technical support => Topic started by: sntang on July 19, 2003, 07:56:53 AM

Title: System Variable Index Out-of-range
Post by: sntang 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.
Title: Re: System Variable Index Out-of-range
Post by: support 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.