• Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Access variables from Neuron (MervisOS)

    Mervis
    2
    3
    1099
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      StevenHendrickx last edited by

      Hello,

      I was wondering how I can access the data on my Neuron M203. It's running on the latest version of Mervis.
      We have a very simple setup:

      • The Neuron M203, which hosts a web panel

      • A Raspbery Pi with raspbian connected directly to the Neuron with an ethernet cable. We use this one to display the webpanel.

      Both devices are not connected to the internet.
      We want to store a few parameters of the PLC in an InfluxDB on our regular Raspberry Pi. How can we get the data from the PLC? I've seen a few things about TCP/Modbus, but I have never used Modbus before. So I'd need some extra help with that.

      Thanks in advance,

      Steven

      Martin Kudláček 1 Reply Last reply Reply Quote 0
      • Martin Kudláček
        Martin Kudláček administrators @StevenHendrickx last edited by

        Hello @stevenhendrickx,
        I'll start from the end - the RaspberryPi running an InfluxDB. I can only guess - and correct me if I am wrong - but you have only SD card with the Raspbian in your RaspberryPi, right? The SD cards are quite fragile regarding the number of data you can write on them. That's the reason why we switch the filesystem in MervisOS to read-only. So generally, running a database on the SD card is not-so-good idea.

        Now to the part how to access Mervis variables from outside. Currently the most straightforward method is via Modbus. If you haven't use Modbus before, please take a look on the protocol itself: physical layers, addressing, datatypes,... The Wikipedia article is a good (a bit too complicated) start.
        Then check our tutorial how to setup ModbusTCP server (slave) in Mervis: https://kb.unipi.technology/en:sw:01-mervis:setting-modbus-server-hidden
        And to put it together check this Python Gist how to poll data from ModbusRTU slave into InfluxDB: https://gist.github.com/sansal54/bea2526ab8e968351a85db3410cc9f65

        There's a lot of information you need to grasp from the beginning to get it working. Feel free to ask more.

        Martin

        1 Reply Last reply Reply Quote 1
        • S
          StevenHendrickx last edited by

          Thank you for the wonderfull answer Martin!

          Currently the RaspberryPi only has the SD card as memory space indeed, but it would be possible to attach an external drive.
          After creating the Modbus Server Channel, I was instantly able to view all the values that I wanted. Now I can experiment with how we want to store our data.

          But first we're going to see if we can attach it to the internet so we can use the MervisDB.

          Thanks for the info!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post