-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvpe6070_demo.py
More file actions
34 lines (26 loc) · 999 Bytes
/
vpe6070_demo.py
File metadata and controls
34 lines (26 loc) · 999 Bytes
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
# vpe6070 Analog Output 0-10 VDC Module 4 Channel
# Demo Program sources outputs:
# 1 VDC on Channel 1
# 2 VDC on Channel 2
# 5 VDC on Channel 3
# 10 VDC on Channel 4
import asyncio
from pywlmio import *
NodeID = 4 #NodeID location is the Bacplane ID (Jumpers) and Power Supply Slot location
async def main():
init()
vo = VPE6070(NodeID)
while True:
try:
await asyncio.gather(
vo.ch1.write(1000), # Values written in mV (1 VDC)
vo.ch2.write(2000), # Values written in mV (2 VDC)
vo.ch3.write(5000), # Values written in mV (5 VDC)
vo.ch4.write(8000) # Values written in mV (10 VDC)
)
except WlmioWrongNodeError:
print("Error NodeID = %d Wrong module installed" % NodeID) # Error Check if wrong type of module installed
except WlmioInternalError:
print("Error NodeID = %d Timed out" % NodeID) # Error Check - Typically module not installed
await asyncio.sleep(1)
asyncio.run(main(), debug=True)