I do not have any reedings in RUN MODE from MPU6050........

kalmeyer
2020-07-27
2020-08-04
  • kalmeyer

    kalmeyer - 2020-07-27

    Hello everyone!
    I am using Codesys ver 3,5 on Raspberry Pi and I want to use a Gyro MPU6050
    I have installed Gyro MPU6050 from "I2C masters" (it is there as default)
    But I do not have any reedings in RUN MODE
    Must I install a library?
    What am I missing?

    I would be very glad if you have any advices on how to proceed?
    Thank you everyone for your help!

     
  • i-campbell

    i-campbell - 2020-07-27

    Do you have 'always update variables' set to disabled?

    If so, you need to use the variables in code before they will be updated.

     
  • kalmeyer

    kalmeyer - 2020-07-28

    Thanks for reply.......
    Do you think I should make this setting in: codesys or in Raspberry?
    In fact, I do not know what you mean when you write: use variables in code before update.
    Do you know codesys?
    Hope you can answer me again
    / Klaus

     
  • kalmeyer

    kalmeyer - 2020-07-30

    Hi Cambell
    I'm trying to understand what you're advising me to do and maybe I'm just not good enough.
    When I stand on the MPU6050 and right click - Edit I / O I do not have the image you sent me .......
    Can you help me further?
    I am very grateful for your answers and I hope I solve the problem so I can move forward with my task.
    / Klaus

     
    • Morberis

      Morberis - 2020-07-31

      Always update variables is available if you go to the device tree and look under PLC Settings under the device.

      For what @icampbell is talking about the variables won't be refreshed unless they're used somewhere in your code. Like an input variables POU. For instance if I'm connected up to 1 of my PLC cards and I'm looking the variables like %IX4.4 won't change unless %IX4.4 or a variable I've mapped it to is being read in a POU. That POU also has to be configured in Task Configuration and running. Basically if a devices variables aren't being used in your code it won't be updated. Sorry icampbell I've mostly repeated what you said.

      Here is the help file page on it.

       

      Last edit: Morberis 2020-07-31
  • i-campbell

    i-campbell - 2020-08-03

    Hello kalmeyer. I was telling you something wrong, the Gyro MPU6050 driver is built slightly different to other drivers.

    Make sure the address is correct in Gyro_MPU6050 > IΒ²C-Bus Parameters > IΒ²C address

    Access the variables in your code using: Gyro_MPU6050.lrAX, Gyro_MPU6050.lrGX etc.

     
  • kalmeyer

    kalmeyer - 2020-08-04

    Hello everyone
    Thank you very much for your answer.
    The problem is solved when I had bought an MPU6050 that was faulty.
    I activated the GYRO MPU6050 directly from CoDeSys and I got reedings immediately in RUN MODE.
    Thank you very much for the help ....

     

Log in to post a comment.