Using CLI to set/reset the public read/write flags

If you are connecting an Epic to Ignition, and you are using Pac Control on the Epic, you’ll need to set all the variables and or tables to public either read or write. Instead of trying to individually trying to set each one and before you really know which ones you’ll need, you can do this in about an hour and once it is set up, it is very easy to do.

Here is a spreadsheet that is essentially a modified version of an Opto22 tag export.

Basically all you have to do is export all the tags and save them as txt file, then open Excel and bring them in as space delimited.

Then sort all the rows by the “type” column, and then copy them to the appropriate section in this spreadsheet I uploaded. If you have more of one type you’ll have to copy the columns on the right down to accommodate.

Once you have all this done, you can copy the result on the far right column to a text file. I named mine OptoBatch.txt, and I reuse it all the time.

This file when read by a DOS batch file will either set or unset the read/write flags as per in the manual page 70. The script in this file is for setting both read and write. The timers can only have read.

The method I use to set my PC up to do this is:

  1. Set your environment variables to:
    a. Name: Pac10.4 Variable value: “C:\Program Files (x86)\Opto22\Pac Project 10.4\”
    b. Name: Control Variable value: “C:\Users\username\path to folder strategy is in\controlstrateyname.idb”
    Leave the quotes on because of the spaces in the paths.
    To get to the environment vars, type “env” into the windows search box.
  2. I put the 2 files in in the desktop.
  3. You’ll need to edit the paths in the batch file to match your own. Right click on the batch file and select edit, otherwise it will run.
  4. Make sure pac control is not open.
  5. Paste your scripts from the description above, to OptoBatch.txt. Delete anything that is left over in there first.
  6. Run the batch file OptoBatchControl.bat.
  7. If all the paths are good, more than one command window will open.
  8. Next go to the control.output.csv file which should be in your project folder, if not, then the paths are wrong.
  9. In control.output.csv it will indicate success or failure and any error codes which can be looked up on pager 71 of the pac control user guide.

This should make setting all the tag names much easier. (1.5 KB) (38.0 KB)

Before 10.x versions of PAC Control, you had to set up the tags with a magic string table. That method still works and I find it easier to build a spreadsheet with the tags I want to be public and then have a formula to generate the Optoscript to initialize the stPublicListofStrategyTags table rather than modifying the properties in PAC Control.

Cirrus Link documents the format of the strings on this page: Scanning Specific Tags - Cirrus Link Documentation - Confluence

Only use that document for the syntax of the public tag configuration and ignore the rest as there is information on that page that is wrong.

Wow, had no idea this is what you were doing previously. Unfortunately, Opto decided to work this problem by using the CLI, which does work pretty painless once you get everything set up, but on the other hand, you still have to go through a lot of steps to make it happen, whereas if they would take a suggestion and add read/write/public check boxes to the TAG radio selection of the find and replace in pac control, it would easily change tags by naming convention.