Private Sub Command1_Click() '電機(jī)啟動(dòng)
Dim a As Integer
Dim b As Integer
b = 0
a = MsgBox("是否在啟動(dòng)電機(jī)時(shí)就啟動(dòng)監(jiān)視功能并進(jìn)入曲線監(jiān)控畫面", 4, "監(jiān)控選擇")
If a = 6 Then
'曲線監(jiān)控.Visible = True
If qxstart_flag = False Then
Set 曲線監(jiān)控.s = CreateObject("Excel.Application")
'曲線監(jiān)控.s.Visible = True
Set 曲線監(jiān)控.exwbook = Nothing
Set 曲線監(jiān)控.exsheet = Nothing
Set 曲線監(jiān)控.exwbook = 曲線監(jiān)控.s.workbooks.open("d:/vb98/3-1.xls")
Set 曲線監(jiān)控.exsheet = 曲線監(jiān)控.exwbook.Worksheets("sheet1")
qxstart_flag = True
End If
曲線監(jiān)控.Visible = True
曲線監(jiān)控.Timer1.Enabled = True
End If
Do While Form1.complish = True
a = 0
Loop
Form1.complish = True
a = Form1.forcem_y("m0", 1)
Do While b < 10000
b = b + 1
Loop
Do While Form1.complish = True
a = 0
Loop
Form1.complish = True
a = Form1.forcem_y("m0", 0)
End Sub
上面是我寫的電機(jī)啟動(dòng)代碼,上升沿置啟動(dòng)指令,下降沿置M8122發(fā)送請(qǐng)求