scripting
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| scripting [2023/08/02 15:51] – wikiadmin | scripting [2025/05/20 11:12] (current) – wikiadmin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | **Scripting** | + | **TransSECS |
| + | |||
| + | See also: [[TransSECScriptingMethodList | Common TransSECS JavaScript Methods List]] | ||
| + | |||
| + | Also see: Why you need to [[add_incomingValue_last_lineofscript|add " | ||
| The Devices version of TransSECS (TransSECS Devices) enables java scripting on the data sources, messages, and message data. | The Devices version of TransSECS (TransSECS Devices) enables java scripting on the data sources, messages, and message data. | ||
| Line 5: | Line 9: | ||
| Look at the sample scripts on the messages and data sources in the sample PLCTool. | Look at the sample scripts on the messages and data sources in the sample PLCTool. | ||
| - | **Common Problems** | + | **Controller Reference** |
| + | |||
| + | For all scripts where you need a reference to the tool interface (or host definition) you will need to get this interface using TransSECSController.getSingleController() or TransSECSController.findController(" | ||
| - | if you see an error such as: | ||
| - | TypeError: null has no such function " | ||
| - | For example: | ||
| - | TypeError: null has no such function " | ||
| <code javascript> | <code javascript> | ||
| var TransSecsController = Java.type(" | var TransSecsController = Java.type(" | ||
| - | </ | + | |
| - | before you do this: | + | |
| - | < | + | |
| secsInterface=TransSecsController.findController(" | secsInterface=TransSecsController.findController(" | ||
| </ | </ | ||
| - | where " | + | where " |
| + | |||
| + | <code javascript> | ||
| + | var TransSecsController = Java.type(" | ||
| - | < | ||
| secsInterface=TransSecsController.getSingleController(); | secsInterface=TransSecsController.getSingleController(); | ||
| + | </ | ||
| + | |||
| + | |||
| + | **Common Problems** | ||
| + | |||
| + | if you see an error such as: | ||
| + | TypeError: null has no such function " | ||
| + | For example: | ||
| + | TypeError: null has no such function " | ||
| + | |||
| + | <code javascript> | ||
| + | var TransSecsController = Java.type(" | ||
| </ | </ | ||
| Line 51: | Line 65: | ||
| var TransSecsController = Java.type(" | var TransSecsController = Java.type(" | ||
| - | | + | |
| | | ||
| | | ||
scripting.1691005903.txt.gz · Last modified: by wikiadmin
