Macro 2x Return value floating

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Macro 2x Return value floating

Post 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 166 times
Best Regard
Monie

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Macro 2x Return value floating

Post 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.

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: Macro 2x Return value floating

Post 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.
Best Regard
Monie

Post Reply