Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
devices_scripting [2020/05/12 21:15]
wikiadmin
devices_scripting [2025/01/03 10:02] (current)
wikiadmin
Line 1: Line 1:
-**Scripting with TransSECS Devices**+====Scripting with TransSECS Devices====
  
-To write a value to a server in the devices the format is:+[[Scripting for PLC Servers]] 
 +(Read/Write values to PLCs)
  
 +[["incomingValue" and Server Values]]
 +(Setting Server outputs and values)
  
-''/Devices/[DeviceNodeName]_Servers/[ServerName]->[setValue]''+[[Checking Quality on an incomingValue Triggering a Script]]
  
 +[[devices_databases|Scripting for Databases]]
 +(Recipe Management)
  
-For example, to set the integer value 2 to a server called ModbusWord under the ModbusTCP node use: +[[Scripting to Handle Host Messages in TransSECS Devices]]
-<code javascript> +
-/Devices/ModbusTCP_Servers/ModbusWord->setIntValue(2); +
-</code>+
  
-TransSECS is thread safe and so you can create threads in a script.  Here's an example that creates a thread before setting the value of a Modbus server.+[[Setting the System Date from PLC Registers]]
  
-<code javascript> +[[Storing Reports and Events to a Log File]]
-var Thread = Java.type("java.lang.Thread"); +
-var Runnable = Java.type("java.lang.Runnable");+
  
-// declare our thread +[[FTP File Upload Example]]
-this.thread = new Thread(new Runnable(){ +
-  run: function () { +
-      /Devices/ModbusTCP_Servers/ModbusWord->setIntValue(2); +
-      print("printed from a separate thread"); +
-  } +
-}); +
- +
-// start our thread +
-this.thread.start(); +
-</code>+
  • devices_scripting.1589336136.txt.gz
  • Last modified: 2020/05/12 21:15
  • by wikiadmin