Page 1 of 1

Need help with turning this idea into a flow code

Posted: Sat Apr 28, 2018 7:52 pm
by Emadex3
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 !

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

Posted: Sun Apr 29, 2018 8:53 am
by EtsDriver
What have you allready tried? Could you post your flowchart?

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

Posted: Sun Apr 29, 2018 12:03 pm
by Emadex3
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.

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

Posted: Mon Apr 30, 2018 9:52 am
by Steve
This kind of problem can be solved using a state machine. Some examples are here:

https://www.matrixtsl.com/wikiv7/index. ... ateMachine

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

Posted: Mon Apr 30, 2018 1:25 pm
by Emadex3
Steve wrote:This kind of problem can be solved using a state machine. Some examples are here:

https://www.matrixtsl.com/wikiv7/index. ... ateMachine
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 !

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

Posted: Mon Apr 30, 2018 1:55 pm
by Steve
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.