Sign in to follow this  
Followers 0
Buckaroo

RSVIEW32 Derived tag issue

8 posts in this topic

I don't see many questions here regarding RSVIEW32 but my hope is someone can point me in the right direction. I have a project that has been up and running since before I came on board. Recently I have been tasked with modifing it. Here is the backround: There are multiple vessels that can contain a variety of products. So in the project all the vessel tags are set like so VESSEL_1_prod where this indicates the product in the vessel as inputed from a PanelView and read as a string. Also tag of VESSEL_1_temp where it is reading the temperature of the vessel. The temperature is maintained at a certain setpoint based on the product. What I am trying to do then is create an alarm by using a derived tag where I read the tag VESSEL_1_prod and if it is A then I want the alarm value to be xxx if it is any other _prod I want the alarm value to be yyy. So my derived tag name is VESSEL_alarm_value and the expression I am trying is IF VESSEL_1_prod == "A" then xxx else yyy. I stop and then start my project and check in the tag monitor where I have placed the VESSEL_alarm_value tag and it always shows the "ELSE" value no matter what I put in there that is what comes up. I am not sure if this relates to the _prod tag being a string type or not. I do not have much experience utilizing strings or this RSVIEW32 software. I will then be using this derived tag in an event but I need to get this part working first. Any help would be greatly appereciated. Thanks Tom

Share this post


Link to post
Share on other sites
Are you starting the derived tags file that contains VESSEL_alarm_value? There needs to be a command DerivedOn <filename> somewhere that executes when the project starts.

Share this post


Link to post
Share on other sites
Yes. The derived tag I created was added to a derived tag file that is started with a startup macro. I guess a question I have is can you use the expression area of a derived tag to evaluate a tag value for a certain string and then give the derived tag an analog value based on the string? That is what I am trying to do but can't seem to get it to work. Thanks Tom

Share this post


Link to post
Share on other sites
Is VESSEL_alarm_value a new tag? If so, I think the Tag Server has to be restarted before it will go on-scan. I guess the easiest way to do that is to close the project and restart it. The expression you have should work.

Share this post


Link to post
Share on other sites
Yes that is a new tag I have created and yes I have restarted the project. One thing I did was changed my expression to check the value of a different tag which was an analog type to test and see if I could get it to work. So the expression if VESSEL_01_temp >= 159 then 74 else 45 and I have the derived tag of VESSEL_alrm_value. Restarted my project and watched in the tag monitor and it was working where the tag VESSEL_alrm_value would change between 74 and 45 based on the temp tag. That worked great. Now as I said in first post I want to use tag VESSEL_01_prod which is the product name as a string. This is not working for some reason and may be due to how I have it set up. I do not get any compilation errors when I go to accept the derived tag. I am going to go back and do some testing to see if I can get this to work. Thanks Tom

Share this post


Link to post
Share on other sites
Ok I have it figured out and working now. The problem was I did not take into account the string length. In the tag database the tag is set to read a PLC address with type as string and length of 8. The reason my expression was not working is because I had it set like this: If VESSEL_01_prod =="stuff" then 100 else 50. It would not work because what is inside the quotes needs to be a length of 8 so changing it to "stuff " where there are 3 spaces after the last f and before the closing quotes. After that worked great. On a side note I tried Rockwells LIVE CHAT option for help. Worked pretty good. Anybody else tried this from there website? Any other thoughts or opioions on it? Thanks Tom

Share this post


Link to post
Share on other sites
Strings have to be surrounded with quotation marks if you are using them in an expression. This Derived Tag expression worked for me, in RSView32 7.40: if ( Vessel_1_Product == "Soup") then 99 else 44

Share this post


Link to post
Share on other sites
Aha ! String Length, the secret bugaboo of most String issues. I was using an Internal tag, so I was cheating a bit. Thanks for posting the followup !

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