Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: RBPLC on April 19, 2020, 01:40:11 PM

Title: JSONBUILD Bug Check
Post by: RBPLC on April 19, 2020, 01:40:11 PM
Please check the following for a bug (or maybe I'm not understanding how the command is designed to work). Running 2.7.3 of DmD.

Let's say I've built a UDT and am using it in a memory block named "exp". UDT has 6 bit fields: f1,f2,f3,f4,f5,f6. Within JSONBUILD I've selected [Array] and then within Edit Step #1 Array Element I've selected Numeric with exp0.f1 and Number of Elements as 4. After saving this the Source cell displays exp0.f1-exp3.f1 and the count cell displays 4. I'm outputting to SS20. The JASONBUILD is building the string as: [exp0.f1, exp0.f2, exp0.f3, exp0.f4]. I would expect it to build it as: [exp0.f1, exp1.f1, exp2.f1, exp3.f1]. Is this a bug or am I misunderstanding how this is supposed to work with a UDT?     
Title: Re: JSONBUILD Bug Check
Post by: BobO on April 19, 2020, 01:53:29 PM
I think it's probably not supposed to be permitted at all. I don't think we had planned on allowing struct fields in an array. It probably wouldn't be that hard to make it work like you are hoping though.
Title: Re: JSONBUILD Bug Check
Post by: BobO on April 19, 2020, 02:15:06 PM
Well, it does appear that DmD thought this should work, but the firmware guy wasn't in agreement. It was easier to add it to the firmware than to remove it from DmD.  ;)

(Un)fortunately we are going to have another 2.7 firmware release early this week, due to a bug in the RIO support for Host's new analog, so this addition will be in 2.7.4.
Title: Re: JSONBUILD Bug Check
Post by: RBPLC on April 19, 2020, 02:43:40 PM
Thanks BobO, you guys are great!
Title: Re: JSONBUILD Bug Check
Post by: BobO on April 19, 2020, 02:46:17 PM
Thanks BobO, you guys are great!

You're welcome! It was an easy fix. I came in to grab a cup of joe, and was just sitting here anyway.
Title: Re: JSONBUILD Bug Check
Post by: RBPLC on April 21, 2020, 04:35:21 AM
Somewhat related, how difficult would it be to incorporate a MATH function like SUMR that would operate on a UDT? Example:

SUMR(exp0.f1,3) = exp0.f1+exp1.f1+exp2.f1
Title: Re: JSONBUILD Bug Check
Post by: BobO on April 21, 2020, 07:52:27 AM
Somewhat related, how difficult would it be to incorporate a MATH function like SUMR that would operate on a UDT? Example:

SUMR(exp0.f1,3) = exp0.f1+exp1.f1+exp2.f1

That isn?t quite so straightforward.
Title: Re: JSONBUILD Bug Check
Post by: RBPLC on April 30, 2020, 06:08:01 PM
Thanks BoBO. Appears to be working like you would expect it to.