NothinRandom / pymelsec

Python3 Implementation of MELSEC Communication
MIT License
21 stars 6 forks source link

Library For FX Series over the MELSEC protocol #1

Open Rahul14189 opened 9 months ago

Rahul14189 commented 9 months ago

Can you suggest any library for FX series over the MELSEC protocol ?

NothinRandom commented 8 months ago

@Rahul14189

I am not aware of available open source libraries that you can leverage. It depends on which FX series you're using since some PLCs only support serial communication instead of Ethernet; thus, the transport medium layer would differ there. Is there a specific FX PLC that you're looking at? I can read the specifications and maybe try to put something together. Happy (early) new year!

nishant-corp commented 3 months ago

@NothinRandom any idea how we can use any open-source package for iQ-F Series FX 5U model. We have tried SLMP and MX Component, but we would prefer without the hardware changes that the SLMP module requires. pyMelsec isn't supported for iQ-F series / FX5U model currently. Please help with the solution to this. Thank you!

NothinRandom commented 3 months ago

@nishant-corp,

Which variant of the FX 5U are you using? Does it come with Ethernet communication?

nishant-corp commented 3 months ago

@NothinRandom We are using the Mitsubishi FX5U-80MT/ESS model, which is from the MELSEC iQ-F series PLC. It has a built-in Ethernet port and RS485. We are trying to use the built-in Ethernet port, and are currently looking for a Python-based program/package.

Please refer to the below product specification link: https://emea.mitsubishielectric.com/fa/products/cnt/plc/plcf/cpu-module/fx5u-80mt-ess.html

NothinRandom commented 2 months ago

@nishant-corp, so I got some good news. Reading over the FX5U Ethernet communication manual, it looks like it supports 3E frame. Before we do a bunch of work, have you tried setting PLC type to 'iQ-R'? For example, using

with Type3E(host='1.2.3.4', port=5007, plc_type='iQ-R') as plc:

If that didn't work, then we would need to modify the PLC enum in constant.py to support it.

Since I don't have a FX PLC with me, I'd need you to test out a few things. This will take some trials and error...

Add a new entry called iQF_SERIES = "iQ-F" right before this line to keep things in order: https://github.com/NothinRandom/pymelsec/blob/cfbe7f6208d733229333bf39b286f7d6c23335da/pymelsec/constants.py#L11

Go here and you might need to adjust the code to the following... I don't know what the values are, so I'll need you to assist here... my first guess is that it's the same as iQR_SERIES: https://github.com/NothinRandom/pymelsec/blob/cfbe7f6208d733229333bf39b286f7d6c23335da/pymelsec/constants.py#L342-L345

        if plc_type == iQR_SERIES:
            padding = 4
        elif plc_type == iQF_SERIES:
            padding = 4
        else:
            padding = 2