transsecsscripts
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| transsecsscripts [2020/07/21 00:45] – wikiadmin | transsecsscripts [2020/09/22 10:15] (current) – wikiadmin | ||
|---|---|---|---|
| Line 16: | Line 16: | ||
| var SecsFormat54 = Java.type(" | var SecsFormat54 = Java.type(" | ||
| - | + | status=incomingValue.getIntValue(); | |
| - | //convert integer value to String and update the VID on a value change | + | //convert integer value to a String and update the VID on a value change |
| //values are 0=Uninitialized 1=Ready To Start 2=Running 3=Completed | //values are 0=Uninitialized 1=Ready To Start 2=Running 3=Completed | ||
| - | //if value is out of range, set status | + | //if value is out of range, set it to " |
| try { | try { | ||
| - | status=incomingValue.getIntValue(); | ||
| - | stringValue=" | ||
| switch (status) { | switch (status) { | ||
| case 0: | case 0: | ||
| Line 35: | Line 33: | ||
| case 3: | case 3: | ||
| stringValue=" | stringValue=" | ||
| - | break; | + | default: |
| - | } | + | |
| + | } | ||
| tool=TransSecsController.findController(" | tool=TransSecsController.findController(" | ||
| gh = tool.getGemHandler(); | gh = tool.getGemHandler(); | ||
| - | gh.setValue(" | + | |
| - | + | //get the current VID value and set this new value if this is a change | |
| + | currentValue = gh.getValue(" | ||
| + | |||
| + | //check that the value has changed before writing to the VID | ||
| + | if (!(currentValue.equals(stringValue))){ | ||
| + | | ||
| + | } | ||
| } catch (e) { | } catch (e) { | ||
| print(" | print(" | ||
| - | print(e.stack)); | + | print(e.stack); |
| } | } | ||
| </ | </ | ||
| + | === Additional Examples === | ||
| + | [[scriptingexamples|TansSECS and MIStudio JavaScript Examples]] | ||
| - | more examples coming soon! | + | [[devices|TransSECS Devices JavaScript Examples]] |
transsecsscripts.1595306725.txt.gz · Last modified: by wikiadmin
