ChaosTamed
Hi. I'm trying to re-create Thiago's "Basics 06: Communicate with OpenPLC Runtime using Python" on YouTube. This diagram below shows my variable definitions and ladder diagram.
 
Variables and ladder diagram.png
 
However, When I try to start the simulation, I get the following errors.
C:\Users\matt-\OneDrive\Documents\OpenPLC\Counter\build\plc.st:77-6..77-18: error: invalid variable(s) declaration.
In section: FUNCTION_BLOCK python_gear
0077: COUNTER : UINT;
C:\Users\matt-\OneDrive\Documents\OpenPLC\Counter\build\plc.st:84-37..84-36: error: invalid parameter(s) defined in function invocation of ST expression.
In section: FUNCTION_BLOCK python_gear
0084: _TMP_ADD10_OUT := ADD(COUNTER, 1);
C:\Users\matt-\OneDrive\Documents\OpenPLC\Counter\build\plc.st:87-4..87-10: error: invalid variable before ':=' in ST assignment statement.
In section: FUNCTION_BLOCK python_gear
0087: COUNTER := _TMP_SEL15_OUT;
I've also attached the plc.st file for reference.
 
Could anyone please offer some insight to these error messages? I don't know why the variable declaration COUNTER : UINT is invalid (I assume it's auto-generated?), and I think this causes the next two error messages.
 
Thanks in advance for any help.
Reply 0 0
thiagoralves
Your program is called "Counter" and that conflicts with an internal name on the simulation runtime. Change your program's name and it should be good.
Reply 2 0
ChaosTamed
Thank you Thiago!
Reply 0 0
Reply