C# realizes the communication technology between host computer and PLC

Publisher:HappyExplorerLatest update time:2022-09-13 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Download and install Mitsubishi MX COMPONENT

2. Communication test and data monitoring
Open the PLC monitoring program:

eb549754-2f65-11ed-ba43-dac502259ad0.png

You can see the previously set communication configuration and reset it:

eb6ab82c-2f65-11ed-ba43-dac502259ad0.png

Click OK

eb787b92-2f65-11ed-ba43-dac502259ad0.png

On the right side, you can enter the address to monitor the PLC data.

eb867a30-2f65-11ed-ba43-dac502259ad0.png

PS: 1: plc address, 2: start and end monitoring, 3: change monitoring mode

eb95812e-2f65-11ed-ba43-dac502259ad0.png

Buffer memory monitoring

eba5a5c2-2f65-11ed-ba43-dac502259ad0.png

You can also perform customized monitoring based on the input address

ebbb459e-2f65-11ed-ba43-dac502259ad0.png

Write data to PLC and set PLC time

ebd1c58a-2f65-11ed-ba43-dac502259ad0.png

You can write bit by bit or write multiple bits at a time

ebe36754-2f65-11ed-ba43-dac502259ad0.png

3. Many people started looking for the source code of the communication. I also searched for a long time at the beginning. The annoying thing is that some people not only do not provide the source code but also charge gold coins for downloading. I draw a circle here. Generally, this kind of software comes with the source code. I don’t believe that MX COMPONENT doesn’t have it. Finally, I found it in a corner. I feel very emotional...

ebf767f4-2f65-11ed-ba43-dac502259ad0.png

Select the program and right-click Properties:

Select Open File Location in the Properties panel:

ec0651a6-2f65-11ed-ba43-dac502259ad0.png

Find the folder where the program is located:

ec2a3378-2f65-11ed-ba43-dac502259ad0.png

Return to the previous directory:

ec3aa49c-2f65-11ed-ba43-dac502259ad0.png

Enter the samples folder (finally found the C# source code, haha):

ec4db096-2f65-11ed-ba43-dac502259ad0.png

You can refer to the source code for testing.

Here I will tell you how to build your own project:
create a new C# form application, add a reference, and find that there is no dll in the case program.

ec635f72-2f65-11ed-ba43-dac502259ad0.png

Select Tools in the menu bar and click the Toolbox item in the drop-down box.

ec78189a-2f65-11ed-ba43-dac502259ad0.png

Select the com component tab and check the controls you need in the selection interface.

eca04cd4-2f65-11ed-ba43-dac502259ad0.png

You can see the mx controls in the general items in the toolbox!

ecb092c4-2f65-11ed-ba43-dac502259ad0.png


Reference address:C# realizes the communication technology between host computer and PLC

Previous article:Siemens 1500PLC collects modbusRTU instrument data
Next article:The difference between commercial AI and industrial AI, and the architecture analysis of industrial AI

Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号