Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
scripting [2023/08/02 15:02] wikiadmin |
scripting [2024/11/17 13:17] (current) wikiadmin |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | **Scripting** | + | **TransSECS |
+ | |||
+ | See also: [[TransSECScriptingMethodList | Common TransSECS JavaScript Methods List]] | ||
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 7: | ||
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(" | ||
</ | </ | ||
Line 22: | Line 20: | ||
where " | where " | ||
- | < | + | < |
+ | 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(" | ||
+ | </ | ||
**Register to Receive All Events in a TransSECS host application** | **Register to Receive All Events in a TransSECS host application** |