12/1/2014 4:52 PM | |
Posts: 5225 Rating:
|
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:
|
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: 9/10/2025 Posts: 16084 Rating:
|
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 |
|
12/2/2014 3:08 PM | |
Posts: 1058 Rating:
|
^ Hello William, sorry, I did not know that GRAPH cannt be used with S7-1200. But a sequence can be programmed as a ladder as well, its just more work and of course not so well arranged as in GRAPH. Correct me, if I overlook something, but I basically see the problem as a sequence, consisting of many stages, where each stage is one of 5 alternate subsequences (tasks). For each stage there will be a parameter set in a DB. So there would be a DB for parameters of first stage. To which task it will apply is defined by a recipe value that defines the task of first stage. It could even be defined by a parameter, that the selected task has to be repeated for a certain number of times. Then the next recipe value determines the alternate task for the second stage. Second stage parameter set will be in DB for second stage, and so on. Thus, If I understood it right, you would get a sequence consisting of a certain maximum amount of stages. Each stage has its parameter DB and consists of an alternate of 5 subsequences. Which alternate in what stage has to be done is determined by the recipe, by setting a stage task value for each stage in recipe. Thus you could define any combination of the 5 tasks with different parameters and could even repeat a task within the same stage, but then with same parameters. Each task could be programmed as a sequence only once and then be called by the recipe sequence, as the task would never run parallel as I understood. I hope I could explain my idea and have not overlooked something. regards |
Last edited by: eisenpferdreiter at: 12/2/2014 3:29 PM |
|
This contribution was helpful to
1 thankful Users |
12/6/2014 12:08 PM | |
Posts: 21 Rating:
|
Hello All ! Thanks for all your help ! I've understood all your guidelines and build a Ladder program for my work by using only one DB in which defining all the Recipes (35) as STRUCT and Steps (70) as there ARRAYS and parameters respectively. I've also presented this project to my Boss and he is happy with my work thanks to you guys :-) But still it has a problem which they've not notices but i know it :-P
[snip] ... -------- new question split to a seperate thread with the subject saveing my recipes, STEPS and PARAMETERS permanently |
Last edited by: Min_Moderator at: 12/8/2014 9:29 AMLast edited by: CS Moderator at: 12/7/2014 7:56 PMsplitting |
|
Follow us on