I rewrote it using Designer (instead of just typing it from my head) and included the Array generation also as part of the code-block (D42 will contain the BYTE length of the final ASCII JSON array text in ArrayBuff block of BYTEs). See the attached "screen shot".
You probably want to import this into its own project first to look at it, then open up your project and then enter it into your project. Use File->Import->Project.
// Ver(103) PCU(4) Do-more Designer Clip Source Project: C:\Users\Public\Documents\Do-more\Designer2_8\Projects\MyUDT1 Format: Do-more Designer 2.00+ DO-MORE Ladder
PLC BX-DM1E-18ED13
$PRGRM GenArray
SG GenArray.S0
MOVE 0 V1
JMP GenArray.S1
SG GenArray.S1
STRE MyFIFO.Depth 0
JMP GenArray.S10
NOT
JMP GenArray.S2
SG GenArray.S2
STRGE V1 32
JMP GenArray.S99
NOT
FIFOUNLOAD MyFIFO FIFOBlock0 V0 0x1
JSONBUILD 0x0 "4 ""FieldA"" 0x1 UserBlock[V0].FieldA DST511 ""FieldB"" 0x1 UserBlock[V0].FieldB DST511 ""FieldB1"" 0x1 UserBlock[V0].FieldB1 DST511" Obj[V1] DST511 1 DST511
INC V1
JMP GenArray.S1
SG GenArray.S10
JSONBUILD 0x1 "4 SS0 0x2 Obj0 V1" SS0 ArrayBuff0 6000 D42
EXIT
SG S99
// it will hang here if this error ever occurs, you could put a SET C99/EXIT to terminate the code block in SG S99, but this should never happen.
$PGMEND GenArray
#BEGIN UDT_CONFIG
MyUDT
// Field Name, Data Type, Memory Layout, Read/Write, Display Format, Data View Detail
FieldA, BIT, 0:0, Read-Write, Native, Short
FieldB, BIT, 0:1, Read-Write, Native, Short
FieldB1, BIT, 0:2, Read-Write, Native, Short
#END
#BEGIN MEM_CONFIG
UserBlock MyUDT decimal 32
FIFOBlock UWORD decimal 32
Obj STRING148 decimal 32
ArrayBuff UBYTE decimal 6000
GenArray PROGRAM 0 -1
MyFIFO QUEUE 0
#END