Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Raspberry pi master Arduino slave

Mstanley
2017-02-17
2017-04-19
  • Mstanley - 2017-02-17

    Hi there,

    I'm currently working on having my raspberry pi as a master and my arduino as the slave. Currently I'm getting a "not running" on the slave when I login. I'm not sure if I have my channels set correctly for my arduino. Can anyone point me in the right direction for what channels are need on the arduino slave? Thank you.

     
  • RodneyC - 2017-02-20

    Are you using MODBUS RTU? What serial bus? What serial cable, usb?

     
  • Mstanley - 2017-02-20

    I'm currently using usb from the raspberry pi to the serial port on the arduino.

     
  • RodneyC - 2017-02-24

    Mstanley hat geschrieben:
    I'm currently using usb from the raspberry pi to the serial port on the arduino.

    Then you need to edit /etc/CODESYSControl.cfg and add the following:

    [SysCom]
    Linux.Devicefile=/dev/ttyUSB
    portnum := COM.SysCom.SYS_COMPORT1;

    I used the modbusino library to set up my arduino as slave, works a treat.

     
  • alverman - 2017-04-19

    Sorry but to check arduino from serial you want some paid library or not?

    But then can you handle inputs and outputs from codesys via PI?

    Can you explain how to run from scratch to control from arduino serial?

    Thank you, Alberto

     

Log in to post a comment.