This PLC application about Mitsubishi PLC FX Series Communication with Arduino / Microcontroller.
Arduino such as Analog Input and Analog Output for Mitsubishi PLC FX Series.
Analog Input of Arduino transfer to D1 of Mitsubishi PLC FX, and D1 to PLC Output.
PLC Input to D0 of Mitsubishi PLC FX, and transfer to Analog Output of Arduino.
Video Demonstration:
Arduino such as Analog Input and Analog Output for Mitsubishi PLC FX Series.
Analog Input of Arduino transfer to D1 of Mitsubishi PLC FX, and D1 to PLC Output.
PLC Input to D0 of Mitsubishi PLC FX, and transfer to Analog Output of Arduino.
Video Demonstration:
Mitsubishi PLC FX Series Communication with Arduino UNO Microcontroller
Hardware required for This PLC application
- Mitsubishi PLC FX Series, I use Mitsubishi PLC FX1S
- Mitsubishi FX PLC Cable (RS232 PLC Cable)
- Arduino UNO
- TTL to RS232 Module (Male RS232 or Use DB9 Male Crossover)
- Adaptor for Arduino
- 4 pieces Push Button for testing
- 4 pieces Light for testing
- 1 piece Potentiometer 10Kohm for testing
- 1 piece Multimeter or Multitester or Voltmeter for testing
Hardware connections
A. Mitsubishi PLC FX and Arduino UNO
B. Potentiometer, Multitester and Arduino UNO
- Potentiometer : Left connect to GND
- Multitester / Voltmeter: Black of Probe connect to GND
Center connect to Pin A0 Arduino
Right connect to 5V
Red of Probe connect to Pin 9 Arduino
C. Push Button and Mitsubishi PLC FX
- Push button 1 connect to X000 of Mitsubishi PLC FX
- Push button 2 connect to X001 of Mitsubishi PLC FX
- Push button 3 connect to X002 of Mitsubishi PLC FX
- Push button 4 connect to X003 of Mitsubishi PLC FX
Arduino Software and Library
- Use Arduino Software (IDE) version 1.6.6
- Arduino Library : click here Extract and copy paste Mitsubishi_PLC_FX1S to ..\arduino-nightly\libraries
Download Project File for Arduino and Mitsubishi PLC FX1S
- Arduino Project File : click here
- Mitsubishi PLC FX1S Project File : click here
FX PLC Ladder Programming
Arduino Code for Mitsubishi PLC FX Series Communication
#include <FX1S.h> //by program-plc.blogspot.com #define FX1Sbaud 19200 #define FX1Sformat SERIAL_8N1 #define FX1Stimeout 1000 enum { FX1SPACKET1, FX1SPACKET2, FX1STOTAL_NO_OF_PACKETS }; FX1SPacket FX1Spackets[FX1STOTAL_NO_OF_PACKETS]; FX1SpacketPointer FX1Spacket1 = &FX1Spackets[FX1SPACKET1]; FX1SpacketPointer FX1Spacket2 = &FX1Spackets[FX1SPACKET2]; unsigned int FX1SreadD[1]; unsigned int FX1SwriteD[1]; #define AnalogInputPin A0 #define AnalogOutputPin 9 void setup() { FX1S_construct(FX1Spacket1, FX1S_READ_D, 0, 1, FX1SreadD); FX1S_construct(FX1Spacket2, FX1S_WRITE_D, 1, 1, FX1SwriteD); FX1S_configure(&Serial, FX1Sbaud, FX1Sformat, FX1Stimeout, FX1Spackets, FX1STOTAL_NO_OF_PACKETS); } void loop() { FX1S_update(); //Write to D1 int sensorValue = analogRead(AnalogInputPin); int outputValue = map(sensorValue, 0, 1023, 0, 32767); FX1SwriteD[0] = outputValue; //Read from D0 unsigned int D0 = FX1SreadD[0]; D0 = map(D0, 0, 32767, 0, 255); analogWrite(AnalogOutputPin, D0); }
Labels:
Arduino
Arduino Microcontroller
Mitsubishi PLC
Mitsubishi PLC FX
PLC
PLC and Arduino
PLC Application
Arduino
Arduino Microcontroller
Mitsubishi PLC
Mitsubishi PLC FX
PLC
PLC and Arduino
PLC Application