Speak with authority, quality is trustworthy.

PLC S7 - 200 subroutines should be how to modify the detailed description skills -

by:Coolmay     2020-07-22
S7- 200 subroutine SUB, once written, after use in the program, you can't change its input/output pin. Because once you move the pin interface, call the subroutine, would be an error.

after an error couldn't and STEP7 can alter by updating the update only part of the same. Only the normal processing of the original call out, call from scratch, and distribution of each variable for each interface.

this is quite annoying.

let's say I an at the bottom of the device, if need to add some functionality found in debugging, it inevitably has decided to increase the interface. And I have to call the equipment in the main program for dozens of times, it is must to dozens of instances are again.

and this is not the end.

who can guarantee that a change in the interface is the last time? Next time if you still need to modify, you need to be the same again.

estimates in who, all can not stand this.

and this is the big fear of standardized programming.

seems to many people have misunderstanding of standard word, see I put forward the standardization, some are unconvinced. You Wan Mou have he2 de2 he2 ability standard is put forward, the ans intellectual talent is as good as you, why should follow the standard of your proposed with what with you instead of my own standard? In the history of our country because of technical standard one step behind others and eat the kui big. Can't make the mistake that!

and there are some other people, have no way to do it emphasizes uniform standards. The reason is that device configuration differ in thousands ways, not the same equipment, so do not standardized.

wrong! Are all belong to the misunderstanding of standardization. We pursue the standardization of the same standard module is to put the system to make the building blocks, each module, sui generis noninterference logic. Docking module through the interface with other system, different system design, under the condition of the interface remains the same, only need to replace the corresponding module, which can realize the rapid assembly.

and interface, also is not a constant, of dust can be modified at any time according to need, and at the interface changes, only local changes between docking module, do not affect the whole system. Don't because of the changes of the interface, and require the system to debug.

, even now I promote standardization of the second phase of the sample project, after the next plan is the optimization and upgrading of the interface. In the past, I in the development phase, the interface just borrow others did, and now finally have the energy, to, to transform interface is satisfied for me.

and my team members, and I don't need to worry about the change of the interface will lead to affect the operation of the existing logic module, even with a bug.

this is the advantage of standardized design. Heart not tired. Does not need to be same as before, the program changes a little bit nervous, worried that the function of the normal operation of the whole system was to collapse.

so, when I was in the development of SMART 200 standardized framework, first realized subroutine ( Library function) This is a big problem of interface can not be changed. And that is likely to be many people are not willing to put effort in SMART 200 system for the main reason for the standardization.

so first have to solve this problem.

and implementation method, actually very simple.

it is using the export function block, the call is change the subroutine of exported as AWL text file:

and then in the call of a text file, modified to conform to the new version of the function of syntax, import again.

there is a problem is that whether import or export, before operating software will automatically compile, compiled by can. Before so export must modify interface, and after the modification of interface, the import before, need to first remove redness in the corresponding SUB paragraph.

thus real-time inventory backup is very important. Never begin a subroutine interface change logic, but later found both cannot export and import, that's embarrassing.

since the AWL document is absolute addressing, so the interface is friendly enough. I usually change stage, the text just grammatically correct, such as increasing the numerical variables, first fill in AC0, if it is a discrete variable, the input L0 temporarily. 0, after successful import, under the ladder diagram interface, according to the actual demand, change the variables for the correct.

of course, if possible, try to directly replace with search such as the original 'AC0' replaced by 'AC0, AC0'. The speed will be a lot faster.

so, in the use of standard specification also contains the same type of device objects, as far as possible in the same SUB calls. Such export modify interfaces only do it when a file. Without the scope of the entire program to find, to export the whole procedure of the SUB to modify by hand.

as son, will still be very tired.

Chat Online
Chat Online
Chat Online inputting...
Sign in with: