Skip to content

Instantly share code, notes, and snippets.

GET http://server/twins/{id-or-aka}/quantity?v=latest&averagePieceWeight={apw}&sampleSize={ss}
- transaction
- write 1 to ch1.DemandPoll
- write 1 to ch2.DemandPoll
- wait for ch1.DemandPoll=0
- wait for ch2.DemandPoll=0
- wait for ch1.Weight value
- wait for ch2.Weight value
- timeout transaction
- calculate quantity
GET http://server/twins/{id-or-aka}/quantity?v=latest&averagePieceWeight={apw}&sampleSize={ss}
- transaction
- write 1 to DemandPoll
- wait for DemandPoll=0
- wait for SampleScaleWeight value
- wait for FloorScaleWeight value
- timeout transaction
- calculate quantity
- return quantity
import sys
from org.python.core import PyDictionary
from com.inductiveautomation.ignition.common.model import ApplicationScope
def Subscribe(messageTypes,projectScopeOnly=True):
subscription = {}
subscription['messageTypes'] = messageTypes if isinstance(messageTypes,list) else [messageTypes]
subscription['project'] = system.util.getProjectName()
subscription['projectScopeOnly'] = projectScopeOnly
subscription['scope'] = ApplicationScope.getGlobalScope()
@cmisztur
cmisztur / pycom-jtag-connection.csv
Created October 24, 2018 15:30
JTAG --> PYCOM Connection
NAME JLINK PY-EXPANSION-3 CPU-LOPY-1
VTREF 1 3V3 3V3
NTRST 3 RST P9
TDI 5 G16 P18
TMS 7 G10 P17
TCK 9 G18 P20
RTCK 11 NC NC
TDO 13 G11 P21
RESET 15 NC NC
DBGRQ 17 NC NC
@cmisztur
cmisztur / wak-oauth-register-state.json
Created September 26, 2018 12:49
WAK OAuth Register State
{
"s": "03e68c85-b7d7-477d-a279-e393ddf83188",
"i": "0660832ed102cb146a33",
"k": "5bc0c5e9b538a1852266222ff11b73038040a694a1527a7d6853a65c7c27",
"t_u": "https://www.wunderlist.com/oauth/access_token",
"t_p": [
{
"k": "grant_type",
"v": "authorization_code"
}
import System,clr
clr.AddReference("System.Core")
from System.Diagnostics.Eventing.Reader import EventLogReader
from System.Diagnostics.Eventing.Reader import EventLogQuery
from System.Diagnostics.Eventing.Reader import PathType
from System.Diagnostics.Eventing.Reader import EventRecord
from System import DateTime
import sys
print (sys.version)
# boot.py -- run on boot-up
import network
import time
from machine import RTC
wlan = network.WLAN(mode=network.WLAN.STA)
wlan.connect('your-ssid', auth=(network.WLAN.WPA2, 'your-pass'))
while not wlan.isconnected():
time.sleep_ms(50)
print(wlan.ifconfig())
rtc = RTC()
@cmisztur
cmisztur / existdb_poly_prep.csv
Last active June 25, 2018 19:11
eXist-db Polymer Windows Prep
software version-used location notes
Windows Server 2016 Std http://microsoft.com
JDK 8u171 http://www.oracle.com
eXist-db 5.0.0 RC1 http://exist-db.org
nodejs 8.11.3 http://nodejs.org npm install -g bower polymer-cli
Ant 1.10.4 https://ant.apache.org https://bit.ly/2MUyj9s
This file has been truncated, but you can view the full file.
2018-05-29 09:22:51.0140 | Trace | KP.SampleScripts.DeflectorCollectorModel001Script | OPC Item Trace
count:1000, tsJs:1527603770767, tsUtc:5/29/2018 2:22:51 PM, tsLocal:5/29/2018 9:22:51 AM
id:US0200PLC1018.Deflector.RunState, quality:True, value:1, tsJs:1527302370500, tsUtc:5/26/2018 2:39:30 AM, tsLocal:5/25/2018 9:39:30 PM
id:US0200PLC1018.Deflector.JobTotalCount, quality:True, value:21714, tsJs:1527302370500, tsUtc:5/26/2018 2:39:30 AM, tsLocal:5/25/2018 9:39:30 PM
id:US0200PLC1018.Deflector.JobTotalCount, quality:True, value:21718, tsJs:1527302380520, tsUtc:5/26/2018 2:39:41 AM, tsLocal:5/25/2018 9:39:41 PM
id:US0200PLC1013.Deflector.RunState, quality:True, value:1, tsJs:1527302386275, tsUtc:5/26/2018 2:39:46 AM, tsLocal:5/25/2018 9:39:46 PM
id:US0200PLC1013.Deflector.JobTotalCount, quality:True, value:28463, tsJs:1527302386275, tsUtc:5/26/2018 2:39:46 AM, tsLocal:5/25/2018 9:39:46 PM
id:US0200PLC1018.Deflector.JobTotalCount, quality:True, value:21729, tsJs:1527302390491, tsUtc:5/26/2018 2:39:50 AM, tsLo
2018-05-21 21:23:15.4278 | Trace | KP.SampleScripts.DeflectorCollectorModel001Script | OPC Item Trace
count:56, tsJs:1526955795068, tsUtc:5/22/2018 2:23:15 AM, tsLocal:5/21/2018 9:23:15 PM
id:US0200PLC1015.Deflector.JobTotalCount, quality:True, value:18471, tsJs:1526955677657, tsUtc:5/22/2018 2:21:18 AM, tsLocal:5/21/2018 9:21:18 PM
id:US0200PLC1024.Deflector.JobTotalCount, quality:True, value:22799, tsJs:1526955679201, tsUtc:5/22/2018 2:21:19 AM, tsLocal:5/21/2018 9:21:19 PM
id:US0200PLC1013.Deflector.JobTotalCount, quality:True, value:36297, tsJs:1526955680361, tsUtc:5/22/2018 2:21:20 AM, tsLocal:5/21/2018 9:21:20 PM
id:US0200PLC1016.Deflector.JobTotalCount, quality:True, value:21889, tsJs:1526955681273, tsUtc:5/22/2018 2:21:21 AM, tsLocal:5/21/2018 9:21:21 PM
id:US0200PLC1016.Deflector.JobTotalCount, quality:True, value:21896, tsJs:1526955685972, tsUtc:5/22/2018 2:21:26 AM, tsLocal:5/21/2018 9:21:26 PM
id:US0200PLC1015.Deflector.JobTotalCount, quality:True, value:18494, tsJs:1526955685977, tsUtc:5/22/2018