Sign in to follow this  
Followers 0
beoengineer

Citect Super genies, Passing arguments to a function in the SG

1 post in this topic

Hi All, I'm adding a system to my current project which is used to keep product labels correctly moving around the plant (On Screen) and then end up in their correct destination silos and stay there until manually cleared. The labels are determined by referring to an INT in the PLC DM register for that particular part of the plant and then references that to a preset String Variable Tag to display. Now I've made a Genie that is to be attached to each Silo which opens up a small super genie which will just have - a Title, - the label of the current product in the silo(Var Tag), - a label of the previous product to be in that silo (Var Tag), - and a button with a function that I've written to clear that particular label and then store the current label value into the previous product label. The function in the button works fine on it's own but the problem is I'm trying to have it so that I can just pass through the arguments to it from the original genie, but I have had no luck trying to do this. The function in the button is as such: Previous_Label(INT Current_OilCode_tag, STRING Previous_OilCode_tag) <these are the correct data types for these tags as set in citect. Which when I Set it up in the SG is: Previous_Label(?INT 1?, ?STRING 2?) In the genie Itself im using AssMetadataPopUp() and I'm just setting it up in the Metadata Section as: - Name: 1 Value: %Current_OilCode% - Name: 2 Value: %Previous_Oilcode% As said it works if i just set the button up on the Silo Page (Outside of the SuperGenie) and use it there, but having the button in the SuperGenie and trying to pass the Variable Tags into it has been a Nightmare. I should note that I went to the lengths of just Duplicating the button 20 different times and the function also was tweaked to just work for one silo each, then set the Hidden When field to: ?INT 3? <> 1 (For Silo 1 for example) then just having all of the buttons on top of each other in the SG, but much to my frustration this also did not work as all the buttons were hidden, I believe that this is because for ?INT 3? I was simply just typing in 1, not an actual variable tag so I am yet to test this. Hopefully someone here can perhaps spot something I'm doing wrong. Also I can upload the actual codes, I just don't have them on me right now. Many Thanks.

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