
Ignition 8.1 Jython 2.7.3 Script Builder
Ignition Jython Script Builder
Build, review, and repair Ignition 8.1 Jython scripts with an offline assistant focused on production-safe scripting patterns. This listing helps with Project Library helpers, Gateway timers, Gateway message handlers, Perspective events and transforms, tag event scripts, tag browsing, tag reads and writes, Named Queries, prepared SQL, historian helpers, MES count logic, and practical validation plans.
Tested with Ignition 8.1.53.
Built from 10+ years of manufacturing and industrial automation experience across food packaging, planter-part manufacturing, and Tier 1 automotive environments, including practical Ignition use in production-facing work.
What It Helps With
- Create Jython 2.7-compatible scripts for Ignition 8.1 without Python 3-only syntax or unsupported CPython package assumptions.
- Keep Perspective button/event scripts thin while moving real work into reusable Project Library helpers.
- Add dry-run behavior, logger output, QualityCode checks, tag read/write validation, and target-side proof steps.
- Review pasted scripts, stack traces, Project Library snippets, tag event bodies, Perspective transforms, database helpers, and Gateway scripting requirements.
- Avoid common Ignition scripting traps around tag paths, bad-quality reads, Dataset values, Document tags, Named Query params, raw SQL placeholders, Gateway/Perspective scope boundaries, and Java-backed exceptions.
Example Prompt
Use ignition-jython-script-builder to build a safe offline script pattern.
Build an Ignition 8.1 Project Library helper and a thin Perspective Button onActionPerformed script. The button should write an operator-entered target speed to a configurable tag only when an enable/interlock tag is good and true. Use placeholders for tag provider/root/project paths. Include dryRun support, safe read/write quality checks, logging, and a short validation plan.
Example Output
Where It Goes
- Project Library path:
project.area.speedCommand - Perspective Button event:
onActionPerformed - Replace
project.area,<tagProvider>, and<rootPath>with the target Gateway/project values before testing.
Project Library Helper
# Project Library: project.area.speedCommand
import java
LOGGER_NAME = "ignition.script.speedCommand"
def _logger():
return system.util.getLogger(LOGGER_NAME)
def _result(ok, message):
return {"ok": bool(ok), "message": str(message)}
def write_target_speed(targetSpeed, commandTagPath, enableTagPath, dryRun=False):
logger = _logger()
try:
speed = float(targetSpeed)
except:
logger.warn("Rejected target speed because it was not numeric: %s" % repr(targetSpeed))
return _result(False, "Target speed is not numeric.")
paths = [str(enableTagPath)]
qv = system.tag.readBlocking(paths)[0]
if not qv.quality.isGood():
logger.warn("Enable/interlock tag bad quality at %s: %s" % (enableTagPath, qv.quality))
return _result(False, "Enable/interlock tag quality is bad.")
if qv.value is None or not bool(qv.value):
logger.info("Blocked target speed write because enable/interlock is false.")
return _result(False, "Enable/interlock is false.")
if dryRun:
logger.info("Dry run passed. Would write %s to %s" % (speed, commandTagPath))
return _result(True, "Dry run passed; no tag write performed.")
try:
qc = system.tag.writeBlocking([str(commandTagPath)], [speed])[0]
except java.lang.Throwable, exc:
logger.error("Target speed write threw an exception: %s" % exc)
return _result(False, "Target speed write threw an exception.")
if not qc.isGood():
logger.warn("Target speed write returned bad quality at %s: %s" % (commandTagPath, qc))
return _result(False, "Target speed write quality was not good.")
readback = system.tag.readBlocking([str(commandTagPath)])[0]
if not readback.quality.isGood():
logger.warn("Target speed readback bad quality at %s: %s" % (commandTagPath, readback.quality))
return _result(False, "Target speed write completed, but readback quality was bad.")
logger.info("Wrote target speed %s to %s" % (speed, commandTagPath))
return _result(True, "Target speed written.")
Perspective Button Script
# Perspective Button onActionPerformed
targetSpeed = self.getSibling("TargetSpeedInput").props.value
tagProvider = "<tagProvider>"
tagRoot = "<rootPath>"
commandTagPath = "[%s]%s/TargetSpeedCommand" % (tagProvider, tagRoot)
enableTagPath = "[%s]%s/EnableInterlock" % (tagProvider, tagRoot)
result = project.area.speedCommand.write_target_speed(
targetSpeed,
commandTagPath,
enableTagPath,
dryRun=bool(self.view.custom.dryRun)
)
self.view.custom.lastCommandResult = result
Validation Plan
- Run with
dryRun=Trueand confirm the command tag does not change. - Set the enable/interlock tag false and confirm the helper blocks the write.
- Test a bad-quality or missing enable/interlock tag and confirm the helper returns a blocked result.
- Test non-numeric operator input and confirm no tag write occurs.
- Test the accepted case and verify both the tag readback and the
view.custom.lastCommandResultobject.
Offline Capafy Edition
This Capafy edition works from user-provided requirements, pasted scripts, exported project snippets, tag paths, stack traces, database/named-query context, and described Gateway or Perspective behavior. It does not require live Gateway access and does not modify a running Ignition project.
Live Gateway reads, writes, Perspective deployment, production project changes, database changes, or real-time Gateway execution are outside this download edition and require a separate connection, authorization path, backup plan, and validation workflow.
Suggested Tags
Ignition 8.1, Jython 2.7.3, Project Library, Perspective, SCADA
Support
For support, contact [email protected].