Manuel
I have a problem with my program because in the simulation it runs correctly but in the fiscal system with the Arduino Uno it runs the last subprogram (SEC_3). The program has 4 function block type subprograms and 1 main program type program.
  [203128%2F9137647%2Fmceclip0]
 
This is my main program (MAIN):
[203128%2F9137648%2Fmceclip0]
 
This is my function block type subprogram (CTRL_SEC), and with this I choose which subprogram to run, PB1 and PB2 are physical buttons connected to the Arduino Uno, and SEC is a variable where the value is saved depending on the buttons pressed:
[203128%2F9137661%2Fmceclip0]
 
This is my subprogram (SEC_1) of function block type, in this a sequence of LEDs is made. The variables L1, L3, L3 and L4 are the outputs of the Arduino that are connected to some physical LEDs:
[203128%2F9137673%2Fmceclip0]
[203128%2F9137675%2Fmceclip0]
 
This is my subprogram (SEC_2) of function block type, in this a sequence of LEDs is made. with the same output of L1, L2, L3, L4.
[203128%2F9137680%2Fmceclip0]
 
Finally this is my subprogram (SEC_3) of function block type, in this another sequence of LEDs is performed. with the same output of L1, L2, L3, L4. and this is the last subprogram that is executed in the Arduino Uno by physically pressing the PB button.
[203128%2F9137688%2Fmceclip0]
 
PB1 and PB2 are global variables, L1, L2, L3, L4, and SEC are global. In each sequence subroutine there is a timer TON which is local and the variables ET and M0 are also local.
[203128%2F9137697%2Fmceclip0]
 
How do I solve this problem?
Reply 0 0
thiagoralves
Most likely you ran out of memory. The Arduino Uno has only 2KB of RAM. Test this on a platform with more memory and check if it works.
Reply 0 0
Manuel
I tried to upload the program to an ESP8266 NodeMCU and another problem arose. The program does not upload to the board. What can I do?
When it finishes loading, the following supposedly appears: Variables and constants in RAM (global, static), used 29448 / 80192 bytes (36%)
Reply 0 0
fg71
What are you trying to do, it looks to me you are using a lot of GE and LE, so why do you not use Structured text.
If you decide to use FBD input variable why do you not use it as output. In other words all your coils could be
replaced with output variable. Instead of mixing FBD and LD. (That looks very strange to me)
Reply 0 0
thiagoralves
I tried to upload the program to an ESP8266 NodeMCU and another problem arose. The program does not upload to the board. What can I do?
When it finishes loading, the following supposedly appears: Variables and constants in RAM (global, static), used 29448 / 80192 bytes (36%)
Make sure your OpenPLC Editor is up to date (file -> check for updates). Then, when compiling the program, make sure you've not selected the "compile only" checkbox, otherwise it will just generate the program but won't upload. Finally, make sure the COM port for your board is correctly selected.
Reply 0 0
Reply