Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Bolt on December 12, 2019, 06:11:11 PM
-
I have this JSONBUILD instruction, containing two number "1"s (as placeholders). Could these numbers be causing the attached errors?
-
I got smart and loaded the instruction into the Simulator. It results in a CRITCAL ERROR! Math stack underflow!, Program was halted due to an invalid instruction.
Creating a Symbolic Constant with a value of 1 does the same thing. V0 = 1 works fine.
I also noticed that running the attached program in the Simulator, Stage 22 will run as soon as the Simulator is moved from Stop to Run. That doesn't sound right?
-
To try to diagnose the issue, eliminate the Stage. SG S22 is the initial stage (that's what the double box means), but it appears you only want S22 to fire when X1 goes from OFF to ON. The Initial Stage will run whenever the code block test is RUN, regardless of X1.
Just have X1 drive the JSONBUILD and the STRINSERT.
What is in SS60?
-
Oh yes, I forgot that aspect when throwing the simulator project together. Makes sense. My real projects have a main stage with "proper" logic.
Back to the original problem, in both BRX and simulator, having a number or symbolic constant in the JSONBUILD reboots the PLC. SS60 was blank in the sim, and '2019-12-12' in the original project.
-
I did something close to what you have, with symbolic constants Juan 1 and Too 2, and it works fine. ??? (see attachment)
This isn't your issue with JSONBUILD, but for JSON grammar, make sure your SS60 string is enclosed in double quotes, since it is text, and not a simple number, null, true, or false.
-
Gotcha. Now try replacing a V0 source element with Juan, Too or 3, and you'll bring the PLC to its knees for a second
-
OK. Sorry about that. That makes a HUGE difference. I should have gotten that.
Yes, this IS a major issue. For now, please do NOT use NUMERIC CONSTANTs in the Field Type/Value field. Bad things are happening in the PLC if you do that.
We will address this and have a proper fix in a future release.
Thanks for finding this and letting us know. It's a little more work on your side for this work-around. Sorry about that.
-
No problem. I only added the constants to fill spots in order to match the layout of another string. I have since quit doing so already and simply using a blank variable! Thanks!
-
Yes, this IS a major issue. For now, please do NOT use NUMERIC CONSTANTs in the Field Type/Value field. Bad things are happening in the PLC if you do that.
We will address this and have a proper fix in a future release.
Thanks for finding this and letting us know. It's a little more work on your side for this work-around. Sorry about that.
Did this ever get fixed?
Also, I'm having trouble adding a Device's data to a JSONBUILD Array. For example, adding $HighSpeedCounter.Acc results in Number of Elements (1) is invalid with Start of Source ($HighSpeedCounter.Acc) element
Simply copying $HighSpeedCounter.Acc to D0, then adding D0 to JSONBUILD works, but seems silly. What am I missing?
-
Did this ever get fixed?
Should be in the latest firmware. Is it not working?
Also, I'm having trouble adding a Device's data to a JSONBUILD Array. For example, adding $HighSpeedCounter.Acc results in Number of Elements (1) is invalid with Start of Source ($HighSpeedCounter.Acc) element
Simply copying $HighSpeedCounter.Acc to D0, then adding D0 to JSONBUILD works, but seems silly. What am I missing?
Yeah, that's a bug.
-
Should be in the latest firmware. Is it not working?
Heck if I know, too scared to try!
Yeah, that's a bug.
Good to know I'm not going (completely) crazy.
-
Tried it. It works in 2.7.4 firmware (see screen shot).