CODESYS Talk
Good question, and both of your examples ring true β I have tripped over both kinds on site, usually at the worst possible moment during commissioning. One check I would add is around tasks and who writes what. If the same output, or the same function block instance, is touched from two tasks, or a fast task and a slow one both write a shared variable, the behaviour can look fine in a quick test and then go odd under load. Same for a task whose cycle time sits close to its watchdog, or a POU that...
Tim is right about the size. SIZEOF gives you the declared size of the string, so you end up writing the whole buffer, including the unused bytes after the terminating zero, and that is where those odd characters in the CSV come from. LEN is the right value for szSize. The empty file with LEN usually caught me out for a different reason, though. In my case the write was firing before the string was actually built, or the execute input stayed TRUE so the block never saw a new rising edge. I ended...
Hi Heinz, I hit the same thing after moving a project from 19 to 22.3, and Stefan's description matches what I saw almost exactly. In my case it also only showed up with a qualified_only GVL, and the repeated name made the line look right at a glance until the compiler complained, which was the annoying part. What got me through it for now was turning off 'Insert with namespace' in the SmartCoding settings and typing the full path by hand instead of accepting the suggestion with Enter. It is slower,...
Tim's one-liner is basically the short version, but there's a bit more to it, because uploading only works if the source is sitting on the controller in the first place. When you download, CODESYS can store the project source on the device along with the compiled code. If that's switched on, anyone who can log in can pull the whole project back with the upload command. So the first thing I would check is the source download setting in your project settings and switch that off β then download again,...
See my recent post