Script Parsing with PLCnext Engineer

Hi,

I'm curious if there is a way to implement parsing a script during runtime that can be used to control 61131 programs running on the 2152.

Here's some more detail of our situation.
We have a PLCnext project with several 61131 applications each running a piece of our automation setup using the 2152. There is an HMI that allows a user to modify parameters as needed on the system. This is good for manual control, but we wanted more automation for routine tasks. So we've created a separate 61131 (also running on the 2152) that can read and parse a text file that contains a basic command syntax that can be used to automatically control the other 61131 applications during runtime. Each command is a single line (terminated with Linefeed, Carriage return or semicolon) includes a custom command string with several "options" or switches (these use a "-").  It's looks similar to a command used on a CLI. 
This seems to work very well as we can run our script and produce log files of the results.  But as our system grows, we'd like to expand on our scripting capabilities to include FOR, WHILE, and IF statements. I've considered implementing this in the existing application, but all that I've read makes me think there could be a better way to use an existing parser.

So that's where I have my question: is there a parser already on the PLCnext that could be used to expand my scripting capabilities or could one be implemented with ability to control 61131 apps?
I saw awhile ago there was a JSON Function Block library, but that is now missing from the PLCnext store. I also saw the words "HMI – Scripting" on the PLCnext roadmap, so I was hoping this might also provide a solution.
Thank you for any advice you have.

Structured Text is a kind of scripting language, so I suppose this problem could be solved if you could load Structured Text from a file and have it interpreted at run-time. I am fairly sure that there is no feature like that planned for PLCnext Engineer.

[quote]I saw awhile ago there was a JSON Function Block library, but that is now missing from the PLCnext store.[/quote]
This is now part of the IIoT Library in the PLCnext Store, but I'm not sure if that will help.

[quote]I also saw the words "HMI – Scripting" on the PLCnext roadmap, so I was hoping this might also provide a solution.[/quote]
I don't think so. If that works like the scripting feature on other HMIs, those scripts will run on HMI client machine(s), and not on the PLC.

If your script ends up interfacing with the rest of the application through variables, then you could mark those "interface" variables in the PLCnext Engineer application with the HMI attribute. Then those variables can be accessed via the REST interface. You could then write your script in Python, and load that python module into a stand-alone Python application that reads and writes the interface variables via REST. Do you think that would work for your application?

It doesn't have to be Python, it could be any interpreted language that can act as a REST client, or (alternatively) an OPC UA client, or ... any other data access interface supported by the PLC.

Hi Martin,

Thanks for the response!
I'll look into the idea of using REST. All the needed variables are already mapped to HMI, so this won't be a problem. 
I'll experiment with this interface and see if this works as expected.
Thanks again,

Brent