Example #1
0
    rand1 = tag_egine.read_tag("RAND1")
    sine_wave = tag_egine.read_tag("SINE_WAVE")
    T1 = tag_egine.read_tag("T1")
    T2 = tag_egine.read_tag("T2")
    T3 = tag_egine.read_tag("T3")
    T4 = tag_egine.read_tag("T4")
    T5 = tag_egine.read_tag("T5")

    print("")
    print("RAND1    : {}".format(rand1))
    print("sine_wave: {}".format(sine_wave))
    print("T1       : {}".format(T1))
    print("T2       : {}".format(T2))
    print("T3       : {}".format(T3))
    print("T4       : {}".format(T4))
    print("T5       : {}".format(T5))


app.define_user("Luke", "skywalker", VISITOR_ROLE)

if __name__ == "__main__":

    app.set_db(dbfile="tags.db")
    app.set_log(file="app.log")
    app.set_dbtags(["RAND1", "RAND2"], 0.2)
    app.set_dbtags(["T1", "T2", "T3"], 0.5)

    app.enable_auth()
    app.run()
Example #2
0
    direction = 1

    while True:

        time.sleep(0.5)

        T1 = tag_egine.read_tag("T1")
        T1 += direction

        tag_egine.write_tag("T1", T1)

        if T1 >= 60:
            direction *= -1

        if T1 <= 5:
            direction *= -1


app.define_user("Luke", "skywalker", VISITOR_ROLE)
app.define_user("rackio", "12345678", "System")

if __name__ == "__main__":

    app.set_db(dbfile="tags.db")
    app.set_log(file="app.log")
    app.set_dbtags(["RAND1", "RAND2"], 0.2)
    app.set_dbtags(["T1", "T2", "T3"], 0.5)

    app.enable_auth()
    app.run(8030)
Example #3
0
tag_egine.set_tag("T3", "float")

@app.rackit(1)
def writer1():

    tag_egine.write_tag("T1", 15)
    tag_egine.write_tag("T2", 40)

    direction = 1

    while True:

        time.sleep(0.5)

        T1 = tag_egine.read_tag("T1")
        T1 += direction

        tag_egine.write_tag("T1", T1)

        if T1 >= 60:
            direction *= -1

        if T1 <= 5:
            direction *= -1

app.define_user("rackio", "12345678")

if __name__ == "__main__":

    app.set_db(dbfile="test.db")
    app.run(8030)