HJTrost Posted March 24, 2023 Share Posted March 24, 2023 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. Quote Link to comment Share on other sites More sharing options...
steve.milici Posted March 24, 2023 Share Posted March 24, 2023 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 1 Quote Link to comment Share on other sites More sharing options...
HJTrost Posted March 24, 2023 Author Share Posted March 24, 2023 Thanks for the advice, that will work. I was going to write instead if (Motor[1].PlusLimit || Motor[1].SoftPlusLimit) p80 = 1 ; else p80 = 0 ; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.