gabe
Greetings fellow OpenPLC users,
 
I ran into this issue with the outputs not setting to true in at least two programs that I wrote lately. Ruling out double output assignments , I checked with the debugger my SR blocks to always find that Q was working as I intended, while other function blocks that used the same output were not actually active. Now, the interesting part is that sometimes I may delete the line connecting the Q of the SR to my output and trace a new one exactly were the old one used to be, download the program to the Arduino and it just works as intended. I have it happen once in a while and puzzles me quite a bit.
 
Any ideas?
Reply 0 0
thiagoralves
Are you using an Arduino Uno? If so, you may be plagued by the "out of memory" issue on that board. Since it only has 2KB of RAM, anything slightly complex will just fail silently. I've received so many issues like that, that I'm in the verge of removing Uno entirely from the list just because it cannot handle an IEC 61131-3 runtime.
Reply 0 0
gabe
Mhm, I did experience this issue with both Arduino Uno and Mega. Probably the programs get a little too big for them to handle. Would you recommend rather using something like a Raspberry Pico or a Pi instead? I had so far a good time programming with the Arduino but I always end up having this type of issues when I happen to be using a bunch of outputs like a seven-segment display or in the case of my last program, three LEDs that given certain conditions would steadily light or blink.
Reply 0 0
gabe
Upon further review, my program has around 512 Kb. The mega seems to be able to handle 256, and also the Pico. Guess it is time to upgrade to a Pi.
Reply 0 0
thiagoralves
The issue here is not Flash, but RAM. I don't think your program has 512Kb, otherwise it wouldn't even compile for the Uno properly. Pico should be enough. It has plenty of resources even for the most complex programs, and cost about the same (if not less) than an Arduino Uno. ESP8266 and ESP32 are also great alternatives.
Reply 0 0
gabe
The issue here is not Flash, but RAM. I don't think your program has 512Kb, otherwise it wouldn't even compile for the Uno properly. Pico should be enough. It has plenty of resources even for the most complex programs, and cost about the same (if not less) than an Arduino Uno. ESP8266 and ESP32 are also great alternatives.
So, I downloaded the program to my Pico W, but I still have the same issue. I then ran a simulation instead of the debugger with the PLC, and it still pretty much shows me the same: the Qs of each of the SRs are set to true as and when I intend to including no double assignments. I also double-checked the output addresses  and wiring as one should do to no success...  
Reply 0 0
gabe
In a quick update, I just deleted the line to the output and traced a new one and it started to work. I'll just leave it there because the program works and I had enough of a headache already. Thanks once again for all the help.
Reply 0 0
thiagoralves
Most likely then your problem was not lack of memory, but incorrect wiring on the diagram instead. Maybe the line wasn't properly connected to the endpoint.
Reply 1 0
Reply