Home Integration

Discussion

Left ArrowBack to discussions page
Robotiq_CustomerRobotiq_Customer Posts: 123 Apprentice
Hi,

I want to communicate in Modbus RTU with the Robotiq FT300, but I can't.
I am using a RS232 to RS485 adapter as I know your sensor communicates in RS485.

Any ideas why it doesn't work?

Thanks
Tagged:

Best Answer

Comments

  • Robotiq_CustomerRobotiq_Customer Posts: 123 Apprentice
    Well thanks!

    This was the problem... My converter wasn't setup properly.

    Thanks for your support!
  • jainaayush2006jainaayush2006 Posts: 1 Recruit
    Hey there,

    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.
  • bcastetsbcastets Vacuum Beta tester Posts: 673 Expert
    Hello Aayush Jain,

    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);

    }

    }

  • syedsyed Posts: 4 Apprentice
    Hello there,

    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 
  • bcastetsbcastets Vacuum Beta tester Posts: 673 Expert
    We provide on our support page a C package to communication with the ft300. It would be a good material to start.

    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.
  • syedsyed Posts: 4 Apprentice
    bcastets said:
    We provide on our support page a C package to communication with the ft300. It would be a good material to start.

    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.
    I checked all the details in manual and used the code you provided for Arduino , the code works by making a few minor changes. However, register [resultMain=node.readInputRegisters(180,6)] 01, 03, and 04 are giving values 655 , 65 and 65, the rest seems fine.

    Can you kindly guide over this?


    regards
    syed
Sign In or Register to comment.
Left ArrowBack to discussions page