DigitalRex
Hi, I'm new to this and I'm programming a simple cocktail shaker that only dispenses 2 drinks in ladder and I'm trying to configure the I2C encoder and LCD. I don't know if I'm doing it right

I'm trying to do these steps:
State 1: WELCOME
• Description: The system displays a welcome message on the LCD.
• Transition: By pressing the rotary encoder button, the system goes to the "Drink Selection" state.

State 2: Drink Selection
• Description: The user can choose between "Mojito" or "Cuba Libre" by turning the rotary encoder.
• Transitions:
o If the user selects "Mojito", the system goes to the "Preparing Mojito" state.
o If the user selects "Cuba Libre", the system goes to the "Preparing Cuba Libre" state.
[203128%2F8953714%2Fmceclip0]
The first ladder, where the SELECT is, is for the encoder rotations, and the other two ladders are for the dispensing of the drinks and the control of the motors (M1, M2, M3).
[203128%2F8953708%2Fmceclip0][203128%2F8953716%2Fmceclip0][203128%2F8953717%2Fmceclip0]
Reply 1 0
Flare09
I'm definitely working on the same kind of project. Did you figure it out yet? The "simple answer" would be to add another output that posts to the LCD "preparing mojito" when condition 1 is started, and a wait until the mojito OK comment triggers, then reset screen back to select menu?
Reply 0 0
thiagoralves
The Arduino extension code posted above has lots of delay() calls. That’s going to mess up the runtime. Ideally, the Arduino extension should not contain any logic, just code to write to the screen. Logic should reside in the PLC program side. For example, you could have two shared variables: a BOOL write_to_screen and a STRING text_to_write. Every time the PLC side sets write_to_screen, the Arduino code writes whatever is in text_to_write to the screen. That’s it. All the other conditions, logic checks, etc, are performed by the PLC side.
Reply 0 0
Reply