Access variables in PAC Manager, how? - old forum post


Joined on 06-09-2005
Posts 6
UIO Variable Question

How can I find the Memory addresses for the variables I define in my Charts? I have to chart several dozen slightly different mostly the same charts. If I could program a single chart, then change some of the variables in IOManager, it would save me alot of time. Also, If I could view some of the variables that I’ve already defined in the chart, in IO manager Example: I have a routine in the chart that checks the clock for a specific time. Once a day I report a status ok SNMP trap. Currently I am defining the variable in IOControl for my time. I’d like to be able to change these variables (hour and minute) in IOManager. Any Suggestions? Josh
07-23-2005, 2:06 AM

Joined on 11-26-2003
Madrid - SPAIN
Posts 42
Re: UIO Variable Question

In general terms, you can’t access ioControl variables from ioManager. My first suggestion is to use ioDisplay instead. With ioDisplay you can quickly set up a simple application that allows you to do all the task you have spotted in your post. You can also use simple OPC clients, like the one Opto 22 includes with his OPC server. Anyway there’s a possibility to obtain cooperation between ioManager and the Strategy: the Scratch Pad area. You have 64 strings, 1024 integers and 1024 floats at hand, all for you. They are readable and writtable from ioManager. ioControl provides you with a set of functions to read and write into the ScratchPad. If you are already using SetIoUnitEventMsgText and SetIoUnitEventMsgState you won’t find troubles using SetIoUnitScratchPadInt32Element or GetIoUnitScratchPadInt32Element. Let me give you an example for reporting status vis SNMP, using OptoScript: Now you have something like: if (GetHours() > nReportingHour) then SetIoUnitEventMsgText (MyUIO,0,sStatusText); SetIoUnitEventMsgState (MyUIO,0,1); endif Lets choose integer #0 of the Scratch Pad as the mirror of the variable nReportingHour. We only need to read the value with a certain periodicity, for instance, before testing: GetIoUnitScratchPadInt32Element(MyUIO, 0, nReportingHour); if (GetHours() > nReportingHour) then SetIoUnitEventMsgText (MyUIO,0,sStatusText); SetIoUnitEventMsgState (MyUIO,0,1); endif I’m sure you can also find a way to melt your charts into one using a similar approach.