Have you received any feedback or found any solutions to the load problem. We are running into similar issues, even without codesys running the load avarage is above 1 meaning that it is to busy already without plc code running. Hope you might have some more insight.
SOLVED SEE REPLIES NOT A BUG, Different thinking approach Hello, There is still a bug within the Json_TO_Struct FB. Within the method MatchAllLevels: The EXIT Statement was in the wrong place within the for loop. As the loop needs to be exited when a match is found. The bug caused the matchalllevels method to always feedback the value false due to the exit statement. When placing the exit after match is set to true the values are parsed into the struct. --------------------------------------OLD-----------------------------------------------------------...
I Found my thinking mistake. You made it that you can onlyh parse from and to a struct of the same instance name. In my example I parse a writing struct and than parse it back into a reading struct of the same type. But as the writing and reading struct have different instance names this match all levels does not become true making the reading struct empty. So parsing to and from 1 struct instance will work.
sFileContentsWrite_Struct : ST_TEST; sFileContentsWrite_Struct_Json : ST_TEST_Json; sFileContentsRead_Struct_Json : ST_TEST_Json; sFileContentsRead_Struct : ST_TEST; sFileContentsWrite_Struct_Json.fReal.Number := sFileContentsWrite_Struct.fReal; sFileContentsWrite_Struct_Json.nInteger.Integer := sFileContentsWrite_Struct.nInteger; sFileContentsWrite_Struct_Json.sText.CharString := sFileContentsWrite_Struct.sText; sFileContentsWrite_Struct_Json.fLreal.Number :=sFileContentsWrite_Struct.fLreal; s_fbJsonParser(...
OKay but then there must be another error, as after the change the functionblock read all the values into my local struct. Without the fix my local struct stayed empty all the time.
Hello, There is still a bug within the Json_TO_Struct FB. Within the method MatchAllLevels: The EXIT Statement was in the wrong place within the for loop. As the loop needs to be exited when a match is found. The bug caused the matchalllevels method to always feedback the value false due to the exit statement. When placing the exit after match is set to true the values are parsed into the struct. --------------------------------------OLD-----------------------------------------------------------...