Need help with turning this idea into a flow code

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Emadex3
Posts: 3
Joined: Sat Apr 28, 2018 7:43 pm
Has thanked: 3 times
Contact:

Need help with turning this idea into a flow code

Postby Emadex3 » Sat Apr 28, 2018 7:52 pm

suppose there are 4 inputs that are "push to make" buttons:
input 1 will have the variable "A" assigned to it
input 2 will have the variable "B" assigned to it
input 3 will have the variable "C" assigned to it
input 4 will have the variable "D" assigned to it

I want to be able to get an output that follows the inputs but in order , Example :
I press input 1 than input 2 than input 1 ------> output 1 (ABA = output 1 )
I press input 1 than input 3 than input 2 ------> output 2 (ACB = output 2 )

( the output follows the order in which inputs where given)
any general idea on how to apply this I will be really gratful

I really appreciate your help !

EtsDriver
Valued Contributor
Valued Contributor
Posts: 413
Joined: Tue Apr 15, 2014 4:19 pm
Location: Kajaani, Finland
Has thanked: 328 times
Been thanked: 211 times
Contact:

Re: Need help with turning this idea into a flow code

Postby EtsDriver » Sun Apr 29, 2018 8:53 am

What have you allready tried? Could you post your flowchart?
These users thanked the author EtsDriver for the post:
Emadex3 (Mon Apr 30, 2018 12:44 pm)
Rating: 5.26%
 
Ill just keep the good work up!

Emadex3
Posts: 3
Joined: Sat Apr 28, 2018 7:43 pm
Has thanked: 3 times
Contact:

Re: Need help with turning this idea into a flow code

Postby Emadex3 » Sun Apr 29, 2018 12:03 pm

EtsDriver wrote:What have you allready tried? Could you post your flowchart?


I have tried some but all failed due to the processor not being able to register the push from the "push to make button"
please note that it has to be a push to make button

today I've been browsing my old flowcode charts and came across this one as I think I may be able to use it for my purpose, it is a flowchart for door lock but it was very large and thus unpractical (flowcode v3 was used to make this one)
my idea is to register every button click the same way as in this doorlock chart.
Attachments
doorlock.fcf
(11 KiB) Downloaded 43 times

User avatar
Steve
Matrix Staff
Posts: 3073
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 87 times
Been thanked: 387 times
Contact:

Re: Need help with turning this idea into a flow code

Postby Steve » Mon Apr 30, 2018 9:52 am

This kind of problem can be solved using a state machine. Some examples are here:

https://www.matrixtsl.com/wikiv7/index.php?title=FiniteStateMachine
These users thanked the author Steve for the post (total 2):
Emadex3 (Mon Apr 30, 2018 12:45 pm) • medelec35 (Fri Jul 20, 2018 11:38 pm)
Rating: 10.53%
 

Emadex3
Posts: 3
Joined: Sat Apr 28, 2018 7:43 pm
Has thanked: 3 times
Contact:

Re: Need help with turning this idea into a flow code

Postby Emadex3 » Mon Apr 30, 2018 1:25 pm

Steve wrote:This kind of problem can be solved using a state machine. Some examples are here:

https://www.matrixtsl.com/wikiv7/index.php?title=FiniteStateMachine


is there is a v5 for the fcfx files ?, if so please provide me a link
You've already done a lot for me , THANK YOU !

User avatar
Steve
Matrix Staff
Posts: 3073
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 87 times
Been thanked: 387 times
Contact:

Re: Need help with turning this idea into a flow code

Postby Steve » Mon Apr 30, 2018 1:55 pm

No, I do not have a specific v5 program, but using your example:

Emadex3 wrote:I press input 1 than input 2 than input 1 ------> output 1 (ABA = output 1 )
I press input 1 than input 3 than input 2 ------> output 2 (ACB = output 2 )


STATE_0 would be the starting state. Pressing input 1 (A) would move to STATE_1

STATE_1 would be when A is pressed. In this state, pressing "B" would move to STATE_2, and pressing "C" would move to STATE_3. Pressing something else would probably reset to STATE_0 (although you might want a press of "A" to automatically move to STATE_1).

STATE_2 would be when "A" then "B" has been pressed. Pressing "A" again from this state should cause "output 1" to fire. Pressing something else would probably reset to STATE_0.

STATE_3 would be when "A" then "C" is pressed. Pressing "B" from this state would trigger "output 2".

To create a program for this, you'd need to keep track of a variable for "state" that moves between the different states when the appropriate input has occurred.
These users thanked the author Steve for the post (total 2):
Emadex3 (Mon Apr 30, 2018 4:51 pm) • medelec35 (Fri Jul 20, 2018 11:38 pm)
Rating: 10.53%