Hi
Nice problem!
Smersh is right when he say that the 1st setp is choose the I/O for your program.
i)1 position switch input for each floor , x2 elevator = 40
Input1, Input2, etc...
You may convert this information into 2 decimal variable with the number of the floor of each elevator.
ii) Pushbuttons for Up/Down 2 x 20 x 2 = 40
Funny 2 x 20 x 2 = 40 ?????
You need one Up and one Down buttons for floor, 2 x 20 =40
Again you may convert this info into one decimal variable with the floor number and one binary variable with the up or down.
iii) Outputs to Drive elevators Up and Down, 2 x2 = 4
No comment
iv) Analogue input for Floor selection in Elevator (use BCD input
Binary Coded Decimal) X2 = 2.
If you only want that the lift go to the right floor you can forget this part.
Step 2
When someane call the lift, the program make the difference (SUB) between the position of elevator 1 and the floor of the call and the diference between the elevator 2 and the floor of the call.
Then se the minor diference.
Try this