The expression language should have all of its functions defined and documented. There is no notion of namespaces for expression functions, meaning that you type them and they work.
We’re referring to Jython (scripting) functions, which are very different from Expression Language functions. Most HMIs give you Microsoft VBA - you get whatever functions VBA supports. For FactoryPMI you get Jython, which includes Python functions. It’s like comparing the functions that you get in Microsoft Excel (expressions) to the functions in VBA that’s included with Excel (scripting functions).
A list of builtin, defined functions are available here. Here are a few example functions: abs(), len(), int(), round(), etc. ceil() is included in the math library.
Python also has many libraries (modules) that you can import for more functions. Examples include: math, cmath (complex), and random. For example:
message = 'Random number: ' + str(random.random())
Again, I’ll look into adding a reference for the modules and their functions that you can import in FactoryPMI. I would probably put it under: Contents>TechnicalReference>Jython>importable modules.
[quote=“Step7”]Thanks Nathan, I’ll give that a try.
It would be helpful to add your tips into the FactoryPMI help (Contents>TechnicalReference>ExpressionLanguage>MathematicalFunctions). Is “round”’ the only function that works by itself?[/quote]