Jump to content

Q03UDE PC to Built-in Ethernet port comms (MC Protocol)


Recommended Posts

Posted
Hi, We want to communicate from a PC to the PLC using MC Protocol over TCP/IP with a 3E ASCII Frame, but we are not having much success. We can connect over TCP/IP but cannot get any response from the PLC with the frames we are building based on the manual: Q-L_UserManual-MELSEC-CommunicationProtocol-ReferenceManual_SH_080008-Q.pdf Please, can anyone offer a little advice: Q1 - What are the settings in the PLC for the built-in Ethernet port (We have port 1026 listening using MC protocol) Q2 - An example of any ASCII frame that should get a response from the PLC Many thanks, Simon.

Posted
Built in port does socket communication not MC. See the right manual for the Q with built-in Ethernet. Mitsubishi has many example programs for how to communicate with either E71 module or built-in Ethernet. Check their website. SH(NA)080811
Posted (edited)
See chapter 5 in this manual. You need to define "MC Protocol" in your port settings and binary/ascii (depending on what you use) in your Q parameter settings. If you're not sure about your 3E frame, you can try with the much more simple 1E frame to test (is only available in some of the newer QnU cpu's though, see appendices). There seems to be some limitations to the MC protocol commands you can use in QnU compared to dedicated ethernet cards. Edited by Mitsu
Posted
Many thanks for the reply Crossbow, We have had socket communication working on the built-in port but we want to go MC. I am a little confused that you say the built in Ethernet port does not support MC protocol, Am I misunderstanding you? If you are correct then that may well be our problem! but the manual (SH(NA)080811) seems to say otherwise: On page A-9 it says that it covers the Q03UDE (our PLC) On page 3-1 the diagram and table lists MC Protocol as a supported function of the built-in Ethernet port On page 3-14 there is a section 3.3 MC Protocol Communication - this covers set-up of the MC Protocol on the built-in Ethernet port. I've been using the manual "Q-L_UserManual-MELSEC-CommunicationProtocol-ReferenceManual_SH_080008-Q" which describes the frame structure that is not working for us. (3E ASCII). It describes a frame header (Section 3.1.2) but never defines it's content, which is something that could be a problem? (I'm not refering to subheader). Maybe there is something better on the web site. Si.
Posted
Thanks Mitsu, That's exactly how we have it set up, but try as we might, we have never had the slightest reply from the PLC. Which is why we think the frame may be wrong. If you have simple example of an ASCII 3E or 1E frame then I can try it right now (I assume there is no setting for the frame type) si.
Posted (edited)
Indeed, there is no setting for the frame type necessary. The Mitsubishi ethernet card (in this case the QnU) will analyse the data it receives and if it matches a frame that it knows (in case of QnU 3E and 1E but 1E only from a certain firmware version since it was added later on), it will automatically send back a reply (which is the nice thing about MC Protocol: you only need to program communication on one side). You do seem to have the TCP connection succesfully opened with that particular port? The frame does need to be correct ofcourse or otherwise the card will not respond. I think we did approach a QnU with the 1E frame at some point but i can't check at the moment. Have you defined the actual command (e.g. i want to batch read 10 words starting from D0)? In this manual, the frame layout is described for several different commands. See chapter 3.3 for the defintion of the commands and examples. Edited by Mitsu
Posted
As the other point out, there should be no problem. I see several people have linked to documents, but it would also be helpful if you could share some of your work until now for us to analyze.... What have you done so far? In what program/language? Can you share any code or is that out of the question? Can you share e.g. Wireshark logs to/from the Q?
Posted (edited)
On 11/20/2013 at 4:44 PM, SimonA said:

Thanks Mitsu, That's exactly how we have it set up, but try as we might, we have never had the slightest reply from the PLC. Which is why we think the frame may be wrong. If you have simple example of an ASCII 3E or 1E frame then I can try it right now (I assume there is no setting for the frame type) si.

I was very interested in this and I had to figure it out myself. For the record, these are working ASCII examples of 3E frame:

Set M69 to 1:

500000FF03FF000019000214010001M*00006900011

the CPU is going to answer D00000FF03FF0000040000

Set M69 to 0:

500000FF03FF000019000214010001M*00006900010

again, the answer will be: D00000FF03FF0000040000

Just use any TCP enabled client capable to send ASCII strings. In my test, CRLF line endings were ignored.

Tested on a Q03UDECPU

The 3E frame works with all Q03UDECPU. It´s the simpler 1E frame that was implemented later, so units with an old firmware are incompatible.

Tips:

1) After configuring the network parameters, you must reboot the CPU. Same after changing between ASCII and Binary.

2) You must be able to "Telnet" to the CPU on the chosen port. If you are unable to, you have a connectivity problem.

I'm learning the 3E frame format by analyzing the source code of https://github.com/mendozaphd/Mitsubishi-MC-Protocol and comparing with the Mitsubishi docs.

 

Edited by Jefferson Ryan
typos

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...