Project design and configuration

Hey everyone, just learning to use Ignition. I have some questions on the path I need to take for proper configuration/setup of a project I am working on. A lot of the project will be scripts, most will be event based scripts based on OPC points. Most of them I will be using OPC points to set variables within the scripts. (Think container quantities to post via API) I am working to modify the scripts from Python to the Jython format used in Ignition. So questions I have–

  1. To accomplish what I am looking at doing should I be using Gateway tag change scripts to achieve this or is there a better way?
  2. Just to confirm do I need to have any kind of user UI involved or can I run it strictly with scripts and OPC? I don’t need a user UI at this point as I want to feed data back to OPC points based on the returned results from the scripts.

You have a some choices.

  • If you check the Tag Editor you will see that you can add Tag Event Scripts on the OPC tags directly.
  • You can create a Derived Tag to use give an expression language derivative of the original tag without disturbing the original tag.
    Someone with more expertise will probably have other options for you.

It might be a good idea to post a sample of what you’re trying to do. (Use the </> code formatting button if you’re pasting code.)

1 Like

I would go with gateway tag change scripts. If i see something from @pturmel with IMNSHO, that's good enough for me (:

2 Likes

Are you planning to expose an API for other services to call (presumably via WebDev)? If so, just have your API endpoint in Ignition read the tags needed. No tag change script required.
If your are planning to call an API, one-for-one with the updated tag values, then a gateway tag change event would be my choice.
If you are planning to call an API to send bulk data (multiple tags), I would use a timer event combined with a gateway tag change event. The latter to note in a cache what to send, the former to make the API call.

Share more of your use case for better advice.

1 Like

Thank you to everyone who responded. Currently my plan is to call API’s from a couple of vendors. These will both gets and posts. Some brief examples are from a manufacturing facility

  1. Machine PLC count reaches container standard pack - Post request to API for vendor1 for container label also Post request to API for vendor2 new container/full container pick up.
  2. I will also do Get requests to Vendor1 to check/get job information to update other tags on change. Things like job number, part number, job quantity, standard pack for the part will be retrieved and on job number change I would update the tags for the other items.

So as you can see I have some big ideas and plans and just want to make sure the way I am approaching it is the most efficient and smartest. The get requests from example two would be timer based probably checking every couple of minutes to make sure the job information has not changed. I have the scripts working for the the post requests to Vendor2 thanks to this forum helping me find what I was doing incorrectly from Python to the Jython format used here. Now I am starting down the path of updating script data from tags before sending and updating other tags from the returned data. I am sure once I have figured out the first part the second will be easy.