longdm042
How to use global structure variables and array variables?
in program0
 
VAR_EXTERNAL
cc : ARRAY [1..2] OF DINT;
END_VAR
 
and resource1
 
VAR_GLOBAL
cc : ARRAY [1..2] OF DINT;
END_VAR
err report 
D:\ct\beremiz\test8\build\plc.st:18-11..18-29: error: Declaration error. Data type mismatch between external and global variable declarations.
In section: PROGRAM program0
0018: cc : ARRAY [1..2] OF DINT;
1 error(s) found. Bailing out!
 
Reply 0 0
thiagoralves
I don't know about Beremiz, but this worked just fine on OpenPLC Editor (version 2.01 - release 2023-04-13):
plc1.png
 
plc2.png
 
Start build in C:\Users\Thiago Alves\OpenPLC_Editor\editor\examples\Blink\build
Generating SoftPLC IEC-61131 ST/IL/SFC code...
    Collecting data types
    Collecting POUs
    Generate POU Blink
    Generate Config(s)
Compiling IEC Program into C code...
Extracting Located Variables...
C code generated successfully.
PLC :
   [CC]  plc_main.c -> plc_main.o
   [CC]  plc_debugger.c -> plc_debugger.o
py_ext :
   [CC]  py_ext.c -> py_ext.o
PLC :
   [CC]  Config0.c -> Config0.o
   [CC]  Res0.c -> Res0.o
Linking :
   [CC]  plc_main.o plc_debugger.o py_ext.o Config0.o Res0.o -> Blink.dll
Successfully built.
PYRO connecting to URI : PYROLOC://127.0.0.1:61753
PLC did not provide identity and security infomation.
Latest build does not match with connected target.
PLC data transfered successfully.
Retain size 0 
PLCobject : NewPLC (b815e632fd39152cfc3b3c71627cb7f0)
PLC installed successfully.
PLCobject : PLC started
PLCobject : Python extensions started
Starting PLC
PLCobject : PLC stopped
 
Reply 0 0
Reply