1.jpg (117.9 KB)
下載附件
2020-4-25 15:49 上傳
- Private Sub Text1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- lblTopic = "輸入要監(jiān)控或設(shè)置的地址回車確定,如D0,T10,Y7等"
- End Sub
- Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
- If KeyCode <> 13 Then
- start = False
- End If
- End Sub
- Private Sub Text2_KeyPress(KeyAscii As Integer)
- char = Chr(KeyAscii)
- KeyAscii = Asc(UCase(char))
- If Device = "D" And CStr(Val(setad)) = setad And Val(setad) < 1000 Then
- start = False
- End If
- If (Device = "T" Or Device = "C") And CStr(Val(setad)) = setad And Val(setad) < 256 Then
- start = False
- End If
- If KeyAscii = 13 Then
- If Val(DevAdd) > 7999 Then
- If MsgBox("改變系統(tǒng)參數(shù)可能對系統(tǒng)造成破壞,是否寫入?", vbOKCancel + vbCritical) = vbCancel Then Exit Sub
- ElseIf MsgBox("改變當(dāng)前值可能對運行造成危險,是否寫入?", vbOKCancel + vbExclamation) = vbCancel Then Exit Sub
- End If
- If Device = "D" And Check1.Value = 0 Then
- DevAdd = Right(("0000" + setad), 4)
- ElseIf Device = "D" And Check1.Value = 1 Then
- DevAdd = Right(("0000" + setad), 4)
- Else
- DevAdd = Right(("000" + setad), 3)
- End If
- If OptionD.Value Then '十進(jìn)制方式
- If Device = "C" And Val(setad) > 199 Then 'C200以上寫入
- If Val(Text2.Text) > 2847483647# Then: GoTo this
- DevDat1 = cboStation.Text + "FFWW0" + Device + "N" + DevAdd + "01" + Right("00000000" + Hex(Val(Text2.Text)), 8)
- ElseIf Device = "D" And Check1.Value = 1 Then '雙字節(jié)D寫入
- If Val(Text2.Text) > 2847483647# Then: GoTo this
- DevDat1 = Right("00000000" + Hex(Val(Text2.Text)), 8)
- DevDat1 = Right(DevDat1, 4) + Left(DevDat1, 4)
- DevDat1 = cboStation.Text + "FFWW0" + Device + DevAdd + "02" + DevDat1
- Else
- If Val(Text2.Text) > 32767 Then: GoTo this
- If Device = "D" Then '單字節(jié)D寫入
- DevDat1 = cboStation.Text + "FFWW0" + Device + DevAdd + "01" + Right("0000" + Hex(Val(Text2.Text)), 4)
- Else 'C200以下寫入
- DevDat1 = cboStation.Text + "FFWW0" + Device + "N" + DevAdd + "01" + Right("0000" + Hex(Val(Text2.Text)), 4)
- End If
- End If
- Else '十六進(jìn)制方式
- If Device = "C" And Val(setad) > 199 Then 'C200以上寫入
- If Val("&H" + Text2.Text) > 2847483647# Then: GoTo this
- DevDat1 = cboStation.Text + "FFWW0" + Device + "N" + DevAdd + "01" + Right("00000000" + Text2.Text, 8)
- ElseIf Device = "D" And Check1.Value = 1 Then '雙字節(jié)D寫入
- If Val("&H" + Text2.Text) > 2847483647# Then: GoTo this
- DevDat1 = Right("00000000" + Text2.Text, 8)
- DevDat1 = Right(DevDat1, 4) + Left(DevDat1, 4)
- DevDat1 = cboStation.Text + "FFWW0" + Device + DevAdd + "02" + DevDat1
- Else
- If Val("&H" + Text2.Text) > 32767 Then: GoTo this
- If Device = "D" Then '單字節(jié)D寫入
- DevDat1 = cboStation.Text + "FFWW0" + Device + DevAdd + "01" + Right("0000" + Text2.Text, 4)
- ……………………
- …………限于本文篇幅 余下代碼請下載附件…………
復(fù)制代碼
VB開發(fā)的串口與三菱FX PLC通訊源碼.rar
(19.54 KB, 售價: 5 E幣)
2020-4-25 15:49 上傳
點擊文件名下載附件
售價: 5 E幣 [記錄]
[ 購買]
【必讀】版權(quán)免責(zé)聲明
1、本主題所有言論和內(nèi)容純屬會員個人意見,與本論壇立場無關(guān)。2、本站對所發(fā)內(nèi)容真實性、客觀性、可用性不做任何保證也不負(fù)任何責(zé)任,網(wǎng)友之間僅出于學(xué)習(xí)目的進(jìn)行交流。3、對提供的數(shù)字內(nèi)容不擁有任何權(quán)利,其版權(quán)歸原著者擁有。請勿將該數(shù)字內(nèi)容進(jìn)行商業(yè)交易、轉(zhuǎn)載等行為,該內(nèi)容只為學(xué)習(xí)所提供,使用后發(fā)生的一切問題與本站無關(guān)。 4、本網(wǎng)站不保證本站提供的下載資源的準(zhǔn)確性、安全性和完整性;同時本網(wǎng)站也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的損失或傷害。 5、本網(wǎng)站所有軟件和資料均為網(wǎng)友推薦收集整理而來,僅供學(xué)習(xí)用途使用,請務(wù)必下載后兩小時內(nèi)刪除,禁止商用。6、如有侵犯你版權(quán)的,請及時聯(lián)系我們(電子郵箱1370723259@qq.com)指出,本站將立即改正。
|