I need a specific function for a project that creates a string of decimal or hex values from a delimited string and outputs the number of separators.
Is it possible to create a component that returns these two values?
I always get only a "return value".
Has anyone ever tried this and can give me some tips?
In the attached file is an example of the function, the return values are here SepCount (number of separators) and StrArray (string with decimal or hex data).
Thanks for any help!
Christina
How to create a component with multiple return values
Moderator: Benj
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
Re: How to create a component with multiple return values
Christina,
Not sure however this might help you to understand how you can create your own components that can do what you need Hope this helps
http://www.matrixtsl.com/mmforums/viewt ... 63&t=17975
Not sure however this might help you to understand how you can create your own components that can do what you need Hope this helps

http://www.matrixtsl.com/mmforums/viewt ... 63&t=17975
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
Re: How to create a component with multiple return values
Thanks for the answer!
I've looked at everything I've found about component creation. I need a function, where I can pass parameters in the flowchart (as with a display or RS232 or similar), this example does not seem to work. The calculation is made when you enter it in the Properties window. The examples just provide only one return value, which is too little for me. I would like to keep the programming a bit more compact and not have so many macros, which are also very complex in the simulation.
Christina
I've looked at everything I've found about component creation. I need a function, where I can pass parameters in the flowchart (as with a display or RS232 or similar), this example does not seem to work. The calculation is made when you enter it in the Properties window. The examples just provide only one return value, which is too little for me. I would like to keep the programming a bit more compact and not have so many macros, which are also very complex in the simulation.
Christina
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
Re: How to create a component with multiple return values
Hi Christina,
A component can only return one value. A work around if your values are < 256 and > 0 could be to use an string and use the first element of the string for the first return value, the second for a second return value etc. An other way would be to use a global variable, set it in the macro and copy the value immediately after calling the macro (that macro should not be called from an interrupt or horrible things will happen).
Best regards,
Jac
A component can only return one value. A work around if your values are < 256 and > 0 could be to use an string and use the first element of the string for the first return value, the second for a second return value etc. An other way would be to use a global variable, set it in the macro and copy the value immediately after calling the macro (that macro should not be called from an interrupt or horrible things will happen).
Best regards,
Jac
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis