Sign in to follow this  
Followers 0
pcdata

Newbie asks for help

10 posts in this topic

Hi everybody. I'm new to this forum (and also quite new to PLCs). I'm trying to achieve something but I really don't know how to do this. Situation: I have a OPC connection with my AB ML1100. To keep it short, I'm able to write 1/True to a specific value when I press a button on my client. (For example N7:0/0) Eventually, I want to toggle an output (lamp, O:0/00). But because I only can write 1/True, I only can put the lamp on, but I can't turn it off.. I'm really getting headaches from it, but it probably will be very easy for you guys :) Hope you can help me. Best regards, Rick At this time, I only have this: ------]N7:0/0[-----------------------(O:0.0/00)------------ ------]N7:0/1[-----------------------(O:0.0/01)------------ Edited by pcdata

Share this post


Link to post
Share on other sites
Can you configure another button to write zero to the same address?

Share this post


Link to post
Share on other sites
Yes, but that is not allowed.. So the button only sends true, but within the PLC it has to toggle the lamp :)

Share this post


Link to post
Share on other sites
In C#, it would be something like: if (N7:0/0) { O:0.0/00 = !O:0.0/00; N7:0/0 = false; }

Share this post


Link to post
Share on other sites
That is commonly called a flip-flop here in PLC land. There are a ton of discussions on the subject. It has been beat to death so overlook the attitudes expressed in some of these posts I will link. http://forums.mrplc....h=1 http://www.plctalk.n...ead.php?t=14638 http://www.plctalk.n...?t=14638&page=2 http://www.plctalk.n...light=flip+flop I like TConnolly's counter method the best. Now, since the remote device can only set a bit, the PLC will need to reset it (OTU instruction) in order to "see" another transition of that data when the button is pressed again, so your resulting code will probably want to place the OTU instruction after the logic has acted upon the rising edge. it may also get tricky if the remote device writes the value more than once or continuously. Edited by OkiePC
1 person likes this

Share this post


Link to post
Share on other sites
The only thing that I would add is this: Sometimes, albeit rarely, an HMI button will send the true but not clear it. So at the very bottom of a routine that uses soft buttons I'll add: ---| |---------------------------------(OTU) N7:0/1......................................N7:0/1 So the PLC clears the bit Edited by Michael Lloyd

Share this post


Link to post
Share on other sites
Could you use a VBA Script $N701=0

Share this post


Link to post
Share on other sites
------]N7:0/0[-----------------------(O:0.0/00)------------ ------]N7:0/0[--------------------(OTU - N7:0/0)--------- Result: Lamp never goes on..

Share this post


Link to post
Share on other sites
Never mind guys. I've got it.. Thanks!

Share this post


Link to post
Share on other sites
So would you mind sharing with us how you got it.

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