Sign in to follow this  
Followers 0
Tractorman157

RSView 32 Expression Problems

4 posts in this topic

This is a problem that has been frustrating me for over a week now. I have a project that monitors dozens of machines within a plant that makes bolts and steel products. Each machine has a PLC that counts the number of pieces of product made, and writes this count number to a display screen, so the number should be constantly changing during operation. However, I want to know when a machine has not produced any products for the past 5 or 10 minutes, indicating that the machine is broken or maintenance is being done or something like that, and I am trying to use derived tags to do so. I have plenty of derived tags that work, I know how to get them to run and evaluate their expressions, but here is the tricky part- I can't use a simple digital derived tag because the machine and corresponding PLC may be turned on, but no pieces are being produced. Therefore, I am trying to use a string derived tag to write the word "ON" if the machine has produced a piece in the past five minutes based on the count, and "OFF" if the the machine has not made a piece in the past five minutes. This way, a plant manager can tell if a machine is operational just by looking at the regular display; "ON" or "OFF" should appear below each machine name on my display. The trouble is that I can't seem to write an expression for my derived tag that will do this. For example, I tried: if PA\CABLE3_CNT == PA\CABLE3_CNT AND interval( "5 min" ) then "OFF" else "ON" - This expression always returned the else statement, and now I understand why. I need an expression that basically says, "If PA CABLE 3 COUNT Now == What PA CABLE 3 COUNT was 5 minutes ago, then "OFF" else "ON" Any help would be greatly aprreciated!

Share this post


Link to post
Share on other sites
Try using events instead. Define an analog memory tag, lets call it timetag1.Now define an event that uses the tag in the PLC for the count. The event will occur whenever this tag changes value. The action expression for this event will be to zero timetag1, timetag1=0.Now define an event that uses the everysecond system tag. Use this event to increment timetag1. timetag1 = timetag1+1.When timetag1==300 you have gone five minutes without producing a part. You can use timetag1==300 as another event to run a macro.Use timetag1>300 or timetag1<300 as a visibility animation expression for something on a display, as part of an if statement in another expressionYou can create a multi-state string display with the expression if timetag1<300 then "ON" Else "OFFYou can configure an alarm for timetag1. Edited by TConnolly

Share this post


Link to post
Share on other sites
Thanks, that really helps! The only think I'm still not clear about is what should I enter into the expression box for creating the events in your steps two and three? You listed the actions, but not the expressions I need and thus I'm still having trouble getting it to work.

Share this post


Link to post
Share on other sites
List only the tagname. Tagname should be an analog integer. When the tag changes value the event triggers.

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