Beispiel #1
0
import plc
import mokuai
import PFP6G
# # com.open()
import time
# 3DA031B4

data = [0x0D,0x03,0x00,0x23,0x00,0x24]
from crc_check import crc16
senddata = crc16().createarray(data)

from PFP6G import PFP6G
pfp6g = PFP6G()
from baseData import devBaseData
from baseData import dataConstraint
DO1 = devBaseData('DO1',dataConstraint(1,1.0, None, None))
pfp6g.addDataItem('DO1', DO1)
DO2 = devBaseData('DO2',dataConstraint(1,1.0, None, None))
pfp6g.addDataItem('DO2', DO2)
DO3 = devBaseData('DO3',dataConstraint(1,1.0, None, None))
pfp6g.addDataItem('DO3', DO3)
DO4 = devBaseData('DO4',dataConstraint(1,1.0, None, None))
pfp6g.addDataItem('DO4', DO4)

DI1 = devBaseData('DI1',dataConstraint(1,1.0, None, None))
pfp6g.addDataItem('DI1', DI1)
DI2 = devBaseData('DI2',dataConstraint(1,1.0, None, None))
pfp6g.addDataItem('DI2', DI2)
DI3 = devBaseData('DI3',dataConstraint(1,1.0, None, None))
pfp6g.addDataItem('DI3', DI3)
DI4 = devBaseData('DI4',dataConstraint(1,1.0, None, None))
Beispiel #2
0
#coding=utf-8
#!/usr/bin/env python
'''
Created on 2015年7月8日

@author: sanhe
'''
from baseData import devBaseData,dataConstraint
from infrared import infrared

infrared1 = infrared()
print  isinstance(22,infrared)

YwrenConstriant = dataConstraint(1,1.0, None, None)
Ywren = devBaseData('101有无人',YwrenConstriant)
infrared1.addDataItem('YWren',Ywren)

LedStateConstriant = dataConstraint(1,1.0, None, None)
LedState = devBaseData('101 Led灯状态',LedStateConstriant)
infrared1.addDataItem('LedState',LedState)

DoorStateConstriant = dataConstraint(1,1.0, None, None)
DoorState = devBaseData('101门磁',DoorStateConstriant)
infrared1.addDataItem('DoorState',DoorState)

InfoTimeConstriant = dataConstraint(1,10.0, None, None)
InfoTime = devBaseData('101无感应时间',InfoTimeConstriant)
infrared1.addDataItem('InfoTime',InfoTime)

TemperatureConstriant = dataConstraint(1,0.5,-50.0,50.0)
Temperature = devBaseData('101红外温度',TemperatureConstriant)
Beispiel #3
0
#coding=utf8
'''
Created on 2015年6月18日

@author: sanhe
'''

from baseData import devBaseData,dataConstraint

from infrared import infrared

infrared1 = infrared()

YwrenConstriant = dataConstraint(1,1.0, None, None)
Ywren = devBaseData('101有无人',YwrenConstriant)
infrared1.addDataItem('YWren',Ywren)

LedStateConstriant = dataConstraint(1,1.0, None, None)
LedState = devBaseData('101 Led灯状态',LedStateConstriant)
infrared1.addDataItem('LedState',LedState)

DoorStateConstriant = dataConstraint(1,1.0, None, None)
DoorState = devBaseData('101门磁',DoorStateConstriant)
infrared1.addDataItem('DoorState',DoorState)

InfoTimeConstriant = dataConstraint(1,10.0, None, None)
InfoTime = devBaseData('101无感应时间',InfoTimeConstriant)
infrared1.addDataItem('InfoTime',InfoTime)

TemperatureConstriant = dataConstraint(1,0.5,-50.0,50.0)
Temperature = devBaseData('101红外温度',TemperatureConstriant)