laatzen/Pruef2000/source/frmUSQScan.frm
2021-10-01 11:11:04 +02:00

227 lines
6.1 KiB
Plaintext
Raw Permalink Blame History

VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmUSQScan
ClientHeight = 6270
ClientLeft = 60
ClientTop = 345
ClientWidth = 9900
LinkTopic = "Form2"
ScaleHeight = 6270
ScaleWidth = 9900
StartUpPosition = 3 'Windows-Standard
Begin MSComctlLib.StatusBar StatusBar1
Align = 2 'Unten ausrichten
Height = 315
Left = 0
TabIndex = 9
Top = 5955
Width = 9900
_ExtentX = 17463
_ExtentY = 556
Style = 1
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 1
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
EndProperty
EndProperty
End
Begin VB.Frame Frame2
Height = 1755
Left = 60
TabIndex = 3
Top = -60
Width = 5175
Begin VB.TextBox txtFlowMin
Height = 315
Left = 720
TabIndex = 6
Top = 360
Width = 915
End
Begin VB.TextBox txtFlowMax
Height = 315
Left = 2280
TabIndex = 5
Top = 360
Width = 915
End
Begin VB.CommandButton cmdStart
Caption = "START"
Height = 315
Left = 3420
TabIndex = 4
Top = 360
Width = 1215
End
Begin VB.Label Label1
Caption = "Von Q="
Height = 195
Left = 120
TabIndex = 8
Top = 420
Width = 555
End
Begin VB.Label Label2
Caption = "bis Q="
Height = 195
Left = 1740
TabIndex = 7
Top = 420
Width = 615
End
End
Begin VB.Frame Frame1
Height = 3915
Left = 60
TabIndex = 0
Top = 1680
Width = 5175
Begin VB.TextBox txtDurchflussSoll
Height = 315
Left = 1560
TabIndex = 1
Top = 240
Width = 855
End
Begin VB.Label Label3
Caption = "Durchfluss [m<>/h]:"
Height = 255
Left = 180
TabIndex = 2
Top = 300
Width = 1335
End
End
End
Attribute VB_Name = "frmUSQScan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public ParentFrm As frmUSHauptprf
Private FlowMax As Double
Private FlowMin As Double
Private m_colUniqueVorPP As CVorpruefpunktCol
Private m_colEinbauplatz As Collection
Private m_ersterPruefzaehler As CPruefzaehler
Private m_DurchflussSoll As Double
Private m_Referenzzaehler As CRefzaehler
Private m_Pumpe As CPumpe
Private m_SPS As CSPS
Private m_ColPumpen As Collection
Private mblnIsActivated As Boolean
Private Sub cmdStart_Click()
Call start
End Sub
Private Sub Form_Activate()
If mblnIsActivated = False Then
mblnIsActivated = True
End If
End Sub
Private Sub Form_Load()
Dim Einbauplatz As CEinbauplatz
Set m_colUniqueVorPP = ParentFrm.m_colUniqueVorPP
Set m_colEinbauplatz = ParentFrm.m_colEinbauplatz
txtFlowMax = m_colUniqueVorPP.Item(1).getQ
txtFlowMin = m_colUniqueVorPP.Item(m_colUniqueVorPP.Count).getQ
For Each Einbauplatz In m_colEinbauplatz
If Not Einbauplatz.getPruefzaehler Is Nothing Then
Set m_ersterPruefzaehler = Einbauplatz.getPruefzaehler
Exit For
End If
Next
Call start
End Sub
Private Sub start()
Dim blnFertig As Boolean
m_DurchflussSoll = txtFlowMax.Text
Do
' Durchfluss <20>ndern
m_DurchflussSoll = Val(Format(m_DurchflussSoll * 0.95, "0.00"))
If m_DurchflussSoll < Val(txtFlowMin) Then
blnFertig = True
End If
Debug.Print m_DurchflussSoll
sleep 1000
Loop While Not blnFertig
End Sub
Private Function initSPSfuerPP()
' SPS f<>r diesen Pr<50>fpunkt initialisieren, unabh<62>ngig von Waage/Beh<65>lter oder Durchlauf
' -------------------------------------------------------------------------------------
' Betrieb stoppen und Pumpen Abw<62>hlen
' Durchflu<6C> vorgabe
' Pumpe ausw<73>hlen und anw<6E>hlen
' Regelart und Regel-Position setzen
' MID Strang setzen
Dim i As Integer
Dim Waagengrenzwert As Double
' Betrieb Start zur<75>cksetzen
m_SPS.setBetrieb 8
sleep 500
m_SPS.setBetrieb 0
' Durchflu<6C> vorgabe
m_SPS.SetQSoll m_DurchflussSoll
'Debug.print "N<>chster Durchfluss: " & m_DurchflussSoll
' Pumpenauswahl
' Hochbeh<65>lter Auswahl wenn Q < 1 m ^3 -> Pumpe.Nr = 4
' siehe modPumpe
m_SPS.AllePumpenAbwaehlen
Set m_Pumpe = Pumpenwahl(m_DurchflussSoll, m_ColPumpen)
Debug.Print "zu startende Pumpe: " & m_Pumpe.GetSPSVarname
m_Pumpe.Anwahl
Select Case m_Pumpe.GetRegelart
Case "Servo"
' Servo vorgeschrieben
m_SPS.SetRegelart ("Servo")
' todo: Formel f<>r ServoPosition zur Feinregulierung des Durchflusses folgt
m_SPS.SetServoStellung 50
Case "FU"
' Frequenzumrichter vorgeschrieben
m_SPS.SetRegelart ("FU")
' todo: Formel f<>r Frequenzvorgabe zur Feinregulierung des Durchflusses folgt
m_SPS.SetServoStellung 50
Case Else
ErrorMsg "Es ist keine Regelart f<>r die Pumpe " & m_Pumpe.getNr & " in der ini-Datei definiert."
Call Abbruch
Exit Function
End Select
' Vorwahl Referenzzaehler
m_SPS.SetMID m_Referenzzaehler.EinbauplatzNr
End Function
Private Sub Abbruch()
End Sub