Sign in to follow this  
Followers 0
jeenjang

Questions about Step7 v5.1

5 posts in this topic

1. I made a function (FC) using functional block language (FBL), the FC's output is a Double Word (DW), so in OB1, i typed a memory address (e.g. M0 ) but it appeared to be invalid address, syntax. why? is there any rule or syntax that i should follow? 2. I have bit output for let say M0.0 in a network , and I want to move a INT or WORD value to the same memory address, starting from M0 in another network, is it valid for siemens? 3. How to use Timer type variable in a function block (FB), or is it possible for siemens? I tried to declare it but it gave me RED in the column of initial value, what should i put in that column?? Omron cx-prog v5.0 supported this function for its function block. 4. If interrupt (e.g. plc low battery), it runs OB80, does OB1 run after OB80 finished? or just looping within OB80 until the error is cleared? Edited by jeenjang

Share this post


Link to post
Share on other sites
1) Your memory addresses take the form M0.0 for BOOLS (Bits), MW0 for WORDs or INTs and MD0 for DWORDs or DINTs. 2) You can't use Bits at a memory address that you also use for storing WORDs or DWORDs, the last one to be written in the cycle will overwrite what previously there. For example Bits M0.0 to M0.7 occupy Byte 0, if you write an INT to MW0 this will overwrite Bits M0.0 thru M1.7, writing a DWORD would overwrite Bytes MB0 thru MB3, which also happen to be WORDs MW0 (MB0+MB1) and MW2 (MB2+MB3). Finally M-memory is global, that is the same memory areas can be accessed from all blocks, so you can't use M0 for different purposes in different networks. 3) You can use Timers in FBs and FCs OK, you need to note that the initial value must be in S5TIME format. (See the help files for examples.) 4) Once you've handled the error in OB80 (or any of the other interrupt OBs) OB1 will automatically continue where it left off in the cycle. By the way, you don't have to program OB80 if you don't want to. If all you need is to avoid the CPU going into STOP, all you need to do is have OB80 (etc.) present - you can leave it empty.

Share this post


Link to post
Share on other sites
thank you for ur useful reply , i'll try them out and by the way, the timer in function block tat u noted is global timer (absolute addressed timer) or timer variable that is shared among all function block calls ?

Share this post


Link to post
Share on other sites
i found that Timer datatype can only be INPUT in function block instead of all others, and we dont need initial value for that.......

Share this post


Link to post
Share on other sites
Timer datatype refers to S5 timer number and in fact it's not a timer itself but rather way to pass S5 timer number as an argument to FB or FC. Other type of timers are IEC timers. They are SFBs and can be placed in the STAT part of FBs' interface.

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