douyi Posted August 3, 2005 Report Posted August 3, 2005 Hi guys, 1. I checked with Siemens manuals, it seems that S7 only support 10ms TimeBase or up. Is that correct? If it support 1ms TimeBase, how to setup? 2. I found it's possible to use another format as W#16#wxyz instead of S5T#aH_bM_cS_dMS (normal s5time format), but it doesn't work, why? 3. I use "MOVE" function to convert a DINT number to s5time, it successful, but what's how can I set timebase at that time? Thanks a lot. Quote
JesperMP Posted August 3, 2005 Report Posted August 3, 2005 Use the IEC timers. They use a timebase with 1ms resolution. Quote
douyi Posted August 3, 2005 Author Report Posted August 3, 2005 Thanks, but I checked with all the timer instructions, they all are s5time. Which one is the IEC timer? how to use that in LAD? Thanks again. Quote
JesperMP Posted August 4, 2005 Report Posted August 4, 2005 You will find them in the standard library. I think that SFB4 is a TON timer. Copy the SFB's from the library to your project. Click on an SFB and hit F1 to get help on how to use it, Quote
douyi Posted August 4, 2005 Author Report Posted August 4, 2005 Thanks. that IEC Timer and Counter is very similar to RSLogix version, because it's a SFB, so everytime I use that, I need to add an instant DB for that. I'm thinking if I can make a FC which include Timer or Counter function and a converter inside ( so I have exactly .DN, .TT and .EN bits ) and only one instant DB for that call. Is that possible? Thanks again and again. Quote
Guest Guest Posted August 4, 2005 Report Posted August 4, 2005 Douyi Create one large FB to hold all the Timers you need. Declare them as multiple STATIC variables of type SFB4. Write the code in this 'parent' FB to activate the individual SFB timers when you require. You won't have to use separate DBs for each of these calls. Now make a single call to the parent FB and assign a single DB to it. That DB will be a 'multi-instance data-block' which holds all the instances of SFB4 that you declared. Call that parent every scan and you can control all the SFBs as you want. regards Ken Quote
JesperMP Posted August 4, 2005 Report Posted August 4, 2005 (edited) You can certainly make your own timer in an FC. I have done that and it works OK. But try to use the IEC timers with multiple instance as Ken suggested. HERE is an example with using multiple instance and IEC timers. Edited August 4, 2005 by JesperMP Quote
douyi Posted August 8, 2005 Author Report Posted August 8, 2005 Thanks! I tried to use an instance of IEC timer and it's successful. But on the other hand, I can't use SFB as a data type like what you did in the picture, how can I do that? another question is, is the instruction "--(P)--" as same as "one shot" in RSLogix? Thanks a lot. Quote
Werner Posted October 27, 2005 Report Posted October 27, 2005 http://www.plctalk.net/qanda/showthread.ph...ghlight=s7+time See message 11. (FC 33/FC 40) I've tried them they work fine! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.