raskalnickoff

SuperGenie Trend

5 posts in this topic

I’d like to create a supergenie with a trend but it isn’t happening. We are currently upgrading from Citect 5 to 7.20 then changing from XP to Win7. At the same time we are increasing the screen resolution from to1820x1980. Currently each loop trend is defines as a separate page. And rather than standardising each of the 40 odd loop pages in this project I want to create one genie that I can also use in my other projects. Our loop tags follow the nomenclature LPV%LOOP%_%UNIT% LSP%LOOP%_%UNIT%R LMN%LOOP%_%UNIT%R Where %UNIT% is the PLC that the loop is on and %LOOP% is the unique Loop number in that PLC. The “R” at the indicates a read rather than write variable tag. Eg: LPV6_1 LSP6_1R LMN6_1R I’ve read up about AssPopUp and this seems to work reliably to locate the new window as close as possible to the cursor, while still being visible. One of the improvements I’ve noticed in 7.20. On my regular genies that allow changing the Setpoints Auto/Man etcetera I add the LOOP and UNIT variables. Adding a trend button that activates AssPopUp("!sg_trend","LPV%LOOP%_%UNIT%","LSP%LOOP%_%UNIT%R","LMN%LOOP%_%UNIT%R") It took a while to find I needed to associate the SuperGenie with the Genie, not exactly sure what that accomplishes though. In the SuperGenie that I made !SG_Trend I have some variable text with the display property.. ?1? which uses the tag LPV%LOOP%_%UNIT% to display “200 kPa” Using ?INT 1? Also works. This uses the first tag mentioned after the pagename, so the last variable is called 3. But my actual trend never shows anything. Manually entering the trend tag LPV6_1 in the trend works fine. So I tried just passing the %LOOP% by itself but this always returns #booty. Even using the 4th variable banana doesn’t work and returns #booty AssPopUp("!sg_trend","LPV%LOOP%_%UNIT%","LSP%LOOP%_%UNIT%R","LMN%LOOP%_%UNIT%R",”banana”) Then in the SuperGenie =?STRING 4? The knowledgebase article Q4152 suggests that there may be a timing issue and that I need to add Sleep(0) to the code somewhere. Inserting it into the cicode of AssPopUp seemed to make no difference and doing it manually with the booty(hWin, nArg, sTag, nMode [, ClusterName] ) function didn’t work either. I gave up on this approach because it doesn’t seem logical 1 Use booty() to prepare variable to a SuperGenie 2 PopUp the SuperGenie 3 Sleep 4 Apply the booty function again. I don’t see how to code it in that order ? The knowledgebase article Q1589 recommends 1 search google 2 manually set TagDB to its default in the ini file (did that) 3 try different variable types. I had already done this by this stage, but the trend still shows nothing. An issue with the variable database sounds possible because the trend that appears doesn’t let me add any new variables either. I’ve double checked and calling a genie from a genie doesn’t work. There is not page to create. Calling a page doesn’t work because there seems to be no way to pass variables to it. So I really should be using a supergenie. I don’t know why SuperGenie’s have two animation points and I don’t know why they are prefixed with “!” I don’t know why I have to save the super genie then update the pages, but if it try to just update the pages I always get told (when the SuperGenie is saved) that I need to update the pages. The knowledgebase article Q1589 hinted that additionally enclosing the tagname in Apostrophe’s “ ‘ “ ensures it appears as a string. But then I cant seem to use the string for anything. http://forums.mrplc.com/index.php?showtopic=17570 was a little helpfull http://proscada.ru/ctkbase.en/ Knowledgebase So I can get a SuperGenie to display the numbers of the loop variables and we use them in a few places as the helpfile suggested to turn motors on/off. But is there a way to use a supergenie to show the trends of a loop? I’m stumped and if I spend much more time on it then I probably would have been better off configuring all the pages manually. Maybe it would help if I used the actual “Process Analyst”? I know its there but we have our own that must have been there since version3 and we haven’t used the process analyst anywhere yet.

Share this post


Link to post
Share on other sites
I would suggest not using tag substition on the trend object - Leave the fields blank. All you need is the AN of the trend object. Then on the calling cicode function after the WinNewAt() or however you are calling the supergenie use the TrnSetPen() function to set the tag for the pens.

Share this post


Link to post
Share on other sites
I've created a cicode object on the supergenie, where the trend is but it hasnt updated the trend. I've tried: Sleep(10); TrnSetPen(-1,3,"?2?"); Sleep(10); TrnSetPen(-1,3,?2?); TrnSetPen(-1,3,"?2?"); TrnSetPen(-1,3,?2?); both with the tag being passed to the super genie as a tag string via "'LSP%LOOP%_%UNIT%R'" to show LSP6_1R and as a tag "LSP%LOOP%_%UNIT%R" to show 200 kPa. the sleep function is supposed to wait for the trend to be initialised fully in the new window but I dont know if it is doing anything. I'm also specifically avoiding the WinNewAt function because it only works reliably with a single monitor. While we have up to 4 on a single PC, I'm trying to get a standardised loop genie to work across the site.

Share this post


Link to post
Share on other sites
I've attached some pictures of creating/calling a super genie. Image 1 - Create the super genie - using substituions as aguments for functions. Image 2 - Create a calling function for the super genie. Image 3 - Call the super-genie from your graphics page

Share this post


Link to post
Share on other sites
Thanks, I had kept mucking about with the TrnSetPen yesterday and came up with nearly the same solution. Also your pictures help a lot. I’ve double checkecked my solution now… Created a new Supergenie, using the page template “poptrend” The associations tab doesn’t need to be filled out, and I’m only passing the three variables because I figured out how. They will always show the current values. Adding cicode So first a pigeonhole is created, then I assign the variables to appear in the first three trend pens of the trend at AN30 on the next window to appear. Then I create the window (only adding the trends to show the current values with =?1? as I mentioned before). Finally I associated the Supergenie with the genie This works, looks a bit untidy but it works. Pity the AssPopUp function couldn’t pass any tagnames directly to the trend, it still seems that that is what its for. Next I was hoping to make a button to enlarge the trend to fullscreen but this is enough for now. Later on I'll also add the PID controlls to the bottom of the loop. Thanks again Chelton

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