12/01/2011

WGCEngine, NetSim and MonitorGAP usage and installation notes

 

NOTE: If you are reinstalling and/or upgrading TSUNAMI, make sure to check the PATH environment variable (refer to Appendix B) after the installation is complete.

If you are having trouble getting WGCEngine to run in Dynsim, see the ‘Troubleshooting’ section at the end of this document.

Installation of NetSim, Monitor GAP and WGCEngine

1) Install Microsoft Visual Studio 6 on the machine that is to run Woodward’s NetSim utility

2) Download the latest version of NetSim from www.woodward.com (at the time of this writing, it is NetSim 5.0)

3) Install NetSim on the project machine.

4) Authorize the license (See Todd Thayer or Nick Schmid for license information regarding NetSim)

a. when NetSim is started for the first time, it will prompt the user to authorize the license. It will spit out a “Site Code” and ask you for a “License Key”.

b. Go to www.woodward.com . You will need to establish a user account to access the licensing section of the website. You may use Nick.Schmid@Invensys.com for the user account as it is already set up. You will need to enter the site code and the serial number (which we obtain from woodward when we pay for / are given a license). If everything works correctly, you will get the “License Key” that you need to run NetSim.

c. NOTE: If you re-install NetSim, a new Site Code will be generated, and you will therefore need a new License Key to run the software. If you do this, please use the “transfer license to disk” option as we only get two authorizations per license. If you are transferring NetSim from one computer to another, use the transfer license utility as well. If you have problems, contact Brian Baker or Glen Strandvold (see top of document for their contact information).

5) Download Monitor GAP from the woodward website. DownLoad Gap programmer 3.04 – option GAP/ Coder Advanced + Mathworks 3.04 - 2 . Start it up and select “read ony”. To authorize the monitor GAP license, go to the security menu and select Authorize Monitor GAP. You will need a Site Code and serial number to obtain a license key, analogous to the NetSim authorization

6) If the WGCEngine was not installed when you installed TSUNAMI, create a WGC directory in:

C:\Invensys\TSUNAMI\Engines

In that WGC directory, put the engine.dat file that corresponds to the WGCEngine, and make a bin directory. In the bin directory, put WGCEngine.exe

7) The first time you start up TSUNAMI, you will need to create and/or edit the simulation that is going to use the WGCEngine. In the simulation editor dialog box, you will need to a WGCEngine to the simulation and then go to the Engine Configuration dialog box by selecting the WGCEngine and hitting the ‘Engine Details’ button. You must enter –dllname, -xrefin (or –insize) and –xrefout (or –outsize) in the Run Arguments box in order to run the WGCEngine. See the Command Line options section of this document for more information.

8) PATHS: After installing everything, your PATH system environment variable may be a bit messed up. In Control Panel -> System -> Advanced -> Environment Variables -> SYSTEM variables (not USER variables): PATH, LIB and INCLUDE must be set up properly in order for NetSim and TSUNAMI to function properly together. Examples are in Appendix B: Path Information. You will need to reboot the machine in order for the path modifications to take full effect.

Configure the Communication:

1) TMR Controls

Start Woodward’s NetSim application. From within the NetSim application, open the project specific dll for TMR Controls

Bowen ex : C:\NetSim\Projects\Bowen_Cntrls\TMR_cntrl\cntrl\Debug\wgc_tmp.dll

In the Control 1 WGC TMP.dll Netsim Control Executive window click on communications menu. Click on configure modbus and check for entries in SCADA_1_FOX.Transmission medium should be UDP and the UDP port 5011 enabled.

2) Modbus Controls

Start Woodward’s NetSim application. From within the NetSim application, open the project specific dll for Modbus Controls

Bowen ex : C:\NetSim\Projects\Bowen_Cntrls\Modbus_cntrl\Cntrl\Debug\Bowen_Modbus_304.dll

In the Control 2 Bowen_Modbus_304.dll Netsim Control Executive window click on communications

Menu. Click on configure modbus and check for entries in MODBUS_MASTER . Transmission medium should be UDP and the UDP port 5011 enabled and the IP address of the PC address where the Netsim Control executive is running.

Starting up a simulator that uses a WGCEngine:

1) Start Woodward’s NetSim application.

2) From within the NetSim application, open the project specific *.dll

a. bowen ex: C:\NetSim\Projects\Bowen_Cntrls\TMR_cntrl\cntrl\Debug\wgc_tmp.dll

b. click on the green arrow ‘com’ button to initiate communications

c. if the project uses a modbus, open a second instance of NetSim and open the modbus specific *.dll. bowen ex: C:\NetSim\Projects\Bowen_Cntrls\Modbus_cntrl\Cntrl\Debug\Bowen_Modbus_304.dll

d. click on the green arrow ‘com’ button to initiate communications

3) Start TSUNAMI

a. A correctly configured TsunamiGUI.bat file will start the SimExecutive and the WGCEngine and any other engines that are desired if you have set up the engines properly. If you are having problems, see Appendix A for an example of a config_file.dat file that will work with this engine.

If you desire to run from batch files, start the SimExecutive first, and then the WGCEngine and any other engines you want to run. After starting the SimExecutive, it does not matter if you start the WGCEngine before or after any other engines.

General notes:

1) NetSim does not support relative paths. Absolute paths must be used a file name is required (-dllname, -ic_path, -bkt_path, -xrefin, -xrefout). If you happen to use a relative path, that path will be ignored, and the files will be saved or looked for in their default locations. Because of the way that NetSim handles snapshots, -ic_path and –bkt_path will be ignored if they are entered. ICs and backtracks will always be stored in their default locations (in the same directory as the project specific *.dll.) If the project runs more than one instance of NetSim, snapshot save files will be saved for each instance of NetSim in the corresponding default directory. The files are both required as they are not the same. The default location for the bowen project is: C:\NetSim\Projects\Bowen_Cntrls\TMR_cntrl\cntrl\Debug

2) Use forward slash “/” in all path entries.

3) GAP Monitor

Current user must be logged on as administrator for the OPC server to load.

The model must have started. The OPC server is not started until the model has begun running.

If neither of the above work, on the Control Executive Options menu try toggling the OPC Stop and OPC Start items and then try Monitor GAP again.

Also, there is a limitation on the OPC which only allows one instance of it on a PC at any time. By default, the OPC server is attached to your first Control Executive. If you want to start the OPC server for the second Control Executive, first you need to stop the OPC on the first and then start it on the second. This means that Monitor GAP will only work with one Control Executive at any time.

Command line options: (and engine specific variables)

In order to start the WGCEngine automatically from the TSUNAMI start-up script, THE FOLLOWING COMMAND LINE ARGUMENTS ARE REQUIRED in Simulation Editor/ Engine Details => Engine Configuration / Run Arguments: -dllname, -xrefin (or –insize), -xrefout (or –outsize)

Engine specific variables are TIME, WGC_DBG, and WGC_DELT. They are described below.

“-dllname”, Name of wgc interface DLL to be loaded. This is not to be confused with the project specific DLL that is opened when NetSim is started. In most cases, this path will be:

C:/NetSim/Programfiles/bin/wgcintfc.dll

NOTE#1: be sure to use an ABSOLUTE PATH as NetSim does not support relative paths

NOTE#2: use forward slashes “/” as TSUNAMI has problems with backslashes

“-xrefin”, Name and path of project specific xrefin CSV file. If Woodward has supplied you with a project specific excel file (which is very likely) there are two tabs in the file that are called something like XREFIN and XREFOUT. These tabs should have the format:

VARIBALE NAME, INDEX, DESCRIPTION, UNITS

save each tab as a *.CSV file and point to these *.csv files with this command line option. For example:

-xrefin "C:\Documents and

Settings\nschmid\Desktop\woodward\bowen_beta\Bowen_Cntrls\TMR_cntrl\xrefin.csv"

Do NOT use –insize if you specify –xrefin.

“xrefout”, analagous to “-xrefin” see above. Do NOT use –outsize if you specify -xrefout.

“-insize”, Number of inputs – This is only to be used if –xrefin is NOT used. Instead of creating WGCPoints with variable names from an xrefin file, this option will create an array of WGCPoints called WGC_IN that is analagous to the input array that is passed to the woodward project specific controls DLL.

“-outsize”, Number of outputs – This is only to be used if –xrefout is NOT used. Instead of creating WGCPoints with variable names from an xrefout file, this option will create an array of WGCPoints called WGC_OUT that is analagous to the output array that is passed from the woodward project specific controls DLL.

“-debugLevel”, options are “none”, “low”, and “high” – none is the default. If low or high is specified, print statements are enabled that help one to debug the code. Debug level can also be set via the WGC_DBG variable in the glossary. 0 corresponds to “none”, 1 to “low”, and 2 to “high”.

“-delt”, WGC_DELT can be set to something other than the default value of 0.25 with this command line option. WGC_DELT can also be modified dynamically in the glossary (no need to reload, it should take effect right away). Note of caution: Woodward’s NetSim has an internal speed setting and apparently adjusts the controls based on that setting. It would be a good idea to thoroughly understand how this works before messing with WGC_DELT here.

The simulation time for the WGC Engine is simply TIME. To view it in the glossary, enter it as WGCEngine##TIME.

http://www.cadfamily.com/html/Article/WGCEngine,%20NetSim%20and%20MonitorGAP%20usage%20and%20installation%20notes_999_1.htm

No comments: