Automation Professionals is pleased to announce the public availability of the Simulation Aids Module (superseded by a bugfix version below…) for beta testing and general evaluation. The beta module is free and not time-limited in any way. I’m am considering keeping it free when placed in the marketplace at a future date. Feedback on that is appreciated, too. As a free module, support is limited to the forums.
The module itself is composed of four expression functions that help me test projects in-house when physical components are off-limits or don’t yet exist. There’s a handful of auxiliary scripting functions that enhance the experience, but the expression functions are the main event:
[ul][li]objectScript()
An alternative to runScript that packages any number of additional function arguments as an “args” tuple for use within the script expression. Also, in client or designer scopes, provides access to the binding properties.[/li]
[li]ramp()
Given speed and acceleration limits, compute values on a trajectory from the current value to a target position. Supports separate forward and reverse speeds. Updates on a given poll rate in client and designer scopes, and at the scan class rate in gateway scope.[/li]
[li]recorder()
Given a sample interval, row count limit, and sample values, return a dataset constructed from snapshots of the values at the requested interval. Discards the oldest row when the row limit is reached. Will not over-sample when values change faster than requested. Not available in Gateway scope.[/li]
[li]view()
Process a dataset into a new dataset, using jython expressions for each column to return, and in optional “Where”, “Group By”, “Having”, and “Order By” clauses. Extra arguments are converted into an “args” tuple for efficient use within the jython expressions. Not available in Gateway scope.[/li][/ul]
There’s fairly detailed documentation embedded in the module, accessible from the configuration pages.
Thanks! These were too useful to not share. Expression functions like these are particularly handy in the designer, as you don’t have to go to preview mode for them to execute. And if you have some jython code that absolutely has to execute, whether in design mode or preview mode or in a client, objectScript() is your friend.
I’ve created a sample project that interactively exercises the major features of this module. Includes various dataset filtering and ordering operations with the view() function, a “drum sequencer” style setpoint generator using objectScript(), the ramp() and recorder() functions in client tags, and user-editable pseudo-SQL from a text edit field.
The setpoint generator shows how to use the binding with objectScript() to efficiently poll only as often as necessary: at varying intervals from a constant configuration.
Created with v7.7.0. SimAidsDemo2015-09-01a.proj (52.8 KB)