#!/usr/bin/python3 import HVLibrary as hv # hv.get_value('03:000:' + hv.Ch_PV_List[1]) # hv.get_value('03:000:' + hv.Ch_PV_List[0]) # index = 14 # hv.get_value('03:000:' + hv.Ch_PV_List[index], True) # cf = hv.get_CtrlField('03:000:' + hv.Ch_PV_List[index]) # print(cf) # bd = [] # for k in range(2): # bd.append(hv.Board(3 + k)) # print( bd[0].GetTemp()) # print( bd[0].Channel[15].GetName() ) # bd[0].Channel[15].SetPowerOnOff(1) # print(bd[0].Channel[15].GetPowerOnOff()) # print(bd[0].Channel[15].GetVMon()) # print(bd[0].Channel[15].GetPowerOnOff()) # for k in range(2): # print("==========================") # for i in range(bd[k].numCh): # print("{:.2f}".format(bd[k].Channel[i].GetVMon())) # hv.set_value('03:015:Pw', 1) # haha = hv.get_value('03:015:Status') # print(haha) # haha = hv.get_value('03:015:Pw') # print(haha) # haha = hv.get_value('03:015:V0Set') # print(haha) # haha = hv.get_value('03:015:VMon') # print(haha) # haha = hv.get_value('03:BdStatus') # print(haha) # hv.epics.caput('solarisHV:03:015:Pw', 1) # hv.epics.cainfo('solarisHV:03:015:Pw') # hv.epics.cainfo('solarisHV:03:015:VMon') # hv.epics.cainfo('solarisHV:03:015:V0Set') # hv.epics.cainfo('solarisHV:03:015:Status') # hv.epics.cainfo('solarisHV:03:BdStatus') # m1 = hv.epics.caget('solarisHV:03:015:Pw', use_monitor= False) # print(m1) # m1 = hv.epics.caget('solarisHV:03:015:VMon') # print(m1) # m1 = hv.epics.caget('solarisHV:03:015:Pw') # print(m1) # hv.epics.camonitor('solarisHV:03:015:Pw') # pvList = [] # pvValue = [] # for i in range(10): # pvList.append('solarisHV:03:' + f"{i:03d}" + ":V0Set") # pvValue.append(10) # # haha = hv.epics.caget_many(pvList) # haha = hv.epics.caput_many(pvList, pvValue) # print(haha) import influxdb_client from influxdb_client import InfluxDBClient, Point, WritePrecision from influxdb_client.client.write_api import SYNCHRONOUS, ASYNCHRONOUS ip = "192.168.0.200:8086" write_client = influxdb_client.InfluxDBClient(url=ip) bucket = "HV" write_api = write_client.write_api(write_options=ASYNCHRONOUS) points = [] points.append(Point("Voltage").tag("Bd", 3).tag("Ch", 0).field("value",float(10))) write_api.write(bucket=bucket, record=points)