---
title: Notes on Lollette LE3U PLC
date: 2021-09-11T14:47:34+00:00
modified: 2021-09-11T15:50:59+00:00
image:: https://kaspars.net/wp-content/uploads/2021/09/lollette-le3u-plc-raspberry-pi-rs485-scaled.jpeg
permalink: https://kaspars.net/blog/le3u-plc
post_type: post
author:
  name: Kaspars
  avatar: https://reverse.kaspars.net/gravatar/avatar/92bfcd3a8c3a21a033a6484d32c25a40b113ec6891f674336081513d5c98ef76?s=96&d=mm&r=g
category:
  - Electronics
  - Home Automation
---

# Notes on Lollette LE3U PLC

![Raspberry Pi connected to Lollette LE3U](https://kaspars.net/wp-content/uploads/2021/09/lollette-le3u-plc-raspberry-pi-rs485-scaled.jpeg?strip=all&quality=90&resize=2560,1707)Raspberry Pi connected to Lollette LE3U over Modbus RTU (RS485).- [Lollette LE3U](https://www.lollette.com/le3u-plc-controller) is a “copy” of the [Mitsubishi FX3U PLC](https://www.mitsubishielectric.com.au/2187.htm) for [$60 on AliExpress](https://kaspars.net/go/lollette-le3u-plc) while the original costs around $1000.
- All configuration is done using Mitsubishi’s proprietary software [GX Developer](https://us.mitsubishielectric.com/fa/en/products/controllers/programmable-controllers-melsec/engineering-software/other-engineering-softwares/gx-developer/gx-developer) or [GX Works2](https://us.mitsubishielectric.com/fa/en/products/controllers/programmable-controllers-melsec/engineering-software/gx-works/gx-works2) which cost another $500 but have a [60-day free trial available online](https://www.mitsubishifa.co.th/en/Software-Detail.php?id=MjM=&vs=trial).
- It features 14 digital inputs, 6 analog inputs, 2 analog output and 10 relay outputs.
- The RS485 port is not configured by default so you can’t control any of the relays or read input values without first uploading new configuration program.
- Programming is done using [visual Ladder language](https://en.wikipedia.org/wiki/Ladder_logic) which is somewhat confusing to get started until you realise that it’s pretty much a mapping of input triggers, registers and their values. 
    - Each physical input maps to a register which can then change another output register depending on certain rules.
    - Configuring parameters is “moving” 1-byte or 2-byte strings into registers.

## Configure RS485 Modbus

To configure the device as a Modbus “slave”, hook into the `M8002` event and configure the following registers:

- `D8120` with the details for the serial protocol. Set it to `H4081` to enable Modbus RTU slave protocol with 8 data bits, 0 parity bits, 1 stop bit and a 9600bps transfer rate.
- `D8121` for the device ID or station number. Set to `K1` where `1` is the device ID.
- `D8129` for the communication timeout (optional). Set to `K100` where `100` is the timeout in milliseconds.

The 4-byte values are entered as a string of matching hex values starting from the lowest bit (please ignore the actual register values since this is from a different device):

![](https://kaspars.net/wp-content/uploads/2021/09/hex-value-notation.png?strip=all&quality=90&resize=644,264)Example of register value bit mapping to `H` notation.

See these two videos for detailed instructions:

- [How to Configure PLC as a Modbus Slave and how to read write the data from PLC through Modbus](https://www.youtube.com/watch?v=cPuX4ga1Ods)
- [Control FX3U PLC with ESP32 Microcontroller Part 1 (PLC I/O Control)](https://www.youtube.com/watch?v=3VcyOw6Gb1M) and [Part 2](https://www.youtube.com/watch?v=Jtce-PU6fpk)