Calling a cicode function from a page event doesn't work at times

Further to an earlier post about passing a cicode global variable argument into a function that is called by a super genie graphic window, I have got all the code working properly thanks to the wonderful help from this community!

It seems now the problem I have is that the function is not always called when the supergenie window is called. I have created a variable on the supergenie window that tells me if the code has been executed and in some cases it has not.

The variable that is set true by the code, so I then created a 'while do' loop to try and execute the code continuously until the variable is set true.

I think the problem is that for some reason the page event doesn't always run when the page (supergenie) is called and leaves check variable false, indicating the code has not been executed.

I have read all the help documentation and believe everything is correct. The documentation notes that there can be issues when using the 'on page entry' event so I have used 'on page shown event'. I note that the 'while page shown' event does not at work at all and not sure why this is.

Any help appreciated

Regards

Daryl

  • When you say 'know the client is online', what do you mean? Do you have multiple PlantSCADA clients and the PLC needs to keep track of each one of them?

    Or, do you just have one Plant SCADA PC that is both a server and client? If that's the case, then as long as you are running in Multi-Process mode (selected in the Setup Wizard), you can just define an event that toggles your heartbeat bit. Then run the Setup Wizard and enable that event to run on the I/O Server process. The server processes by default have full privileges, even if no user is logged in to the client process.

    This screenshot is from the Power edition of Plant SCADA, but it's the same thing. Also, I like to name the event according to the PC or process where it should be run. You can have multiple events with the same name (it's really like a group name). It makes it a lot easier in the future when someone is running the wizard and may not be familiar with the events and what should run where.