-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathread_IDs.py
39 lines (32 loc) · 1.08 KB
/
read_IDs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import sys
import time
import firebase_admin
from firebase_admin import db
import json
sys.path.insert(0, "..")
from opcua import Client, ua
from festo_opcua import simpleConnect
#IPs for each festo module
ip = '172.20.1.1' #Manual packing module STPLC_08
ip2 = '172.20.13.1' #Manual workstation STPLC_09
festo_connection = simpleConnect()
festo_connection.engageStopper(ip)
festo_connection.engageStopper(ip2)
festo_connection.startConveyor(ip)
festo_connection.startConveyor(ip2)
check = festo_connection.checkPallet(ip)
check2 = festo_connection.checkPallet(ip2)
while 1:
if check is True:
print(festo_connection.getCarrierID(ip))
festo_connection.releaseStopper(ip)
time.sleep(0.2)
festo_connection.engageStopper(ip)
if check2 is True:
print(festo_connection.getCarrierID(ip2))
festo_connection.releaseStopper(ip2)
time.sleep(0.2)
festo_connection.engageStopper(ip2)
check = festo_connection.checkPallet(ip)
check2 = festo_connection.checkPallet(ip2)
time.sleep(0.2)