jinyistudio
Hi

Your OR's input not boolean ? I have try to make my OR. It's OK. I have found their data type is different. Their are BOOL and ANY_BIT. What's different ?[frown]

plc_q2.png 

compiling new program...
./st_files/aa.st:10-17..10-22: error: Data type incompatibility for value passed in position 1 when invoking function 'OR'
./st_files/aa.st:10-25..10-32: error: Data type incompatibility for value passed in position 2 when invoking function 'OR'
./st_files/aa.st:10-14..10-33: error: Unable to resolve which overloaded function 'OR' is being invoked.
3 error(s) found. Bailing out!
Error compiling program. Please check console log


[jinyi_title_1p] 
Delphi, B4A, B4J, C#/Mono, Mitsubishi Q-PLC
[image]
Delphi, C#, Q-PLC, B4A, B4J, Raspberry PI2
Delphi, C#, Q-PLC, B4A, B4J, Raspberry PI2
[image]
Delphi, C#, Q-PLC, B4A, B4J, Raspberry PI2
Quote 0 0
thiagoralves
Your code is wrong. OpenPLC follows strictly the IEC 61131-3 standard for programming PLCs. The inputs allowed in OR blocks are only variables of type ANY_BIT. From wikipedia:

ANY_BIT = LWORD, DWORD, WORD, BYTE or BOOL
(https://en.wikipedia.org/wiki/IEC_61131-3)

In your code, the first input for the OR block is a contact, and the second input is a time variable. According to IEC 61131-3, this is not allowed. That's why you are getting these errors.

Also, you don't need the OR block to perform OR operations if you are programming in Ladder. Just put one contact above the other connected in parallel and you'll have your OR operation. You just use OR blocks if you are programming in FBD.
Quote 0 0