Author Topic: I'm getting an Syntax error  (Read 5245 times)

sparks32

  • Newbie
  • Posts: 22
  • I'm a llama!
    • View Profile
I'm getting an Syntax error
« on: October 25, 2010, 06:18:21 PM »
I was wondering if anyone knows what is the matter with my tbasic line. i have an input named enter and a relay named run2.
i keep getting a Syntax error when i enter this line in the custom function.
if testio(enter)= 1 then setio(run2) endif
my relay 2 label is definately written as run2 all lowercase with no spaces or underscores.
if i replace the line with
if testio(enter)= 1 then a=b endif
no error shows up  ???
i tried entering a coil into ladder just to see if that might be the problem but that didn't work

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:I'm getting an Syntax error
« Reply #1 on: October 25, 2010, 09:41:28 PM »
if testio(enter)= 1 then setio run2 : endif

SETIO is a statement, not a function so you do not enclose the I/o label within the parenthesis.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

sparks32

  • Newbie
  • Posts: 22
  • I'm a llama!
    • View Profile
Re:I'm getting an Syntax error
« Reply #2 on: October 25, 2010, 10:00:02 PM »
the answer was so simple, thanks