CODESYS structured text priority and syntax

I’ve got a CODESYS project connected to my groov that’s not acting how I expect. I have a structured text POU like this:

IF TestInput THEN
	TestOutput := TRUE;
ELSE
	TestOutput := FALSE;
END_IF

Those two variables are GRV_OMRIS_8 channels:

I expect that if I go into Groov Manage and toggle TestInput to “On”, that this code should turn TestOutput to “On”. Instead, what I see is that it forces TestInput back to “Off” immediately, and TestOutput stays “Off”.

Do I have a syntax error or am I misunderstanding how this should work?

I think I answered my own question. As best I can tell, CODESYS takes control over the outputs and will not tolerate changes. I need to actually toggle an input to get this to work.

Yes, once you have programmed the output in codesys that is what controls it. It would be very dangerous for operations if multiple things could turn on outputs. We call this the single source of truth, and the runtime engines take top priority.

2 Likes