Potentiometer resetting its value

For general Flowcode discussion that does not belong in the other sections.
Post Reply
egearabaci
Posts: 10
http://meble-kuchenne.info.pl
Joined: Thu Sep 01, 2022 7:39 am
Has thanked: 3 times
Been thanked: 2 times

Potentiometer resetting its value

Post by egearabaci »

Whenever the flowcode closes, potentiometers reset themselfs and do not keep their set value. Is there any setting that makes program to keep the value of potentiometers?

When developing a complex project I can use up to 12-14 potentiometers. I do not want to set them every time I started the Flowcode.

Thanks.

Steve-Matrix
Matrix Staff
Posts: 1265
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 168 times
Been thanked: 279 times

Re: Potentiometer resetting its value

Post by Steve-Matrix »

There is a Built-in Function called "Connection.SetAn" which you can use to set the value of an analogue input. If you put calls to this at the beginning of your "main" routine, the potentiometers should get set to the values you specify whenever you begin simulation.

medelec35
Matrix Staff
Posts: 1457
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 513 times
Been thanked: 473 times

Re: Potentiometer resetting its value

Post by medelec35 »

Hello.
As an alternative, I have modified the Potentiometer (Colour) component.
You will need to enable Retain Value within its properties.
When you save your project the pot value should be retained.
If you would like to give the component a try then Browse to this location using file explorer, it's hidden by default so just paste the link into your address bar.

Code: Select all

C:\ProgramData\MatrixTSL\FlowcodeV9\Components
Replace the existing file with the attached file.
The flowchart will need to be refreshed if Flowcode was open when you replaced the file.
After reloading your project, if you have a project already with a lot of pots that are different, they can easily be replaced with the modified pot.
Just select the pot on the panel, right-click and select Selection then Replace.
Tick Preserve current scale and choose Potentiometer (colour).
Can you let me know how it goes, please?
Attachments
knob_color_cap.fcpx
(13.49 KiB) Downloaded 46 times
Martin

medelec35
Matrix Staff
Posts: 1457
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 513 times
Been thanked: 473 times

Re: Potentiometer resetting its value

Post by medelec35 »

whoops, sorry.
The attachment failed to get added, that has now been corrected.
Martin

egearabaci
Posts: 10
Joined: Thu Sep 01, 2022 7:39 am
Has thanked: 3 times
Been thanked: 2 times

Re: Potentiometer resetting its value

Post by egearabaci »

Thank you both for helping. Both of the solutions are worked smoothly.

Modified version of Potentiometer (colour) retained its set value.

medelec35
Matrix Staff
Posts: 1457
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 513 times
Been thanked: 473 times

Re: Potentiometer resetting its value

Post by medelec35 »

Hi, egearabaci.
Thanks for the update.
If you feel that Steve's solution is the only one required, then the modified component won't be pushed onto the update system.
Alternatively, if you like the way the modified component works, then I could update all the potentiometers and they could be available next week as some matrix staff is on holiday this week.
Martin

egearabaci
Posts: 10
Joined: Thu Sep 01, 2022 7:39 am
Has thanked: 3 times
Been thanked: 2 times

Re: Potentiometer resetting its value

Post by egearabaci »

Hi medelec35 again,

I like the way the modified component works more because its easier to implement and also new users can use it without any help. Moreover, Steve's solution adds more blocks to flow, therefore I always prefer less seen blocks because of the simplicity.
I was using the Potentiometer (slider) because of that I continued with Steve's solution. Therefore it would be nice if you can update the all potentiometers.

Thank you for your further interest.

Post Reply