Exploring the Possibility of Getting Feedback from CMD/.bat Gateway on Ignition Automation

Hi, everyone

I am involved in a project where I need to determine if it is possible to get feedback by capturing the output of a CMD/.bat executed on the Gateway.

The idea is to disable a PCS through a script, and we need to know if the PCS has been enabled or disabled through a True or False value that can be displayed on the console.

How could we achieve this by associating that feedback to a boolean tag? I think this would be the perfect solution for our needs. Any suggestions or similar experience?

many regards

Pipe the .bat output to a file and then read the file?
myScript.bat > result.txt
I don't know how you would know when the task was finished though.

it works, but how can I pass it to the scada? by a tag? or is there another method that could be useful for what I am looking for?

image

You'll have to open the file in the Ignition gateway script, parse it and, if you want it in a tag then use system.tag.writeBlocking to write to that tag.

1 Like

There may be some useful information in this thread:

1 Like

Use Java's ProcessBuilder class to construct your external process call--it can expose the standard I/O streams for your use. Do not use system.util.execute for anything other than fire-and-forget operations.

2 Likes

thanks again Phil, I have used just the method you indicated, and after a few hours I have found just what I wanted.

result:

image

thanks also to the others for answering

have a happy new year :fireworks: :tada: :partying_face:

2 Likes