Professional Documents
Culture Documents
Program Dan Desain Visual Basic
Program Dan Desain Visual Basic
Private Sub Command1_Click(Index As Integer) Text1.Text = "*W010" & Index & "1#"
Text1.Text = "*W010" & Index & "1#" MSComm1.Output = Text1.Text
MSComm1.Output = Text1.Text
Shape1(Index).FillColor = vbRed End Sub
End Sub
Private Sub HScroll2_Change(Index As Integer)
Private Sub Command2_Click(Index As Integer) Text3.Text = HScroll2(Index).Value
Text1.Text = "*W010" & Index & "0#" If (Index = 1) Then
MSComm1.Output = Text1.Text Text3.Text = Format(HScroll2(Index).Value /
Shape1(Index).FillColor = vbBlack 10, "##.##")
End Sub End If
If Len(Text3.Text) = 3 Then
Private Sub Form_Load() Text3.Text = Text3.Text & 0
MSComm1.PortOpen = True End If
End Sub Text1.Text = "*W020" & Index & "1#"
MSComm1.Output = Text1.Text
Private Sub Form_UnLoad(cancel As Integer) End Sub
MSComm1.PortOpen = False
End Sub Private Sub HScroll3_Change(Index As Integer)
Text4.Text = HScroll3(Index).Value
Private Sub HScroll1_Change(Index As Integer) If (Index = 1) Then
Text2.Text = HScroll1(Index).Value Text4.Text = Format(HScroll3(Index).Value /
If (Index = 1) Then 10, "##.##")
Text2.Text = Format(HScroll1(Index).Value / End If
10, "##.##") If Len(Text4.Text) = 3 Then
End If Text4.Text = Text4.Text & 0
If Len(Text2.Text) = 3 Then End If
Text2.Text = Text2.Text & 0 Text1.Text = "*W030" & Index & "1#"
End If MSComm1.Output = Text1.Text
End Sub
Private Sub Command5_Click(Index As Integer)
Private Sub HScroll4_Change(Index As Integer) Text1.Text = "*W030" & Index & "1#"
Text5.Text = HScroll4(Index).Value MSComm1.Output = Text1.Text
If (Index = 1) Then Shape3(Index).FillColor = vbRed
Text5.Text = Format(HScroll4(Index).Value / End Sub
10, "##.##")
End If Private Sub Command6_Click(Index As Integer)
If Len(Text5.Text) = 3 Then Text1.Text = "*W030" & Index & "0#"
Text5.Text = Text5.Text & 0 MSComm1.Output = Text1.Text
End If Shape3(Index).FillColor = vbBlack
Text1.Text = "*W040" & Index & "1#" End Sub
MSComm1.Output = Text1.Text
Private Sub Command7_Click(Index As Integer)
End Sub Text1.Text = "*W040" & Index & "1#"
MSComm1.Output = Text1.Text
Shape4(Index).FillColor = vbRed
Private Sub MSComm1_OnComm() End Sub
Dim dataku As String
dataku = dataku & MSComm1.Input Private Sub Command8_Click(Index As Integer)
Text1.Text = dataku Text1.Text = "*W040" & Index & "0#"
End Sub MSComm1.Output = Text1.Text
Shape4(Index).FillColor = vbBlack
If Len(dataku) = 8 Then End Sub
Text1.Text = Mid(dataku, 3, 2)
Text1.Text = Mid(dataku, 5, 2)
Text1.Text = Mid(dataku, 7, 1) Private Sub Slider1_Click(Index As Integer)
Text6.Text = Slider1(Index).Value
If Val(Text1.Text = "1") Then If (Index = 1) Then
Shape1(Val(Text1.Text)).FillColor = vbRed Text6.Text = Format(Slider1(Index).Value / 10,
Shape2(Val(Text1.Text)).FillColor = vbRed "##.##")
Shape3(Val(Text1.Text)).FillColor = vbRed iThermometerX1(Index).Position = Text6.Text
Shape4(Val(Text1.Text)).FillColor = vbRed
Else End If
Shape1(Val(Text1.Text)).FillColor = vbBlack If Len(Text6.Text) = 3 Then
Shape2(Val(Text1.Text)).FillColor = vbBlack Text6.Text = Text6.Text & 0
Shape3(Val(Text1.Text)).FillColor = vbBlack End If
Shape4(Val(Text1.Text)).FillColor = vbBlack Text1.Text = "*W010" & Index & "1#"
End If MSComm1.Output = Text1.Text
End If End Sub
End Sub
Private Sub Slider2_Click(Index As Integer)
Text7.Text = Slider2(Index).Value
Private Sub Command3_Click(Index As Integer) If (Index = 1) Then
Text1.Text = "*W020" & Index & "1#" Text7.Text = Format(Slider2(Index).Value / 10,
MSComm1.Output = Text1.Text "##.##")
Shape2(Index).FillColor = vbRed iThermometerX1(Index).Position = Text7.Text
End Sub
End If
Private Sub Command4_Click(Index As Integer) If Len(Text7.Text) = 3 Then
Text1.Text = "*W020" & Index & "0#" Text7.Text = Text7.Text & 0
MSComm1.Output = Text1.Text End If
Shape2(Index).FillColor = vbBlack Text1.Text = "*W020" & Index & "1#"
End Sub MSComm1.Output = Text1.Text
End Sub
End If
If Len(Text8.Text) = 3 Then
Text8.Text = Text8.Text & 0
End If
Text1.Text = "*W013" & Index & "1#"
MSComm1.Output = Text1.Text
End Sub
End If
If Len(Text9.Text) = 3 Then
Text9.Text = Text9.Text & 0
End If
Text1.Text = "*W040" & Index & "1#"
MSComm1.Output = Text1.Text
End Sub
}
}