1. OCAU Merchandise is available! Check out our 20th Anniversary Mugs, Classic Logo Shirts and much more! Discussion in this thread.
    Dismiss Notice

MODBUS and RS485 devices

Discussion in 'Newbie Lounge' started by ZZ33DD, Dec 6, 2024.

  1. ZZ33DD

    ZZ33DD Member

    Joined:
    Sep 20, 2016
    Messages:
    44
    Location:
    Sydney
    Hi All,

    I've recently taken a engineering project on at work (I'm not an engineer) and I'm in over my head with a couple of measuring devices for a hydraulic press designed to perform a 4 point bending test. Currently, I am using a very analogue setup and I've slowly picked up some electronic measuring devices that use RS232 and RS485 and am looking to input data directly to a spreadsheet. I'm a bit clueless and YouTube is confusing TF out of me. I'm not sure if this is considered networking and I feel so noob right now that I decided to try here (the flame-free zone) to be pointed in the right direction.

    Thanks
     
  2. SLATYE

    SLATYE SLATYE, not SLAYTE

    Joined:
    Nov 11, 2002
    Messages:
    26,891
    Location:
    Canberra
    What devices are they?

    If you're very lucky - the manufacturer has a tool that will happily capture data and save it to a CSV file, which can then be opened in Excel.

    If you're not quite as lucky - some random person on the internet has written some software to talk to it, which can be modified without too much effort to save to a CSV file. Modbus is not exactly uncommon, so it wouldn't surprise me if there's something that does very nearly what you need.

    If you're not quite as lucky as that - either the manufacturer or some random person on the internet has at least documented the communication protocol, and you can organise software in whatever language you prefer (eg. probably heaps of Python examples) to accept it.

    Finally, if you're unlucky - the communication protocol is entirely opaque, it talks "Modbus" but only to the manufacturer's own hardware/software and there's a great deal of reverse engineering required.
     
  3. OP
    OP
    ZZ33DD

    ZZ33DD Member

    Joined:
    Sep 20, 2016
    Messages:
    44
    Location:
    Sydney
    So what my level of luck if the manufacturer is in China and the only software available is Chinese??? I'm guessing my best chance is to get a translator?

    Thanks for the info mate. Greatly appreciated
     
  4. SLATYE

    SLATYE SLATYE, not SLAYTE

    Joined:
    Nov 11, 2002
    Messages:
    26,891
    Location:
    Canberra
    You then have a few options:

    1. As you say, get a translator. If the software provided has an option to save to CSV, it's probably a pretty simple sequence of clicks to get it to do that.

    2. Replace them with ones that have English software. Doesn't mean "made in the USA", heaps of Chinese companies provide adequate data/software in English.

    3. See if you can make sense of the datasheets. If it's a simple interface (eg. just keep reading a register and it gives values in SI registers) then you can probably puzzle it out.

    4. Do a Google search anyway, a surprising amount of the time you'll find some random Github project with "I completely reverse-engineered the comms protocol on this, hacked the firmware to make it equivalent to a device that costs twice as much, and wrote a GUI that graphs data in realtime".
     
  5. mtma

    mtma Member

    Joined:
    Aug 12, 2009
    Messages:
    6,995
    Chinese companies can be pretty accommodating at times so I'd definitely just drop in an inquiry to them if you can't seem to find English software or documentation and see if you get a response. Unfortunately you might be talking to a proxy who doesn't really know if you have bought through a reseller, but often there will be something, even though the translation quality might not be great.

    Also, if the instrument is a clone of some device that became defacto standard there may be options available if you find the right keywords to search around with.
     
  6. Myne_h

    Myne_h Member

    Joined:
    Feb 27, 2002
    Messages:
    12,547
    If you're lucky, the software has a separate dll for language. English is usually 1033.dll or en*.Dll or something like that. Nfi what Chinese is.

    But it means there's a reasonable chance to extract all the strings for translation and for someone to mod the existing or rewrite a new dll in English.

    What's the software called?
     
  7. OP
    OP
    ZZ33DD

    ZZ33DD Member

    Joined:
    Sep 20, 2016
    Messages:
    44
    Location:
    Sydney
    12-FF-激光位移测距传感器调试系统安装包


    Lol
     
    Last edited: Jan 16, 2025
  8. Myne_h

    Myne_h Member

    Joined:
    Feb 27, 2002
    Messages:
    12,547
    Laser displacement ranging sensor debugging system installation package

    Seems pretty self explanatory

    Google Translate is your friend

    Googling that gets
    Laser measurement sensors with RS232/485/TTL digital output or analog output
    https://www.top1sensor.com/?gad_source=1
     
    Last edited: Jan 16, 2025
  9. douver

    douver Member

    Joined:
    Mar 8, 2002
    Messages:
    1,622
    Location:
    Brisbane
    Especially with the RS232 devices, it's possible they just automatically put out something like a 16bit integer with the reading every 1 second or so. Would be worth just hooking them up to a computer and using something like Putty to monitor the RS232 port. Could be worth a try doing the same with the RS485 ones as well but you'd need a RS485-RS232 converter (less likely to work because RS485 is designed for multiple devices on the same line, so they should wait for a master to respond to, but it wouldn't surprise me at all if they just chuck out data).
     
  10. di_entropy

    di_entropy Member

    Joined:
    Jun 27, 2001
    Messages:
    1,427
    Location:
    Melbourne
    Can you post a link to the datasheets or at least provide the make and model number?
    Need to understand whether they are RS232 or RS485 and what protocol they use for the data output then we should be able to help.

    If you have nothing, as above for a starting port try USB-RS232 or USB-RS485 adapter connected to your PC as a COM port and use something like PuTTy to see what data it spits out, although there may still be some stuffing around to get the RS232/485 pinout right.

    Another alternative is to use something like this which will output the data over Ethernet via TCP or you could also use Modbus TCP protocol.
    RS232 RS485 Ethernet Converter, Serial Ethernet to Modbus Converter

    Once you have the connection, data output and format sorted you could use something like Node-Red or write some Python script to get it to poll the data and write to CSV. You can then use the CSV as a data source that can be automatically updated and refreshed into your Excel spreadsheet.

    Just my 2c of where to start...
     
  11. SLATYE

    SLATYE SLATYE, not SLAYTE

    Joined:
    Nov 11, 2002
    Messages:
    26,891
    Location:
    Canberra
    If that's the company that makes them, their website has some perfectly usable user manuals. From the one I just pulled up (SKD-20D) gives you the whole (very simple) communication protocol in clear English, and it'd be trivial to set up a C/Python/Java/Matlab program to poll that and drop it in a CSV file.
     

Share This Page

Advertisement: