Sign in to follow this  
Followers 0
Przemek

Citect : Pass Variable value from cicode to display in SuperGenie (without using tags).

10 posts in this topic

First, since this is my first entry, of all I would like to say hello to everyone here ! ( and apologize for my poor English). I'm writing my first Citect project, and I wonder is there a way to pass variable value from cicode function to Super Genie displayed from that function. For example: - I have one function for number of same devices, the input parameter is device number. - Function opens Super Genie and display device info (using WinNewAt()) - It displays tag values for particular device Associated with booty() - no problem here. - I just don't know how to display device number itself which is INT variable in Cicode ! I only manage to display it in window title with WinTitle(“device”+IntToStr(iDeviceNo)). Does anyone know how to display it in Super Genie like tag value ? (without using additional tags) I also wanted to pass some strings for alarm messages using one Super Genie (or one Page) to all alarm messages. It would be hard using additional tags, because there are few messages possible at the same time, and different tags would be needed for each message. I know, I can also achieve this with Forms, but they look a bit rough ;) I will appreciate any of your help. - Przemek Edited by Przemek

Share this post


Link to post
Share on other sites
Have a look at the AssVarTags function, it can do exactly what you are after. In your Super Genie, you refer to tags like INT1, INT2 with an offset and in the Cicode you assign variable tags to them, you can even use %% substitutes in your tag names that are replaced by strings you enter when you place a Genie that calls the Super Genie. See an example I posted some years back. I haven't used Citect since V6 but I expect this to still work. Citect: How to use multiple AssVarTags function in object command line

Share this post


Link to post
Share on other sites
Thank you for the prompt reply ! Sorry , the forum egine converted my As_s()to Booty(). I'm using As_s() (without "_", for string associations (not booty() ) FUNCTION DeviceInfo(INT iDeviceIndex) As_s(-2,1,”sDeviceName”+IntToStr(iDeviceIndex)); ... WinNewAt(“!PopUpName”,x,y,8+64); WinTitle(“Device “+IntToStr(iDeviceIndex)); END A think this is the same as using mentioned by you: AsVarTags(-2,0,”sDeviceName”+IntToStr(iDeviceIndex)); But that works fine – displaying associated tags value is not the problem. I would like to display iDeviceIndex value, from that this example, in SuperGenie (like in WinTitle) Display cicode variable value, not a tag value. Is it at all possiblel? Edited by Przemek

Share this post


Link to post
Share on other sites
OK I think I understand your point now! I never heard of the Booty() function until now Anyway, wouldn't it be possible to assign the INT value in Cicode to a tag? Using WriteTag or similar?

Share this post


Link to post
Share on other sites
Yes it it possible, but i would like to avoid using additional tags because: In next step I wanted to do alarm popups using one Supergenie. I wanted do display alarm contents as string variables from cicode. Handling this by using string Tags would be very difficult because on screen there can be several instances of called Supergenie at the same time, each with different text to be displayed.

Share this post


Link to post
Share on other sites
OK clear. Not sure though how to go about this. Would it be possible to still use common variable tags but use the super genie "one page entry" function to dynamically call a different function ? Just brainstorming here.

Share this post


Link to post
Share on other sites
Yes, That may work. I was also thinking about using some workarounds but including this all seems to by pretty complicated As a citect newbie I thought that maybe there is some ready mechanism which I just don't know. If I figure out something I will describe what i figure out here If not, that will mean I created as many pages as there are alarm types (one for each type of alarm), just using common template. This solution is less “evolutionary“ and less flexible :( Anyway thank you for your interest and quick help !

Share this post


Link to post
Share on other sites
Let us know how it works out! And there are other Citect guru's around here that are far more experienced in Cicode. Hopefully someone else will jump in.

Share this post


Link to post
Share on other sites
The cicode is simplified, no error handling etc. But should give you something to work with. Edited by chelton
1 person likes this

Share this post


Link to post
Share on other sites
Thank you ! Sorry for delayed answer, I was in delegation. You are great! That's exactly what I was looking for !!! I must admit I gave up, and started doing a lot of pages and genies with different alarm notifications. Things going do simplify now Just one common genie ! Thank you for the work and time spend on drawing that walkthrough. Thing worked as you described. I owe you Tank you again - Przemek

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