12/1/2014 4:52 PM | |
Posts: 5225 Rating: (1197) |
Dear eisenpferdreiter, Thank you for replying to Paras' question. I am very interested in your ideas for this puzzle, I hope to read more. Please notice that the S7-1200 PLC is being used for this solution, so not GRAPH. It would be interesting to see how the individual DBs are recalled. Please read again through the requirements.. * 5 possible tasks each can have 4 parameters * a task-recipe can be configured by the operator (a guess) * a task-recipe can combine and repeat of the 5 tasks in any order * each of the requested tasks can have its own parameter values * the KTP600 is used to configure the task-recipe (a guess) I have made an attempt in an earlier thread and would be happy to see other ideas. (no sarcasm intended) Regards. w LATE NOTE.. same type question by other user [LINK] |
Last edited by: William B. at: 12/2/2014 5:41 AMsome points are guess work not facts Last edited by: William B. at: 12/1/2014 4:59 PMadd late note |
|
12/1/2014 7:56 PM | |
Posts: 21 Rating: (0) |
Hellohuggy_d1! Thanks for that, I'm working on that but i need a little hint or a demo program on sequencing. it'll be very helpful if you can provide me one. and this project will be implemented in a real machine and checked for bugs or any problems so i need to do it perfectly |
12/1/2014 8:30 PM | |
Joined: 7/7/2010 Last visit: 12/9/2024 Posts: 15479 Rating: (2455)
|
I have posted how I write sequencing many times in these forums using a very simple and "old-school" approach that is PLC brand neutral. I use two integer values to detect and set my current state. I compare the current state with a state within the sequence to activate a single step in the state machine per plc scan. After all the states have been checked and a potential next state is activated, I copy the new state to the state machine master. ----><----- --- pseudo code can be done in LAD/FBD or SCL if (state == 0) and (process_run) then next_state = 100 endif if (state = 100) then // handle initialization of system, delay as needed for system to stabilize ... next_state = 110 endif if (state = 110) then // handle step 2 of init .. next_state= 199 endif if (state = 199) then // clean up init stuff next state = 200 endif if (state = 200) then if (setup_complete) then next_state = 300 else next_state = 210 end_if end_if if (state = 210) then // perform system setup as required // scale or calibration types of activities // take input from hmi and scale as required // include as many states in 200 as needed .. next_state = 299 end_if if (state = 299) then setup_complete = true; next_state = 300 end_if if (state = 300) then // run process loop // set up for running // next_state = 310 end_if if (state = 310) then // step 1 of running ... next_state = 320 end_if ... same for 320-xxx as many tiny steps as you need ... if (state = 399) then // clean up from running // call shutdown routine ... next_state = 900 end_if if (state = 999) then // we are done running and ready to sit in manual mode // setup for manual mode ... next_state = 0 end_if /// this is the most critical step and needs to be the last state related statement state = next_state -----><---- Your HMI needs to activate functions that setup the system (100/200 sections of the above state machine), and trigger automatic running mode (300+), and also trigger stopping automatic mode. Supervisor of the block containing this state machine would handle e-stop and fault handling. This is strictly the process functions. You also need something that handles startup and fault recovery, but that is possibly outside the scope of your week unless it is your only task for the next week is this project. I think you see how this is PLC manufacturer neutral in that it uses no special instructions and it is dirt simple to create and copy/paste to create lots of states. In LADder, each network or rung is the "if" clause with a compare == instruction comparing current state to a hard-coded value. Keep 10 between your states so if something comes up, you can add up to 9 states between your existing states in a hurry..... |
science guy |
|
Follow us on