MSComm1.Output = Chr(13) 呼叫延迟 MSComm1.Output = Label2.Caption& DateTime.Now'gsm留言 通话延迟 MSComm1.Output = Chr(26) 通话延迟 MSComm1.Output =" at + cmgs =" 呼叫延迟 MSComm1.Output = Chr(34) 呼叫延迟 MSComm1.Output = txtno2.Text 通话延迟 MSComm1.Output = Chr(34) 通话延迟 MSComm1.Output = Chr(13) 呼叫延迟 MSComm1.Output = Lable2.Caption& DateTime.Now'gsm留言 通话延迟 MSComm1.Output = Chr(26) 通话延迟 cmdgsm.Caption =" GSM OFF" X = False 结束如果 ElseIf sensor = 56那么 Label2.Caption ="电源在变电站和区域1之间关闭" 如果X = True则为 MSComm1.Output =" at" 通话延迟 MSComm1.Output = Chr(13) 通话延迟 MSComm1.Output =" at + cmgf = 1" b $ b b呼叫延迟 MSComm1.Output = Chr(13) 呼叫延迟 MSComm1.Output = " at + cmgs =" 通话延迟 MSComm1.Output = Chr(34) 通话延迟 MSComm1.Output = txtno1.Text 通话延迟 MSComm1.Output = Chr(34) 通话延迟 MSComm1.Output = Chr(13) 呼叫延迟 MSComm1.Output = Label2.Caption& DateTime.Now'gsm留言 通话延迟 MSComm1.Output = Chr(26) 通话延迟 MSComm1.Output =" at + cmgs =" 呼叫延迟 MSComm1.Output = Chr(34) 呼叫延迟 MSComm1.Output = txtno2.Text 通话延迟 MSComm1.Output = Chr(34) 通话延迟 MSComm1.Output = Chr(13) 呼叫延迟 MSComm1.Output = Label2.Caption& DateTime.Now'gsm留言 通话延迟 MSComm1.Output = Chr(26) 通话延迟 cmdgsm.Caption =" GSM OFF" X = False 结束如果 ElseIf sensor = 88那么 Label2.Caption ="电源在变电站和区域2之间关闭" 如果X = True则为 MSComm1.Output =" at" 通话延迟 MSComm1.Output = Chr(13) 通话延迟 MSComm1.Output =" at + cmgf = 1" b $ b b呼叫延迟 MSComm1.Output = Chr(13) 呼叫延迟 MSComm1.Output = " at + cmgs =" 通话延迟 MSComm1.Output = Chr(34) 通话延迟 MSComm1.Output = txtno1.Text 通话延迟 MSComm1.Output = Chr(34) 通话延迟 MSComm1.Output = Chr(13) 呼叫延迟 MSComm1.Output = Label2.Caption& DateTime.Now'gsm留言 通话延迟 MSComm1.Output = Chr(26) 通话延迟 MSComm1.Output =" at + cmgs =" 通话延迟 MSComm1.Output = Chr(34) 通话延迟  MSComm1.Output = txtno2.Text 通话延迟 MSComm1.Output = Chr(34) 通话延迟 MSComm1.Output = Chr(13) 呼叫延迟 MSComm1.Output = Label2.Caption& DateTime.Now'gsm留言 通话延迟 MSComm1.Output = Chr(26) 通话延迟 cmdgsm.Caption =" GSM OFF" X = False 结束IF 否则 Label2.Caption ="电源在整个配电网中"&b; 结束IF¥b $ b如果Y = True则为 Label5.Caption = Time $ Label6.Caption =日期$ 如果Check1.Value = 1那么 device1 = True Else device1 = False 结束如果 如果Check2.Value  =那么 device2 = False 结束如果 如果device1 = False则为 ClrPortBit& H37A,1 $ ElseIf(Time $> Text1。文本和时间$< Text2.Text和device1 = True)然后 SetPortBit& H37A,1 否则 ClrPortBit& H37A ,1 $ 结束如果 如果device2 = False则为 ClrPortBit& H37A,2 ElseIf(Time $> Text3.Text时间$< Text4.Text和device2 =真)然后 SetPortBit& H37A,0 否则 ClrPortBit& H37A,0 $ 结束如果 结束如果  "请帮助我让这个代码运行"解决方案 您好, 此论坛适用于vb.net,而非VB6。如果这是VB6,请考虑在此发布,如果没有,请提供详细信息。  http://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier Private Sub cmd1_Click()If X=False Thencmd1.Caption="Area 1 ON"ClrPortBit &H37A,1X= TrueElsecmd1.Caption="Area 1 OFF"SetPortBit &H37A,1X=FalseEnd IfEnd SubPrivate Sub cmd2_Click()If Z=False Thencmd2.Caption="Area 2 ON"ClrPortBit &H37A,0Z= TrueElsecmd2.Caption="Area 2 OFF"SetPortBit & H37A,0Z=FalseEnd Ifsensor= lblwater.CaptionIf sensor =0 ThenLabel2.Caption="The Power is switched off from Generation site."If X=True ThenMSComm1.Output="at"Call delayMSComm1.Output=Chr(13)Call delayMSComm1.Output="at+cmgf=1"Call delayMSComm1.Output=Chr(13)Call delayMSComm1.Output="at+cmgs="Call delayMSComm1.Output=Chr(34)Call delayMSComm1.Output=txtno1.TextCall delayMSComm1.Output=Chr(34)Call delayMSComm1.Output=Chr(13)Call delayMSComm1.Output=Label2.Caption & DateTime.Now 'gsm messageCall delayMSComm1.Output=Chr(26)Call delayMSComm1.Output="at+cmgs="Call delayMSComm1.Output=Chr(34)Call delayMSComm1.Output=txtno2.TextCall delayMSComm1.Output=Chr(34)Call delayMSComm1.Output=Chr(13)Call delayMSComm1.Output=Label2.Caption & DateTime.Now 'gsm messageCall delayMSComm1.Output=Chr(26)Call delaycmdgsm.Caption="GSM OFF"X=FalseEnd IfElseIf sensor = 8 ThenLabel2.Caption = "The Power is switched off between Generation site and Sub Station"If X = True ThenMSComm1.Output = "at"Call delayMSComm1.Output = Chr(13)Call delayMSComm1.Output= "at+cmgf=1"Call delayMSComm1.Output = Chr(13)Call delayMSComm1.Output = "at+cmgs="Call delayMSComm1.Output= Chr(34)Call delayMSComm1.Output= txtno1.TextCall delayMSComm1.Output= Chr(34)Call delayMSComm1.Output = Chr(13)Call delayMSComm1.Output = Label2.Caption & DateTime.Now 'gsm messageCall delayMSComm1.Output = Chr(26)Call delayMSComm1.Output="at+cmgs"Call delayMSComm1.Output= Chr(34)Call delayMSComm1.Output= txtno2.TextCall delay MSComm1.Output= Chr(34)Call delayMSComm1.Output = Chr(13)Call delayMSComm1.Output = Label2.Caption & DateTime.Now 'gsm messageCall delayMSComm1.Output = Chr(26)Call delaycmdgsm.Caption = "GSM OFF"X=FalseEnd IfElseIf sensor = 24 ThenLabel2.Caption = "The Power is switched off between Substation and areas."If X = True ThenMSComm1.Output = "at"Call delayMSComm1.Output=Chr(13)Call delayMSComm1.Output="at+cmgs=1"Call delayMSComm1.Output = Chr(13)Call delayMSComm1.Output="at+cmgs="Call delayMSComm1.Output = Chr(34)Call delayMSComm1.Output=txtno1.TextCall delayMSComm1.Output = Chr(34)Call delayMSComm1.Output = Chr(13)Call delayMSComm1.Output = Label2.Caption & DateTime.Now 'gsm messageCall delayMSComm1.Output = Chr(26)Call delayMSComm1.Output = "at+cmgs="Call delayMSComm1.Output=Chr(34)Call delayMSComm1.Output = txtno2.TextCall delayMSComm1.Output = Chr(34)Call delayMSComm1.Output = Chr(13)Call delayMSComm1.Output = Lable2.Caption & DateTime.Now 'gsm messageCall delayMSComm1.Output = Chr(26)Call delaycmdgsm.Caption = "GSM OFF"X= FalseEnd IfElseIf sensor = 56 ThenLabel2.Caption = "The Power is switched off between Substation and area1"If X = True ThenMSComm1.Output = "at"Call delayMSComm1.Output = Chr(13)Call delayMSComm1.Output = "at+cmgf=1"Call delayMSComm1.Output=Chr(13)Call delayMSComm1.Output = "at+cmgs="Call delayMSComm1.Output = Chr(34)Call delayMSComm1.Output = txtno1.TextCall delayMSComm1.Output = Chr(34)Call delayMSComm1.Output = Chr(13)Call delayMSComm1.Output = Label2.Caption & DateTime.Now 'gsm messageCall delayMSComm1.Output = Chr(26)Call delayMSComm1.Output = "at+cmgs="Call delayMSComm1.Output = Chr(34)Call delayMSComm1.Output = txtno2.TextCall delayMSComm1.Output = Chr(34)Call delayMSComm1.Output = Chr(13)Call delayMSComm1.Output = Label2.Caption & DateTime.Now 'gsm messageCall delayMSComm1.Output = Chr(26)Call delaycmdgsm.Caption = "GSM OFF"X= FalseEnd IfElseIf sensor = 88 ThenLabel2.Caption = "The Power is switched off between Substation and area2"If X= True ThenMSComm1.Output = "at"Call delayMSComm1.Output = Chr(13)Call delayMSComm1.Output = "at+cmgf=1"Call delayMSComm1.Output = Chr(13)Call delayMSComm1.Output = "at+cmgs="Call delayMSComm1.Output = Chr(34)Call delayMSComm1.Output = txtno1.TextCall delayMSComm1.Output = Chr(34)Call delayMSComm1.Output = Chr(13)Call delayMSComm1.Output = Label2.Caption & DateTime.Now 'gsm messageCall delayMSComm1.Output = Chr(26)Call delayMSComm1.Output = "at+cmgs="Call delayMSComm1.Output = Chr(34)Call delay MSComm1.Output = txtno2.TextCall delayMSComm1.Output = Chr(34)Call delayMSComm1.Output = Chr(13)Call delayMSComm1.Output = Label2.Caption & DateTime.Now 'gsm messageCall delayMSComm1.Output = Chr(26)Call delaycmdgsm.Caption = "GSM OFF"X= FalseEnd IFElseLabel2.Caption = "The power is there in the entire distribution grid"End IFIf Y = True ThenLabel5.Caption = Time$Label6.Caption = Date$If Check1.Value = 1 Thendevice1 = TrueElsedevice1 = FalseEnd IfIf Check2.Value  = Thendevice2 = FalseEnd IfIf device1=False ThenClrPortBit &H37A, 1ElseIf (Time$ > Text1.Text And Time$<Text2.Text And device1 = True) ThenSetPortBit &H37A, 1ElseClrPortBit &H37A, 1End IfIf device2 = False ThenClrPortBit &H37A, 2ElseIf (Time$ > Text3.Text An Time$<Text4.Text And device2 = True) ThenSetPortBit &H37A, 0ElseClrPortBit &H37A, 0End IfEnd If "PLEASE HELP ME MAKE THIS CODE RUN" 解决方案 Hello,This forum is for vb.net, not VB6. If this is VB6 please consider posting here and if not please provide details. http://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier 这篇关于电力管理系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-20 01:27