add setTime to test IOC

This commit is contained in:
Michael Davidsaver
2018-04-17 10:52:51 -07:00
parent 4269c69c23
commit 44e5bd98b9
2 changed files with 23 additions and 0 deletions

View File

@ -46,3 +46,11 @@ record(ai, "$(P):A-RB") {
field(DTYP, "Python Device") field(DTYP, "Python Device")
field(INP , "@test5 hello none") field(INP , "@test5 hello none")
} }
record(longin, "$(P)li:time") {
field(DTYP, "Python Device")
field(INP , "@timetest")
field(SCAN, "1 second")
field(TSEL, "-2")
}

15
testApp/timetest.py Normal file
View File

@ -0,0 +1,15 @@
from __future__ import print_function
import datetime
class MySup(object):
def __init__(self, rec, args):
pass
def process(self, rec, reason):
rec.VAL = 1+rec.VAL
# could also pass in float or tuple (sec, nanosec)
rec.setTime(datetime.datetime.now())
def detach(self, rec):
pass
build = MySup