Page 1 of 1

Macro 2x Return value floating

Posted: Thu Feb 14, 2019 9:08 am
by Monie Jacobsen
Hi Flowcode Team

Want Macro with 2x Return value floating?
Please see below the picture where I have tried to illustrate the question!
Macro And Return.PNG
(41.26 KiB) Downloaded 613 times
Do you have a suggestion on how this can be done with the 2x Variables so that the values can be used elsewhere in the codes?

See attached file:
MIAC dsPICSetting Return value floating.fcfx
(109.31 KiB) Downloaded 185 times

Re: Macro 2x Return value floating

Posted: Thu Feb 14, 2019 10:22 am
by Benj
Hello Monie,

You cannot return more then one value.

The easy way is to hold the values inside global variables and then have a second macro with an index parameter that allows you to specify which of global variables you want to read back. The Accelerometer type components are done like this.

Another way is to pass an array of floats as a parameter to the macro. You can then edit the values inside the array using the macro and the values will be present inside the array when you leave the macro.

Re: Macro 2x Return value floating

Posted: Thu Feb 14, 2019 12:26 pm
by Monie Jacobsen
HI Benj
Thank you very much for your description.
Just as I would work with Flowcode v8 and MIAC dsPIC, I couldn't upload the codes to this device.