News:

  • October 20, 2026, 05:22:46 AM

Login with username, password and session length

Author Topic: JSONBUILD Bug Check  (Read 11389 times)

RBPLC

  • Hero Member
  • *****
  • Posts: 586
JSONBUILD Bug Check
« 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?     

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6177
  • Yes Pinky, Do-more will control the world!
Re: JSONBUILD Bug Check
« Reply #1 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.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6177
  • Yes Pinky, Do-more will control the world!
Re: JSONBUILD Bug Check
« Reply #2 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.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

RBPLC

  • Hero Member
  • *****
  • Posts: 586
Re: JSONBUILD Bug Check
« Reply #3 on: April 19, 2020, 02:43:40 PM »
Thanks BobO, you guys are great!

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6177
  • Yes Pinky, Do-more will control the world!
Re: JSONBUILD Bug Check
« Reply #4 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.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

RBPLC

  • Hero Member
  • *****
  • Posts: 586
Re: JSONBUILD Bug Check
« Reply #5 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

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6177
  • Yes Pinky, Do-more will control the world!
Re: JSONBUILD Bug Check
« Reply #6 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.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

RBPLC

  • Hero Member
  • *****
  • Posts: 586
Re: JSONBUILD Bug Check
« Reply #7 on: April 30, 2020, 06:08:01 PM »
Thanks BoBO. Appears to be working like you would expect it to.