EasyManuals Logo
Home>Mitsubishi>Controller>QJ71C24/-R2

Mitsubishi QJ71C24/-R2 User Manual

Mitsubishi QJ71C24/-R2
358 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #321 background imageLoading...
Page #321 background image
App. - 27 App. - 27
MELSEC-Q
APPENDIX
(2) Sample program
The following sample program reads D0 to D4 (five points) of the target PLC
using the logical station number.
(a) When Visual Basic
ยฎ
is used
1) Screen example (Form1)
Command1
' Connect to the communication line.
Command2
' Read the device data.
Command3
' Cut the communication line.
Text1
' Enter the logical station number.
ACT control (ActEasy IF)
' ACT control for utility setting type
2) Program example
Private Sub Command1_Click()
'
' Connection
'
Dim rtn As Long
' Get LogicalstationNumber
ActEasyIF1. ActLogicalStationNumber = Val(Text1.Text)
' Connection
rtn = ActEasyIF1. Open()
If rtn = 0 Then
MsgBox "The connection was successful"
Else
MsgBox "Connection Error:" & Hex(rtn)
End If
End Sub
Private Sub Command2_Click()
'
' Read
'
Dim rtn As Long
Dim idata(5) As Integer
' D0-D4 are read
rtn = ActEasyIF1. ReadDeviceBlock2 ("D0", 5, idata(0))
If rtn = 0 Then
MsgBox "D0-D5 = " & idata(0) & ", " & idata(1) & ", " & idata(2) & ", " & idata(3) & "," & idata(4)
Else
MsgBox "Read Error:" & Hex(rtn)
End If
End Sub

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Mitsubishi QJ71C24/-R2 and is the answer not in the manual?

Mitsubishi QJ71C24/-R2 Specifications

General IconGeneral
BrandMitsubishi
ModelQJ71C24/-R2
CategoryController
LanguageEnglish

Related product manuals