Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Serial communication with Mitsubishi PLC

Serial communication with Mitsubishi PLC 10 years 2 months ago #6080

  • pixmix
  • pixmix's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 56
  • Karma: 0
I need to connect a RaspberryPI to a Mitsubishi PLC using a simple serial protocol through the PLC programming port. I already managed to get the hardware running and I can issue commands and recieve data via a terminal emulator using prebuilt files in place of dynamic packets.
I have Proview on the PI and I have plenty of experience developing drivers on different platforms.

Before I get myself into troubles I'd like to check if anyone already has answers to the following questions:
1) Has anyone developed and is willing to share the Proview driver for the serial programming port of the XF2N Mitsubishi PLC family?
2) Has anyone a good example of a simple serial Proview driver for reading and writing words with an external device, possibly using the serial port on the RPi?
3) Is anybody else interested in my experiment and available to help?

If I get any further I will be definitely happy to share here :-)
Last Edit: 10 years 2 months ago by pixmix. Reason: misspelling
The administrator has disabled public write access.

Serial communication with Mitsubishi PLC 10 years 2 months ago #6081

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3178
  • Thank you received: 502
  • Karma: 133
Hi,

If you download the Proview source code you'll find an example of serial communication in the Modbus RTU IO interface. How to use it and also how to build IO interfaces is described in the Guide to IO System. The Modbus RTU are configured with Master, Slave and Module objects, and you'll find the corresponding code with the serial interface in otherio/lib/rt/src/os_linux/rt_io_m_mb_rtu_master.c, rt_io_m_mb_rtu_slave.c and rt_io_m_mb_rtu_module.c. The read and write methods in the code send and receive cyclic messages synchronized with the plc execution. The input message area is configured with input channel objects, ChanDi, ChanAi, ChanIi and ChanBi, and the output message with output channels, ChanDo, ChanAo, ChanIo and ChanBo. This is the standard method of handling bus IO in Proview, and there are functions to initialize, pack and unpack the message area. If it is possible to apply this to the Mitsubishi communication I think you'll get is a generic interface without to much effort.

/Claes
The administrator has disabled public write access.
The following user(s) said Thank You: pixmix

Serial communication with Mitsubishi PLC 10 years 1 month ago #6141

  • pixmix
  • pixmix's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 56
  • Karma: 0
Hi Claes,

I got the driver working on x86. How can I compile it on the x86 machine to produce the arm object file?
I am not very familiar with make, yet, and I don't find clues how to inform it to use the toolchain for crosscompiling in place of the defualt one.
In fact it would be nice to have the source of my driver compiled by the "build node" command in place than to have and manually compile it.
The administrator has disabled public write access.
The following user(s) said Thank You: shekhar

Serial communication with Mitsubishi PLC 10 years 1 month ago #6142

  • pixmix
  • pixmix's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 56
  • Karma: 0
Done,

I added the following in the make file (as you can see, after the "include $(pwr_exe)/pwrp_rules.mk
Please note that I moved the Arm tools "bin" folder up in the path together with a dependent folder
to avoid problems when building the node within pwrs
include $(pwr_exe)/pwrp_rules.mk

ARM := /usr/local/rpi/tools/bin/arm-linux-gnueabihf-
cc := $(ARM)gcc
cxx := $(ARM)g++
f77 := $(ARM)g77
ld := $(ARM)gcc
ldxx := $(ARM)g++
The administrator has disabled public write access.
The following user(s) said Thank You: shekhar

Serial communication with Mitsubishi PLC 5 years 2 days ago #10270

  • shekhar
  • shekhar's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
  • Karma: 0
Hi pixmix, Please help me , I want connect mitsubishi fx 3g 40M PLC with raspberry pi... How can get data from plc to raspberry pi
The administrator has disabled public write access.

Serial communication with Mitsubishi PLC 5 years 19 hours ago #10271

  • pixmix
  • pixmix's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 56
  • Karma: 0
Hi Shekhar,
I developed a very basic driver. I had a plan to implement the full Melsec driver, but the scope and budget of my project were too limited.
I am not sure about the fx 3g 40M PLC and the protocols available with it.
The best thing I can do is to retrieve from my archive the documentation and the files of my project and forward to you, if you have an email address that you want to send me at This email address is being protected from spambots. You need JavaScript enabled to view it. .
My driver implemented part of the melsec protocol on serial line.
You can then connect the PLC either via the built in serial port (but you need some components to rise the level from 3V to at least 5V or a cheap usb to serial adapter.
The administrator has disabled public write access.
The following user(s) said Thank You: shekhar
  • Page:
  • 1
Time to create page: 8.522 seconds