Sangito
Hello there,
I wonder how to use global variable.
I have seen the global variable in the plc.st.
The full path of the variable in the "VARIABLES.csv", but to way to use it in the software.
I have use the "Config0" path, "Config0.Res0" path, but it look like only variable in "Config0.Res0.Instance0" is usable in program.

Is there is a way to use global varible or it is and in going featuring ?
Reply 0 0
thiagoralves
Double click Res0 and then just add your variables on the top panel
Reply 0 0
Sangito
I already done that but the variable create in the "Res0" is not usable no where in the editor.
I create two bool variable, one in Config0 call Global_Config0 and another one in Config0.Res0 call Global_Res0.
i use ladder with a contact with local variable and a coil with global_variable here the result:

For the Global_Res0
Start build in /home/sangito/OpenPLC_Editor/documentation/Boiler_OPENPLC/build
Generating SoftPLC IEC-61131 ST/IL/SFC code...
    Collecting data types
    Collecting POUs
    Generate POU Main
    Generate Config(s)
Compiling IEC Program into C code...
"/home/sangito/OpenPLC_Editor/matiec/iec2c"  -f -l -p -I "/home/sangito/OpenPLC_Editor/matiec/lib" -T "/home/sangito/OpenPLC_Editor/documentation/Boiler_OPENPLC/build" "/home/sangito/OpenPLC_Editor/documentation/Boiler_OPENPLC/build/plc.st"
exited with status 1 (pid 30389)
/home/sangito/OpenPLC_Editor/documentation/Boiler_OPENPLC/build/plc.st:103-4..103-14: error: invalid variable before ':=' in ST assignment statement.
In section: PROGRAM Main
0103:   Global_Res0 := DEM_Chauf;
1 error(s) found. Bailing out!
Error : IEC to C compiler returned 1
PLC code generation failed !


For the Global_Config0 
Start build in /home/sangito/OpenPLC_Editor/documentation/Boiler_OPENPLC/build
Generating SoftPLC IEC-61131 ST/IL/SFC code...
    Collecting data types
    Collecting POUs
    Generate POU Main
    Generate Config(s)
Compiling IEC Program into C code...
"/home/sangito/OpenPLC_Editor/matiec/iec2c"  -f -l -p -I "/home/sangito/OpenPLC_Editor/matiec/lib" -T "/home/sangito/OpenPLC_Editor/documentation/Boiler_OPENPLC/build" "/home/sangito/OpenPLC_Editor/documentation/Boiler_OPENPLC/build/plc.st"
exited with status 1 (pid 30670)
/home/sangito/OpenPLC_Editor/documentation/Boiler_OPENPLC/build/plc.st:101-4..101-17: error: invalid variable before ':=' in ST assignment statement.
In section: PROGRAM Main
0101:   Global_Config0 := DEM_Chauf;
1 error(s) found. Bailing out!
Error : IEC to C compiler returned 1
PLC code generation failed !
Reply 0 0
Reply