Linux上位机Windows上位机C++(QT)开发三菱上位机MC 1E 二进制通信 源码 C++快速实现三菱 MC 1E 二进制 支持三菱FX和A系列PLC A-1E 帧 国产化系统上位机

更多源码下载https://8ma.co/res/YBMV713F

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>MitsubishiPlc</class>
 <widget class="QWidget" name="MitsubishiPlc">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>1030</width>
    <height>646</height>
   </rect>
  </property>
  <property name="windowTitle">
   <string>QT(C++)与三菱MC 1E 二进制协议通信</string>
  </property>
  <layout class="QGridLayout" name="gridLayout">
   <item row="0" column="0">
    <layout class="QVBoxLayout" name="verticalLayout" stretch="6,4">
     <item>
      <layout class="QVBoxLayout" name="verticalLayout_2">
       <item>
        <widget class="QWidget" name="widget" native="true">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
         <property name="minimumSize">
          <size>
           <width>0</width>
           <height>340</height>
          </size>
         </property>
         <widget class="QLineEdit" name="lineEdit_2">
          <property name="geometry">
           <rect>
            <x>460</x>
            <y>60</y>
            <width>81</width>
            <height>31</height>
           </rect>
          </property>
          <property name="text">
           <string>6000</string>
          </property>
         </widget>
         <widget class="QLabel" name="label_4">
          <property name="geometry">
           <rect>
            <x>60</x>
            <y>140</y>
            <width>61</width>
            <height>16</height>
           </rect>
          </property>
          <property name="text">
           <string>读地址:</string>
          </property>
         </widget>
         <widget class="QPushButton" name="bt_open">
          <property name="geometry">
           <rect>
            <x>570</x>
            <y>50</y>
            <width>91</width>
            <height>41</height>
           </rect>
          </property>
          <property name="text">
           <string>连接</string>
          </property>
          <property name="type" stdset="0">
           <string>primary</string>
          </property>
         </widget>
         <widget class="QLineEdit" name="lineEdit">
          <property name="geometry">
           <rect>
            <x>130</x>
            <y>60</y>
            <width>211</width>
            <height>31</height>
           </rect>
          </property>
          <property name="text">
           <string>127.0.0.1</string>
          </property>
         </widget>
         <widget class="QLineEdit" name="lineEdit_4">
          <property name="geometry">
           <rect>
            <x>350</x>
            <y>130</y>
            <width>81</width>
            <height>31</height>
           </rect>
          </property>
          <property name="text">
           <string>1</string>
          </property>
         </widget>
         <widget class="QLabel" name="label_2">
          <property name="geometry">
           <rect>
            <x>400</x>
            <y>70</y>
            <width>51</width>
            <height>16</height>
           </rect>
          </property>
          <property name="text">
           <string>端口:</string>
          </property>
         </widget>
         <widget class="QLabel" name="label_5">
          <property name="geometry">
           <rect>
            <x>280</x>
            <y>140</y>
            <width>61</width>
            <height>16</height>
           </rect>
          </property>
          <property name="text">
           <string>读数量:</string>
          </property>
         </widget>
         <widget class="QPushButton" name="bt_close">
          <property name="geometry">
           <rect>
            <x>690</x>
            <y>50</y>
            <width>91</width>
            <height>41</height>
           </rect>
          </property>
          <property name="text">
           <string>断开</string>
          </property>
          <property name="type" stdset="0">
           <string>danger</string>
          </property>
         </widget>
         <widget class="QLabel" name="label_3">
          <property name="geometry">
           <rect>
            <x>150</x>
            <y>10</y>
            <width>561</width>
            <height>31</height>
           </rect>
          </property>
          <property name="text">
           <string>QT(C++)实现MC 1E 二进制协议与三菱PLC通信</string>
          </property>
          <property name="type" stdset="0">
           <string>h3</string>
          </property>
         </widget>
         <widget class="QLabel" name="label">
          <property name="geometry">
           <rect>
            <x>60</x>
            <y>70</y>
            <width>61</width>
            <height>16</height>
           </rect>
          </property>
          <property name="text">
           <string>IP地址:</string>
          </property>
         </widget>
         <widget class="QPushButton" name="bt_write">
          <property name="geometry">
           <rect>
            <x>620</x>
            <y>230</y>
            <width>130</width>
            <height>40</height>
           </rect>
          </property>
          <property name="text">
           <string>写入short</string>
          </property>
          <property name="type" stdset="0">
           <string>warning</string>
          </property>
         </widget>
         <widget class="QPushButton" name="bt_read">
          <property name="geometry">
           <rect>
            <x>120</x>
            <y>230</y>
            <width>130</width>
            <height>40</height>
           </rect>
          </property>
          <property name="text">
           <string>short读取</string>
          </property>
         </widget>
         <widget class="QLineEdit" name="lineEdit_3">
          <property name="geometry">
           <rect>
            <x>130</x>
            <y>130</y>
            <width>121</width>
            <height>31</height>
           </rect>
          </property>
          <property name="text">
           <string>D100</string>
          </property>
         </widget>
         <widget class="QLabel" name="label_6">
          <property name="geometry">
           <rect>
            <x>130</x>
            <y>100</y>
            <width>751</width>
            <height>21</height>
           </rect>
          </property>
          <property name="text">
           <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;位地址支持&lt;span style=&quot; color:#008000;&quot;&gt;X、Y、M、F、B&lt;/span&gt;,字地址支持&lt;span style=&quot; color:#008000;&quot;&gt;D、W、R&lt;/span&gt;,位的读取如M10,字的读写如D100&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
          </property>
         </widget>
         <widget class="QPushButton" name="bt_readBool">
          <property name="geometry">
           <rect>
            <x>120</x>
            <y>180</y>
            <width>130</width>
            <height>40</height>
           </rect>
          </property>
          <property name="text">
           <string>bool读取</string>
          </property>
         </widget>
         <widget class="QPushButton" name="bt_readInt">
          <property name="geometry">
           <rect>
            <x>120</x>
            <y>280</y>
            <width>130</width>
            <height>40</height>
           </rect>
          </property>
          <property name="text">
           <string>int读取</string>
          </property>
         </widget>
         <widget class="QLabel" name="label_10">
          <property name="geometry">
           <rect>
            <x>550</x>
            <y>140</y>
            <width>61</width>
            <height>16</height>
           </rect>
          </property>
          <property name="text">
           <string>写地址:</string>
          </property>
         </widget>
         <widget class="QLabel" name="label_11">
          <property name="geometry">
           <rect>
            <x>750</x>
            <y>140</y>
            <width>41</width>
            <height>16</height>
           </rect>
          </property>
          <property name="text">
           <string>写值:</string>
          </property>
         </widget>
         <widget class="QLineEdit" name="lineEdit_5">
          <property name="geometry">
           <rect>
            <x>810</x>
            <y>130</y>
            <width>81</width>
            <height>31</height>
           </rect>
          </property>
          <property name="text">
           <string>1</string>
          </property>
         </widget>
         <widget class="QLineEdit" name="lineEdit_6">
          <property name="geometry">
           <rect>
            <x>610</x>
            <y>130</y>
            <width>121</width>
            <height>31</height>
           </rect>
          </property>
          <property name="text">
           <string>D100</string>
          </property>
         </widget>
         <widget class="QPushButton" name="bt_write_2">
          <property name="geometry">
           <rect>
            <x>620</x>
            <y>180</y>
            <width>130</width>
            <height>40</height>
           </rect>
          </property>
          <property name="text">
           <string>写入bool</string>
          </property>
          <property name="type" stdset="0">
           <string>warning</string>
          </property>
         </widget>
         <widget class="QPushButton" name="bt_write_3">
          <property name="geometry">
           <rect>
            <x>620</x>
            <y>280</y>
            <width>130</width>
            <height>40</height>
           </rect>
          </property>
          <property name="text">
           <string>写入Int</string>
          </property>
          <property name="type" stdset="0">
           <string>warning</string>
          </property>
         </widget>
         <widget class="QPushButton" name="pushButton_35">
          <property name="geometry">
           <rect>
            <x>870</x>
            <y>10</y>
            <width>121</width>
            <height>41</height>
           </rect>
          </property>
          <property name="text">
           <string>源码下载</string>
          </property>
          <property name="type" stdset="0">
           <string>primary</string>
          </property>
         </widget>
        </widget>
       </item>
      </layout>
     </item>
     <item>
      <widget class="QListWidget" name="listWidget"/>
     </item>
    </layout>
   </item>
  </layout>
 </widget>
 <layoutdefault spacing="6" margin="11"/>
 <resources/>
 <connections/>
</ui>

三菱 FX 系列A 系列 PLC 在使用 MC 协议(MELSEC Communication Protocol) 时,通常采用的是 A 兼容 1E 帧(A-1E),而不是 QnA-3E。


✅ 正确对应关系如下:

PLC 系列推荐使用的 MC 协议帧格式说明
FX 系列(如 FX3U、FX5U 等)A-1E 帧(A兼容1E)FX3U 需加装以太网模块(如 FX3U-ENET-ADP),使用 A-1E;FX5U 内置以太网,可支持 QnA-3E,但传统上仍常按 A-1E 处理。
A 系列A-1E 帧A 系列是早期产品,仅支持 A-1E 帧格式。
Q 系列 / L 系列 / iQ-R / iQ-FQnA-3E 帧(或 4E)新一代 PLC,支持更广地址范围和更多数据类型。

🔍 补充说明:

  • A-1E 帧

    • 属于较早期的 MC 协议格式。
    • 仅支持有限地址范围,例如:
      • D 寄存器:D0~D6143、D9000~D9255
      • 不支持扩展寄存器(如 D10000+)
    • 通常使用 二进制格式(Binary)通信。
    • 适用于 FX(带以太网模块)、A 系列。
  • QnA-3E 帧

    • 更现代、功能更强。
    • 支持 D0~D12287 甚至更大范围(依型号而定)。
    • 支持 位/字随机读写、浮点数、批量操作等高级功能。
    • FX5U 虽属 FX 系列,但因内置以太网且架构升级,官方文档明确支持 QnA-3E

  • 如果你使用的是 FX3U + 以太网模块 或 A 系列 PLC → 使用 MC A-1E 协议
  • 如果你使用的是 FX5U、Q 系列等新型 PLC → 推荐使用 MC QnA-3E 协议

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值