Sign in to follow this  
Followers 0
Carol

Need a hand

8 posts in this topic

Hi, I,m programming a FB wich should activate an output on a given time, for a given period on given weekdays. All works fine, all the given choises are variables, so I can remotely chance them. Only thing is that the weekdays are bit's and they aren't retentive. What would be the appropiate way to solve this? I've added the program, should clearify the above...... Carol Edited by Carol

Share this post


Link to post
Share on other sites
Hi Carol Use a Int. var. as Weekday seleckt. Or Use some internal bool var. seleckt them as retain and then some Set/reset logik. Banker

Share this post


Link to post
Share on other sites
OK, I will give it a try. I thought that it might be possible to set certain bit(s) in a dataword, something like %MW200:X1, but then in Omron syntax. I've tried to find this solution in the manual without any luck. Any suggestions? Carol

Share this post


Link to post
Share on other sites
SETB, D100 &5, will set bit 5 of D100. RSTB, D100 &5, will Reset bit 5 of D100. This instruction is in the manual, and numerous other implementations, you could also use the ANDW, which is the exact same as a MASK in AB. I think you have the AND instruction in Modicon also? The instruction manual is very good on the complete set, with examples also. In relation to your dataword question, it all depends on how you define your datatypes, in normal execution, if you use CIO, W, HR, you can set bits in the normal 'Omron' way. In FB's, this is not possible though, unless you define the FB variable at an absolute address.

Share this post


Link to post
Share on other sites
I can't follow here... I thought you could have bit retained in FB in Memory (just by checking the box when creating the symbol) or am I missing something beegee

Share this post


Link to post
Share on other sites
Maybe if the Carol can explain a bit clearer as to what they are trying to achieve.

Share this post


Link to post
Share on other sites
Scot & Beegee, you're right, inside the FB you can retain the bit. But Scot got it right, I want to set the days and I want to control these on a remote controlpost using GPRS. So when the PLC is turned out of programmode or is repowered I lost the status of the day-bits. When this happens, it's impossible the read back the status because there isn't one, all the day-bits are low, but with the bits inside the FB retained, they're still high. Now I've made the day-bits "Internal" and added an INT variable at the same adress as my original bits were. By writing the actual value into a second word I made it possible that after repowering the value of the second word is written in the actual value word. This one is read by the controlpost and I don't lose track nor control. For anyone who want to look back where the heck I'm babling about, here is a working version. Carol by the way: thanx guys for the feedback

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