Sign in to follow this  
Followers 0
Sleepy Wombat

Clarify some programming issues

12 posts in this topic

I am currently painfully modding an existing Siemens PLC program on an S7 300 with step 7 5.4. I would like a quick couple of pointers thanks. If I wanted to set a dbxx.dbdxx real number to 0.0 can I use the MOVE function or do I need to do a multiply by 0.0 etc, the reason I ask is in the program they have previously used the MOVE function to move a Real to a Real so I was wondering if I could use the same to set the val to 0.0. secondly, I found out the hard way if you don;t download the DB and an OBI Kenobi accesses this area then the PLC faults and crashes. Won;t do that again. So my question is simply, I create an initial value for the dbxx.dbdxx and then download the db file. Initially the values i load into the addresses are downloaded to the PLC as I have used a couple in the OBI and can see their value. I then ""offline" change the inital vals in the same db file and proceed to download it, however when I monitor the OB1 the values of the dbxx.dbdxx are still the same as previously.. WTF.... Could some one please explain to me how to change the values while online, for testing.... I am going to have citect address these locations to change them and I wanted to debug to test first. Also, how could you change the SV of a timer from Citect ? In omron i would simply make the addrees of the timer sv look at a data memory location rather then a integer value. Citect could then also look at the timer to get the PV value. or Ab .ACC etc... Also, is there a limitation on the number of addressable timers in a s300 ladder logic program, i tried a timer value of t130 and the programmed crashed, yet a timer value of t41 or t42, or t43 were ok. Appreciate the help.. Regards a frustrated sleepy wombat.
1 person likes this

Share this post


Link to post
Share on other sites
The number of S7 timers available is dependant on the CPU that you are using. However if you use the SFB4 then the limitation is the available memory. Change the SV to the M or DB.DBW area with the format S5Time. Are you trying to modify an existing DB? If so then there should not be a problem. If new then you will have to download it to the CPU before your program accesses it. Create a VAT - here you can monitor and modify variables. Yes you can use the MOVE to transfer a real value of 0.0. Move can be used with All elementary data types with a length of 8, 16, or 32 bits - I, Q, M, L, D or constant Edited by Moggie

Share this post


Link to post
Share on other sites
Just learning the Siemens world, coming from Misubishi/AB world, and it's taking some getting used to. I feel your pain! 1.) Yes, you can use MOVE to initialize a variable. 2.) Most of the memory in an S300 is retentive by default. Initial values are used if you use the switch on the front of the PLC to reset the retentive memory. To online modify values, you need to creat a value table (can't remember offhand which menu), and the addresses you want to look at, and go online. Then you can use the "Modify" column to set values. Put the value you want in that column, then click the modify button in the toolbar. This will take all non-blank values in the modify column and write them to the corresponding address. Note that you have the "all-the-time" option and the "once" option. Takes a little getting used to. 3.) Siemens timers are frankly weird. There are a limited number of fixed memory timers available. Then there are special function blocks available that you can set up which emulate AB timers. I still don't quite understand the fixed memory timers. The special function block timers should have a preset value address that you can change. The S5Time format is a "simple" way to enter timer values. It is then stored as a 4-digit Hex, where the first digit indicates the resolution of the timer, and the rest is a three digit BCD preset (max of 999). So 1234 would be a 100ms timer with a preset of 234 (i.e. a 23.4 second timer). Since you're sending values from another system, it'll be better to just use that format. The available resolutions are 0=10ms, 1=100ms, 2=1s, 3=10s. Edited by JRoss

Share this post


Link to post
Share on other sites
Thanks for the feedback... While Siemens has some merits in the use of FC's blah blah blah reusable code... I find the programming not to be intuitive at all I am afraid. I have also seen other comments on forums how a user has been using them for two years after previously using AB et.al and believes they are better... but hello... it has taken him two years to pick it up properly... the editing/adding of branching etc and having to use a mouse (while edititing in ladder, and lets face it a picture is worth a thousand words) for every thing is slow and painful also. Mabey I need to take some PILZ and have a lie down. the logo is good, The direction of the 1200 is good (albiet no real online editing) 300 / 400, PLC's and programming software should not be this anal and troublesome in this day and age, I feel like i am programming in a polished DOS enviroment and I don;t want to be forced to program like Fortran etc... I must rant, if i don't then i become a very cranky wombat.
1 person likes this

Share this post


Link to post
Share on other sites
I decided to learn Siemens as a business decision. I'm beginning to work with a local Siemens distributor on some of their other lines, and wanted to make myself more valuable to them. As part of my "training", I went to a three day "AB to S7" class several weeks ago, using the S300 and current Step 7. My impression is pretty much in line with what you're saying. When I started learning AB after years of Mitsubishi, everything came easily. During the Siemens class, I kept trying to jump ahead and play around whenever I finished an exercise early. I kept being frustrated and having to wait till we covered whatever I was trying to do. Some of the same stuff you're asking about. The instructor gave a little historical tidbit that relates. Apparently maintenance jobs in Germany (and western Europe in general?) are higher level jobs that require a technical degree. Boolean logic and function block style programming are part of the curriculum and well understood. So they developed their programming around that model. In the US, maintenance personnel by and large are electricians, so the visual ladder logic was developed, and our programming is based on that. When Asia started automating, they mainly got older equipment from the US, so they followed suit. It took Siemens years to realize that 2/3 of the world simply think differently than they do, so they're a bit behind the 8-ball. About a week after the training, I attended a presentation on the new Step 7 with the 1200, and I was pleased to see that there have been many improvements. A huge step in the right direction, IMO.

Share this post


Link to post
Share on other sites
Regarding the AB/Siemens part of the debate, I generally read the 'Siemens is confusing' to 'It's not Allen Bradley'. Siemens do it different, once people are used to Siemens most regard it as better, I know, I followed that exact path many years ago. Sleepy, which PLC are you using, the S7-300 range can be quite different, the S7-318 and 319 for example are S7-400's in 300's clothing. As people have mentioned you can use the MOV instruction, myself for something simple I preset and/or reset a lot of things clumped together and use STL such as L 0.0 .... T dbxx.dbdxx. As far as crashing a PLC when loading DB's, yes the program will crash if its asked to do something and its not there, but you can disable this, either permenantly or temporarilily by adding OB121 to the PLC program, this will only enable a stop of the PLC if you add the SFB 'STP' to the OB. This OB can be removed from the PLC after you finished commissioning or modifications by going on-line and deletiong the OB (remember to remove from project too if you saved it). VAT tables are used to modify values, THIS IS NOT A FORCE, if the program wants to change it, it will. There is a Force Table used for forcing IO. Timers, limited depending on the S7-300 model, but as someone mentioned SFB4 (TON - Time ON) and SFB5 (TOF - Time OFF) are available, the drawback of using these is the fact as FB's they need DB's, which if calling from FC's would mean a new DB for every call. If using the SFB's in an FB, you can add the FB as a STAT and then it does not need an individual DB, ie in the STAT's add 'Start_Timer' and data type = 'TON', this will create the data structure for the TON in the Instance DB (when recreated that is). To place the timer in the program, use the muliple instance folder in the overview tree on the left and drag the timer onto a network. The Siemens Timers use S5T structure, which is 000-999 in BCD and the left most character is the timebase, the SFB type timers use TIME which is an IEC base that goes up to 24 days, 20 hours etc. A good help for a learner to see very good descriptions of all the data types, is when in the program editor, select HELP and CONTENTS. the appendices explains all the data types and how they are constructed.
1 person likes this

Share this post


Link to post
Share on other sites
Not if you are changing length and the access is attempted outside the current length in the PLC.

Share this post


Link to post
Share on other sites
The Siemens timers are remnants of the S5 PLC (agree should have been scrapped) which I presume were kept to enable easier change-over for engineers from the S5 to S7 PLC's, the SFB's are IEC Timers.

Share this post


Link to post
Share on other sites
My point again - why force me to use STL as Siemens seems to prefer over ladder. Regarding history, I have in the past written and compiled Assembly routines and integrated them into a TurboPascal programme to handle comm's over the parallel port of a computer to create an oscilloscope view from the DMM I designed for my thesis. this was done in the days of dos and also incorporated the use of the mouse. Ie I understand this low level programming, i just don;t like it. hence my disdane for the Siemens STL push. Also, I have not been able to find a quick way to search for an address, besides the clunky cross reference address method.- yes the siemens cross ref tab is clunky is sux. How do you do a global search for an address without the cross reference tab. Ie I know an address and i want to type this into a search and for it to show me all of the other locations it is used across all code. - the cross ref tab simply shows the search for the current addresses in the current network. On that issue, how can you get a print out/display of the available addresses to use and there usage ? thanks
1 person likes this

Share this post


Link to post
Share on other sites
In the reference section I just mentioned. Edited by Groo

Share this post


Link to post
Share on other sites
I have programmed Step 5 PB's in STL. However the full STL instruction set was only available in FB's. I like the Siemens range of PLC's and I find the software to be easy to use (apart from the Logo software). Have recently had to use Mitsi IEC Developer - now that is a pain in comparision!! Edited by Moggie

Share this post


Link to post
Share on other sites
PB's could be STL or Ladder, as could OB's, but as I said you could only use STL when programming Function Blocks (as in cannot use Ladder in FB's rather than cannot use STL anywhere else).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0