How best to transfer the data to the object (when there are many).
Alarus
Posts: 48
How best to transfer the data to the object (when there are many)?
How best to transfer the data to the object (when there are many).
The first eight long words are transmitted to the optimization.
Can I transfer more than eight words long.
For example:
ModBus.Start (ADR_SLAVE, REG_OFFSET, REG_QTY, @ REG_VAL, @ REG_MIN, @ REG_MAX, PIN_RX, PIN_TX, PIN_RT, MODE, BAUDRATE)
How best to transfer the data to the object (when there are many).
The first eight long words are transmitted to the optimization.
Can I transfer more than eight words long.
For example:
ModBus.Start (ADR_SLAVE, REG_OFFSET, REG_QTY, @ REG_VAL, @ REG_MIN, @ REG_MAX, PIN_RX, PIN_TX, PIN_RT, MODE, BAUDRATE)

Comments
Then, in your parent object, use object#name to refer to the pointers:
Here's the method that uses the process:
pub startx2(count, base, posmin, posmax, pntr) | ch '' Start servo cog '' -- count is number of servo outputs (up to eight) '' -- base is first pin of contiguous group '' -- posmin and posmax expressed in microseconds '' -- pntr is address of table/array (of longs) with position start values (us) us001 := clkfreq / 1_000_000 ' ticks per microsecond count := 1 #> count <# CH_COUNT ' keep legal smin := posmin #> SVO_MIN ' set range smax := posmax <# SVO_MAX stop ' stop if already running repeat ch from 0 to (count-1) ' set starting positions set(ch, long[pntr][ch], 0) ' for each channel cog := cognew(servo8(count, base), @stack) + 1 ' launch servo cog return cogOne might use it like this:
The default positions are contained in the master program like this:
dat ' Starting positions for servos when driver is loaded ServoDefaults long 1_500, 1_500, 1_500, 1_500 long 1_500, 1_500, 1_500, 1_500...and in the object...
The vars must all be of the same type and grouped the same in both the parent and object, but this allows you to refer to the parameters by variable name in both environments instead of using long[address+offset].