Skip to content

GX Works2 Platform - Usage Guide (Example PLC: FX3U)


1. Wiring Instructions

1.1 Device Wiring Architecture

Device Wiring Architecture

1.2 UC04 Wiring

UC04 Wiring 1
UC04 Wiring 2

2. Program Instructions

2.1 PLC Serial Port Parameter Setup

  1. Data bits: 8
  2. Parity: None
  3. Stop bits: 1
  4. Baud rate: 9600

(Because this PLC model does not support 115200 baud, set servo baud rate to 9600 in the PC configuration software.)

Serial Parameter Setup 2
Serial Parameter Setup

2.2 Serial Data Write (via Function Block Library)

  1. K0 ------ Servo ID
  2. K3600 -- Target angle 360.0°
  3. K3000 -- Reach target in 3000ms (3s)
  4. K100 --- Acceleration time 100ms
  5. K100 --- Deceleration time 100ms

Use function blocks to convert the above data and store it in continuous registers, as shown below: D410, D411, and so on.

Serial Data Write

2.3 Serial Communication Instruction

  1. Data to send is stored in D410
  2. Number of bytes to send is 20
  3. Response data is stored in D200
  4. Maximum number of response bytes is 7
Serial Communication Instruction

2.4 Serial Send Request

Serial Send Request

2.5 Serial Port Reset

Serial Port Reset

Reference for serial setup:

(018) Mitsubishi FX3U PLC Communication with Serial Assistant - Bilibili

2.6 Function Block and Protocol Mapping

Protocol reference for Fashion Star bus servo communication:

https://wiki.fashionstar.com.hk/uartbasic/uart_rs485_protocols/

  1. Using the example above (servo ID 0 rotates to 360° in 3000ms), use MOV instructions to store high and low bytes into D410 in order; same rule applies to subsequent registers.
Function Block and Protocol Mapping

3. Importing Library Files

  1. In GX Works2, go to Project -> Library Operation -> Acquire Library from Project.
Library Import 1
  1. Import the required library files into the project.
Library Import 2
Library Import 2
  1. Drag FB library blocks from FB Manager to invoke them, then write the required control parameters.
Library Import 4

4. Function Block Description

4.1 Angle Control

  • ID: servo ID
  • Angle: target angle (K3600 means 360.0°)
  • IntervalTime: time to reach target angle (K3000 means 3000ms)
  • AccInterval: acceleration time (K100 means 100ms)
  • DecInterval: deceleration time (K100 means 100ms)
  • Power: output power

Note: registers from D410 to the end must be written continuously with no gaps.

(D410 is only an example start register. You can define your own start register; same below.)

Angle Control

4.2 Angle Readback

  • ID: servo ID
Angle Readback

4.3 Home Position Set

  • ID: servo ID
Home Position Set

4.4 Data Monitoring

  • ID: servo ID
Data Monitoring

4.5 Stop Rotation - Three Modes

  • ID: servo ID
  • Power: output power
Stop Rotation - Release
Stop Rotation - Hold
Stop Rotation - Damping

4.6 Communication Test

  • ID: servo ID
Communication Test

4.7 Async Commands

  • Start async command: fixed command, so STATE does not take effect. Set K0.
  • End async command:
  • K0: execute immediately after ending async
  • K1: cancel execution after ending async
Async Command

4.8 Multi-turn Reset

  • ID: servo ID
Multi-turn Reset

4.9 Damping Mode

  • ID: servo ID
  • POWER: damping power
Damping Mode