Andreschrosa Posted October 13, 2008 Share Posted October 13, 2008 Can I open instances of a page like this: I have 3 equipment types on my network (A, B, C), each with it's functions. I must monitor each of the equipments in the network independently, so I must be able to open say 3 pages of equipment A (each with it's own readings and controls). Is there a way to open instances of pages like this (each with it's data bein read) or should I create all instances by copying the page like equipA_0, equipA_1, equipA_2? Link to comment Share on other sites More sharing options...
AzeoTech Posted October 13, 2008 Share Posted October 13, 2008 I'm assuming all three pages are identical except for the data being displayed. If so, then you can use the evaluate() function and a variable to display different data from the same page. You'll need to make sure your channel names are identical between equipment except for some identifier for the equip. So, lets say you had temperature, you'd name your channel Temperature_A, Temperature_B, Temperature_C. Then, you'd create a global string variable containing the desired network to view. This would contain either "A", "B", or "C". Then, create your three pages, but instead of putting the channel name explicitly, use evaluate to construct it based on that variable (lets say the variable is CurNet): evaluate("Temperature_" + curnet + "[0]") For actions, you'll need to do similar, but probably use execute() instead. So, if you had a channel series called TempSP_X where X is the network, you might do: execute("TempSP_" + curnet + " = 5") to set it to 5. Using a combination of evaluate and execute() you should be able to only have to make one set of pages, which is much easier to maintain. FYI: evaluate() returns the result of an expression and is used where Expression is called for, or in script to the right of the = (or in if(), while(), etc). Execute() should contain an entire, executable line of script. The problem with execute() and evaluate() is that DAQFactory has to compile the line every iteration which makes these statements quite a bit slower than say just TempSP_A = 5, so don't make your screen refresh rates too fast. Link to comment Share on other sites More sharing options...
Andreschrosa Posted November 12, 2008 Author Share Posted November 12, 2008 OK, now finaly I got to the spot on my software where I need to use this. What I had in mind is this: the user can scan their network, which will be stored in a tree list, each IP father of it's modbus addresses. I read in the manual the data field in the InsertItem tree list function is a data returned on the double click event, so I figured it could be used to do execute(page.pagename.PopUpModeless()) to bring a popup of the equipment management screen, but I also need to pass on the variable telling me which equipment is that (to use the curnet stuff to display the right data). However I may be getting this wrong cause when I run my sequence, it just pops up a page and wont do anything on double click. Any help greatly appreciated Link to comment Share on other sites More sharing options...
AzeoTech Posted November 12, 2008 Share Posted November 12, 2008 I'd need to see what you are doing. If you need to get more than one piece of info from the tree, then you probably should create arrays and put the index into the arrays in the tree list as data. Then you can pull up the multiple data out of the array. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.