
Home› Integration
Discussion
Back to discussions page
Robotiq_Customer
Posts: 123 Apprentice
Communication in Modbus RTU |
1.2K views
|
Answered | |
/ Most recent by syed
in Integration
|
7 comments |

in Integration
Best Answer
-
Catherine_Bernier Posts: 144 Handy
Hey there.
Are you using the Robotiq tested adapter?
If not, this might be the problem as the pinout might not be correct.
Make sure to refer to this image:
The simplest way to proceed would be to contact our application engineer and get the Robotiq tested adapter for this application.
For more info on the wiring, you can get access to the support manual here.
Catherine Bernier, Jr. Eng.
This was the problem... My converter wasn't setup properly.
Thanks for your support!
I'm also trying to do the same thing, trying to communicate with FT300 with Arduino using RS485 to RS232 adapter and then using RS232 to TTL converter. I not good at coding, so please can someone help me with the code to read the values on Arduino.
The following arduino library looks like a reference for Modbus communication:
https://github.com/4-20ma/ModbusMaster
I found some interesting video about how to communicate in Modbus RTU with ardiuno. I recommand you check that:
https://www.youtube.com/watch?v=HPZrGuBtk_c
https://www.youtube.com/watch?v=tBw15SfmuwI
I did not tested but based on those videos, I would make a program like the following to display force and torque on Ardiuno console on PC side:
#include <ModbusMaster.h>
#define MAX485_DE 3
#define MAX485_RE_NEG 2
ModbusMaster node;
void preTransmission()
{
digitalWrite(MAX485_RE_NEG,1);
digitalWrite(MAX485_DE,1);
void postTransmission()
{
digitalWrite(MAX485_RE_NEG,0);
digitalWrite(MAX485_DE,0);
void setup()
{
pinMode(MAX485_RE_NEG, OUTPUT);
pinMode(MAX485_DE,OUTPUT);
//Init in receive mode
digitalWrite(MAX485_RE_NEG,0);
digitalWrite(MAX485_DE,0);
//Modbus communication runs at 19200 baud (according to FT300 manual 4.4.1 ModbusRTU)
Serial.begin(19200);
//Modbus slave ID 9 (according to FT300 manual 4.4.1 ModbusRTU)
node.begin(9,Serial);
//Callbacks allow us to configure the RS485 transceiver correctly
node.preTransmission(preTransmission);
node.postTransmission(postTransmission);
void loop()
{
uint8_t resutlMain;
//Read registers where is written force and torque value (according to FT300 manual 4.4.1 ModbusRTU)
//Register : Description
//180: Fx
//181: Fy
//182: Fz
//183: Mx
//184: My
//185: Mz
//Read 6 registers starting from address 180
resultMain=node.readInputRegisters(180,6);
if (resultMain == node.ku8MBSuccess)
{
Serial.println("----------------");
Serial.println("Fx: ");
Serial.println(node.getResponseBuffe(0x00 / 100.0f);
Serial.println("Fy: ");
Serial.println(node.getResponseBuffe(0x01 / 100.0f);
Serial.println("Fz: ");
Serial.println(node.getResponseBuffe(0x02 / 100.0f);
Serial.println("Mx: ");
Serial.println(node.getResponseBuffe(0x03 / 100.0f);
Serial.println("My: ");
Serial.println(node.getResponseBuffe(0x04 / 100.0f);
Serial.println("Mz: ");
Serial.println(node.getResponseBuffe(0x05 / 100.0f);
}
I am using FT300 force torque sensor.
I am trying to communicate with sensor from C++ (to read values of forces and torques), however, i am not good at coding. Can anyone help in providing code to read data in C++ (visual studio)
Thanks in advance
https://assets.robotiq.com/website-assets/support_documents/document/FT-300_dev_package_SDP-1.0.1_20180328.rar
You can find more details about modbus communication in ft300 manual.
Can you kindly guide over this?
regards
syed