TheDeepFriedBoot Posted June 16, 2011 Report Posted June 16, 2011 Hello everyone I wanted to ask for a little help on a task that should be simple, but has me baffled. Right now, I am learning how to use the Siemens S7-300 by trial/error to communicate over Profibus to another device that receives commands as "WORD" strings. After a lot of digging around, I finally leaned how to make an FC block that will pass pre-set data from the main OB block to the power supply when called from. I just put the FC block in the ladder, and for the inputs, I pre-define the data I want sent to the supply when the step is executed. Now, as for the real problem. I am trying to just make a simple loop that turns our device on, and then off, every 5 seconds. I have two of my FC blocks on the ladder chain, one that sends the on command, and one that sends the off command. I also am trying to get two timers in the ladder that will hold up the execution of the next block for 5 seconds, but this is where my problem is. I am unable to find a timer block that works properly. I tried to use a S_ODT and a few other timers in that category, but the program will only execute once, then gets stuck since both timers are "wide open" and stop delaying the commands. I was unsure of how to send a reset pulse, so I looked around and found the SFB4 TON timer block, but it appears as if that block needs some special title that I can not get the block to accept. No matter what I put in there, it stays red. I tried to look through the documentation and on the net, but there is no mention on what the limits are for this title name block. Anyway, how should I get a basic delay working? As I said, I am completely new to working with PLCs, and I was handed the task of learning how this works just this week by my boss. Right now my only goal is to learn how to use the S7 system by making ever expanding experimental programs as I become more comfortable with the material. I thought that after I got the FC block working that used the move command to send data over the profibus, the task of adding a timer would be easy, but apparently, I was mistaken. Oh, also, profibus is working just fine. I can use the monitor/modify box to send commands to the device on the network. Finally, the FC block is just the move function, with the output as the symbol for the profibus device, and the input as the direct inputs into the FC block. Thanks in advance Summary: Need to delay the cycle in OB1, cycle is just running two FC blocks, with a 5 sec delay. Tried blocks such as SFB4-TON and S_ODT, but no luck there. Complete new to PLC programming, ladder logic, and Siemens products.
ianbuckley Posted June 17, 2011 Report Posted June 17, 2011 There is no title you need to supply. SFB4 is a function block so it needs an instance Data Block to use for memory allocation. You just need to tell it which DB to create - e.g. DB1. When you insert the SFB4 call, it is looking for the DB to use at the top of the instruction. On your other point, Siemens timers are edge triggered, not level triggered - so if the input is always on, the timer will never start. You need to make sure the timer sees the enable input go from off to on. It doesn't matter whether you use an S5 timer or an IEC timer on this point. You also need to make sure the Preset Value is always positive - the timer will never pass power if the preset is 0 or negative
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now