How to use matlab to send parameters to codesys

ligz17
2018-08-30
2018-10-10
  • ligz17 - 2018-08-30

    Hello!
    Does anyone know how to realize the communication of Codesys and matlab?
    I installed codesysV3.5 and matlabR2017 on the same computer.In codesysV3.5, there was a project to control the robot, and the movement of the robot could be controlled by changing the parameters. I want to use matlab to process the data returned by the sensor on the robot, and calculate the new parameters, and then send them to codesys for real-time control. But I don't know how to implement communication between matlab and codesys. Does anyone know it? Or is my idea feasible?

     
  • eschwellinger

    eschwellinger - 2018-09-09

    Hi,
    does matlab have an embedded OPCUA client?
    This would be a good solution to do this. OPCUA Server is embedded in all CODESYS SL runtimes.
    BR
    Edwin

     
  • ligz17 - 2018-09-11

    Edwin Schwellinger hat geschrieben:
    Hi,
    does matlab have an embedded OPCUA client?
    This would be a good solution to do this. OPCUA Server is embedded in all CODESYS SL runtimes.
    BR
    Edwin

    Thank you for your suggestion. I had created a OPC Server on CODESYS and set up a OPC client with matlab which connected the server successfully.

     
  • jorgev - 2018-09-21

    ligz17 hat geschrieben:
    Thank you for your suggestion. I had created a OPC Server on CODESYS and set up a OPC client with matlab which connected the server successfully.

    Hi ligz17,

    I am trying to implement the same communication: CODESYS OPCUA server with raspberry pi to Matlab OPCUA client.

    Unfortunately I did not succeed. Could you post more details of your solution?

    I connect with other clients such as python or UAexpert. But not with Matlab or Simulink

     
  • jorgev - 2018-10-10

    jorgev hat geschrieben:
    Hi ligz17,
    I am trying to implement the same communication: CODESYS OPCUA server with raspberry pi to Matlab OPCUA client.
    Unfortunately I did not succeed. Could you post more details of your solution?
    I connect with other clients such as python or UAexpert. But not with Matlab or Simulink

    I successfully connected with the OPC UA SERVER at the raspberry with the entries below.

    MATLAB CODE:
    uaObj = opcua('opc.tcp://192.168.100.11:4840/OPCUAServer', 'None', 'None', uint8(0));
    connect(uaObj)

    Mathworks has suggested to use this undocumented technique until they release a patch/fix to handle better this connection errors.

     

Log in to post a comment.