Jump to content
OMRON Forums

Syntax error: Unexpected BARBAR


HJTrost

Recommended Posts

What is not to like about this PLC:

open plc Myplc1
p80 = Motor[1].PlusLimit || Motor[1].SoftPlusLimit ;
p81 = Motor[1].PlusLimit || Motor[1].SoftPlusLimit ;
close

The first double-bar draws the error message, the second does only if I remove the first one.  PlusLimit and SoftPlusLimit are advertised as Booleans in the Power Pmac SRM.

Link to comment
Share on other sites

That is the “conditional combinatorial operator” for Boolean results of the logical “conditions” the arguments.

Your arguments are bit values. You should be using the Bit-by-bit version “|”:

open plc Myplc1

p80 = Motor[1].PlusLimit | Motor[1].SoftPlusLimit ;

p81 = Motor[1].PlusLimit | Motor[1].SoftPlusLimit ;

close

 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...