[3.5.0-rc.1] integer conversion when passing parameters to macro
-
Hi all
I have this macro:
Running M908 P21.0 yields:
As you can see the "zero" decimal is lost.
M908 P21.1 works fine:
This is a problem to me because I want to pass a board address+driver number (board 21, driver 0) to a custom macro.
M122:=== Diagnostics === RepRapFirmware for Duet 3 MB6HC version 3.5.0-rc.1 (2023-08-31 16:19:24) running on Duet 3 MB6HC v1.01 (SBC mode) Board ID: 08DJM-9P63L-DJ3S0-7J1F8-3S86T-TBJZ8 Used output buffers: 1 of 40 (22 max) === RTOS === Static ram: 154852 Dynamic ram: 90380 of which 1588 recycled Never used RAM 96244, free system stack 196 words Tasks: SBC(2,ready,0.9%,408) HEAT(3,nWait,0.0%,325) Move(4,nWait,0.0%,258) CanReceiv(6,nWait,0.1%,771) CanSender(5,nWait,0.0%,335) CanClock(7,delaying,0.0%,351) TMC(4,nWait,8.2%,59) MAIN(2,running,90.6%,137) IDLE(0,ready,0.2%,30), total 100.0% Owned mutexes: HTTP(MAIN) === Platform === Last reset 00:19:44 ago, cause: software Last software reset at 2023-09-29 10:13, reason: User, Gcodes spinning, available RAM 96340, slot 0 Software reset code 0x6003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x0043c000 BFAR 0x00000000 SP 0x00000000 Task SBC Freestk 0 n/a Error status: 0x00 Aux0 errors 0,0,0 MCU temperature: min 37.5, current 37.8, max 38.4 Supply voltage: min 24.1, current 24.1, max 24.2, under voltage events: 0, over voltage events: 0, power good: yes 12V rail voltage: min 12.0, current 12.0, max 12.1, under voltage events: 0 Heap OK, handles allocated/used 99/14, heap memory allocated/used/recyclable 2048/720/412, gc cycles 0 Events: 0 queued, 0 completed Driver 0: standstill, SG min n/a, mspos 8, reads 21083, writes 17 timeouts 0 Driver 1: standstill, SG min n/a, mspos 8, reads 21083, writes 17 timeouts 0 Driver 2: standstill, SG min n/a, mspos 8, reads 21083, writes 17 timeouts 0 Driver 3: standstill, SG min n/a, mspos 8, reads 21079, writes 21 timeouts 0 Driver 4: standstill, SG min n/a, mspos 8, reads 21089, writes 11 timeouts 0 Driver 5: standstill, SG min n/a, mspos 8, reads 21083, writes 17 timeouts 0 Date/time: 2023-09-29 10:33:26 Slowest loop: 66.15ms; fastest: 0.05ms === Storage === Free file entries: 20 SD card 0 not detected, interface speed: 37.5MBytes/sec SD card longest read time 0.0ms, write time 0.0ms, max retries 0 === Move === DMs created 125, segments created 3, maxWait 86529ms, bed compensation in use: none, height map offset 0.000, ebfmin 0.00, ebfmax 0.00 no step interrupt scheduled Moves shaped first try 0, on retry 0, too short 0, wrong shape 0, maybepossible 0 === DDARing 0 === Scheduled moves 6, completed 6, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 6], CDDA state -1 === DDARing 1 === Scheduled moves 0, completed 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1 === Heat === Bed heaters 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0 Heater 4 is on, I-accum = 0.0 === GCodes === Movement locks held by null, null HTTP* is doing "M122" in state(s) 0 Telnet is idle in state(s) 0 File is idle in state(s) 0 USB is idle in state(s) 0 Aux is idle in state(s) 0 Trigger* is idle in state(s) 0 Queue is idle in state(s) 0 LCD is idle in state(s) 0 SBC is idle in state(s) 0 Daemon* is idle in state(s) 0 0, running macro Aux2 is idle in state(s) 0 Autopause is idle in state(s) 0 File2 is idle in state(s) 0 Queue2 is idle in state(s) 0 Q0 segments left 0, axes/extruders owned 0x10000003 Code queue 0 is empty Q1 segments left 0, axes/extruders owned 0x0000000 Code queue 1 is empty === CAN === Messages queued 10817, received 66345, lost 0, boc 0 Longest wait 57ms for reply type 6041, peak Tx sync delay 35059, free buffers 50 (min 49), ts 5924/5923/0 Tx timeouts 0,0,0,0,0,0 === SBC interface === Transfer state: 5, failed transfers: 0, checksum errors: 1 RX/TX seq numbers: 46664/46664 SPI underruns 1, overruns 0 State: 5, disconnects: 0, timeouts: 0 total, 0 by SBC, IAP RAM available 0x25a98 Buffer RX/TX: 0/0-0, open files: 0 === Duet Control Server === Duet Control Server version 3.5.0-rc.1 (2023-09-01 07:16:31) Daemon: Buffered code: G4 P100 Buffered codes: 32 bytes total >> Doing macro daemon.g, started by system >> Number of flush requests: 1 Code buffer space: 4096 Configured SPI speed: 8000000Hz, TfrRdy pin glitches: 1 Full transfers per second: 39.44, max time between full transfers: 193.5ms, max pin wait times: 36.5ms/7.3ms Codes per second: 3.55 Maximum length of RX/TX data transfers: 5504/1244
-
I just tested this on my Mini 5plus and it works over there:
So it might be a SBC related problem?Edit: Mini is on 3.5.0-rc.1 as well
-
Could be SBC
On my Duet 2 standalone I tried three ways
And the results
Note that wrapping in curly brackets and multiplying by 1.0 forced a decimal place to be returned even when one wasn't passed
-
@OwenD
This doesn't work for me, not even just in the console:
Edit:
Mini without SBC works fine:
-
@nikscha one for @chrishamm
-
@nikscha Your values remain floats if you specify a dot-separated number, they're just output as integers by
echo
. I need to check how we can unify the output formats, but I cannot promise that I will implement that change before v3.5 stable.Either way, setting the driver using a float variable in SBC mode does work on my setup. If it doesn't on yours, please provide a full test macro.
-
Weird, it doesn't work for me:
I define
M908.g
like this:M569.4 P{param.P} T0
and call
M908 P21.0
:
-
@nikscha Interesting, I only checked using variables and not parameter letters, I'll have a look at it.
M908 P{21.0}
should work, though. -
@chrishamm using curly brackets works, thank you!