derekmillman
I am using OpenPLC Editor 4.1.4 on Windows11 trying to link to ESP32 WROOM (YEJMKJ brand).
 
My OpenPLC setup is very simple, a single rung with a single PB1 contact and a single LED1 coil. This config works correctly under simulation mode.
 
The physical wiring is also simple, and I tested it independently with the same ESP board, using the same pins, using a separate arduino IDE sketch: push button, led turns on.
 
The OpenPLC code compiles and loads. The problem seems to be related to the fact that the LOCATED_VARIABLES.h file is empty. I have tried both the ESP32_WROOM and ESP32_GENERIC builds. The defines.h file built on fresh compile appears to have the correct pin info. In glueVars.c, the glueVars() function is empty.
 
This is starting to feel like a code generation issue, but I'm hoping someone can help me find whatever else I may be missing.
 
Thanks in advance for any help and ideas...
Reply 0 0
thiagoralves
LOCATED_VARIABLES.h is populated according to your project. If you don't fill out the location on any variable, it is going to be empty.
Reply 0 0
derekmillman
Thanks for the quick reply!
 
When I configure the table like this:
[203128%2F9737936%2Fmceclip0]
I get the following error:
[203128%2F9737937%2Fmceclip0]
 
The code is:
VAR_INPUT
  PB1 : bool AT %IX0.0;
END_VAR

VAR_OUTPUT
  LED1 : bool AT %QX0.0;
END_VAR
 
but won't compile unless I change it back to:
VAR_INPUT
  PB1 : bool;
END_VAR

VAR_OUTPUT
  LED1 : bool;
END_VAR
 
Thanks again for your interest and attention!
Reply 0 0
thiagoralves
That's correct. A class INPUT means this variable is received from another POU, and therefore should not receive a location. Same goes for class OUTPUT. If this is your main program, all your variables should use the "Local" class in general. The class has absolutely nothing to do with the type of IO you want to use. Check IEC 61131-3 concepts online to understand more about how IEC variables classes work.
Reply 0 0
derekmillman
Thank you very much!! That tip fixed it. I appreciate the guidance!
 
In case anyone faces similar issues in the future, this config works:
 
[203128%2F9737951%2Fmceclip0]
 
[203128%2F9737952%2Fmceclip0]
Reply 1 0
Reply