Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8991521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:44:48+00:00 2026-06-15T22:44:48+00:00

Does anyone know the communication protocol for communication with the RS232 port of a

  • 0

Does anyone know the communication protocol for communication with the RS232 port of a Mitsubishi FX3G PLC?

I searched the site of Mitsubishi and Googled, but couldn’t find the syntax of the commands to send to obtain the data of specific registers in the PLC.

I found the following parts of the command though:

  • BR = bit read
  • BW = bit write
  • WR = word read
  • WW = word write

I could not find though wether i should use a straight cable, or a crossed cable, and not even at which baudrate i should communicate (or other settings like data bits, stop bits, and parity)

Does anyone have any experience with RS232 communication with a FX3G PLC ?

  • what is the baudrate (and other communication settings) ?
  • how is the header of the command built up ?
  • how is the command itself built up ?
  • how is the checksum calculated ?

(It doesn’t matter in which coding language or just a protocol manual)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T22:44:50+00:00Added an answer on June 15, 2026 at 10:44 pm

    I found the required documentation here

    The default communication settings are a baudrate of 9600, even parity, 7 data bits, 1 stop bit, and no checksum

    I changed this to a baudrate of 19200, none parity, 8 data bits, 1 stop bit, and checksum turned on :

    communication parameters

    A small VB6 project :

    '1 form with :
    '    1 mscomm control : name=comFX
    '    1 command button : name=cmdSend
    '    1 textbox        : name=txtShow   multiline=true
    Option Explicit
    
    Private Declare Function GetTickCount Lib "kernel32" () As Long
    
    Private mstrData As String
    Private mblnBusy As Boolean
    
    Private Sub Form_Load()
      With App
        Caption = .Title & " " & CStr(.Major) & "." & CStr(.Minor) & "." & CStr(.Revision)
      End With 'App
    End Sub
    
    Private Sub Form_Resize()
      Dim sngWidth As Single
      Dim sngTxtHeight As Single
      Dim sngCmdWidth As Single, sngCmdHeight As Single
      sngWidth = ScaleWidth
      sngCmdHeight = 315
      sngTxtHeight = ScaleHeight - sngCmdHeight
      txtShow.Move 0, 0, sngWidth, sngTxtHeight
      cmdSend.Move sngCmdWidth, sngTxtHeight, sngWidth, sngCmdHeight
    End Sub
    
    Private Sub cmdSend_Click()
      ReadReg "D8013", 7  'sec,min,hr,day,month,year,dayofweek
      ReadReg "R3310", 10 '10 data registers
    End Sub
    
    Private Sub ReadReg(strReg As String, intNr As Integer)
      Dim strCmd As String
      If NotBusy Then
        strCmd = "00FFWR0" & strReg & Right$("00" & Hex$(intNr), 2)
        strCmd = Chr$(5) & strCmd & GetSum(strCmd)
        With comFX
          If .PortOpen = False Then CommOpen
          .Output = strCmd
        End With 'comFX
        mblnBusy = True
      End If
    End Sub
    
    Private Sub CommOpen()
      With comFX
        If .PortOpen = True Then .PortOpen = False
        .CommPort = 1
        .Settings = "19200,N,8,1"
        .RThreshold = 1
        .PortOpen = True
      End With 'comFX
    End Sub
    
    Private Function NotBusy() As Boolean
      Dim lngTimeout As Long
      Dim blnResult As Boolean
      blnResult = True
      lngTimeout = GetTickCount + 1000 'timeout after being busy for 1 second
      Do While mblnBusy
        DoEvents
        If GetTickCount > lngTimeout Then
          blnResult = False
          Exit Do
        End If
      Loop
      NotBusy = blnResult
    End Function
    
    Private Sub comFX_OnComm()
      Dim strInput As String
      Select Case comFX.CommEvent
        Case comEvReceive
          strInput = comFX.Input
          mstrData = mstrData & strInput
          ProcessData
      End Select
    End Sub
    
    Private Sub ProcessData()
      'answer : ^02 00FF <data registers 4 characters per reg> ^03
      Dim lngStart As Long, lngEnd As Long
      Dim strHead As String, strSum As String
      Dim strEnd As String
      Dim strData As String
      lngStart = InStr(mstrData, Chr$(2))
      If lngStart > 0 Then
        strEnd = Chr$(3)
        lngEnd = InStr(lngStart, mstrData, strEnd)
        If lngEnd > 0 Then
          strHead = Mid$(mstrData, lngStart + 1, 4)
          If strHead = "00FF" Then
            strData = Mid$(mstrData, lngStart + 1, lngEnd - lngStart)
            strSum = Mid$(mstrData, lngEnd + 1, 2)
            If CheckSum(strData, strSum) Then
              mstrData = Mid$(mstrData, lngEnd + 3)
              ShowData Mid$(strData, 5, Len(strData) - 5)
              mblnBusy = False
            End If
          End If
        End If
      End If
    End Sub
    
    Private Function CheckSum(strData As String, strSum As String) As Boolean
      If strSum = GetSum(strData) Then
        CheckSum = True
      Else
        CheckSum = False
      End If
    End Function
    
    Private Function GetSum(strCmd As String) As String
      Dim intChar As Integer
      Dim lngSum As Long
      lngSum = 0
      For intChar = 1 To Len(strCmd)
        lngSum = lngSum + Asc(Mid$(strCmd, intChar, 1))
      Next intChar
      GetSum = Right$("00" + Hex$(lngSum), 2)
    End Function
    
    Private Sub ShowData(strData As String)
      txtShow.SelText = strData & vbCrLf
    End Sub
    

    Be careful not to send the commands too fast. Once per plc cycle (100 ms in my case) seems to be the limit.

    This code is in VB6, but the same could be applied in C# or any other languages.
    If you want me to make an example in C#, please contact me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know of any Java SDKs/libraries for communicating via the TL1 protocol that
Does anyone know if there is a port that absolutely has to be open
Does anyone know how disqus works? It manages comments on a blog, but the
I'm building a HID device. Does anyone know if the HID protocol supports two
Does anyone know if there is a way to generate different code in the
Does anyone know of a free tool, similar to what is built into Visual
Does anyone know why UsernameExists wont return True. I must have my syntax messed
Does anyone know of a mechanism in Sybase ASA 9 / Sybase SQL Anywhere
Does anyone know of any websites, or (preferably) downloadable packages that you can use
Does anyone know of a way to contain a nonbreaking space in an html

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.