Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website

  • I'm becoming crazy on this datapoint,
    Elevation position have to be an angle between 0 and 90 degrees,
    due to some bug that actually I can't discover, it happens that I've a strange value in Elevation Position,
    it seems to be 0 but it is not

    0_1598132085435_850db682-039f-42cc-9be6-781390419a23-immagine.png

    in my C code connected to mango via Modbus, I've the following patch:
    #define EL_MAIN 0
    #define NUM_OF_ELEVATION_AXES 2
    float new_elevation_position[NUM_OF_ELEVATION_AXES] = { 0.0, 0.0 };
    if (new_elevation_position[EL_MAIN] < 0.5f || new_elevation_position[EL_MAIN] > 89.5f){
    ----
    }

    but the stm32 doesn't enter inside the IF, so , how I can understand the value inside elevation_position? By my point of view a float container can only produce numbers, so there's no way to do not fall inside the IF.

    Please share me your suggestment, it is no possible for me to see the raw value because the board is about 4000kms far away from me.
    Thanks,
    Antonio


  • Hang on, you're writing code into an STM32 but are unable to use the debugger to see the raw value?? Or do you mean you're trying to emulate the situation you are finding and cannot see why the stm32 won't work with your if statement?
    In my experience of writing C, I either set the values for the array from initialisation, or the dimension of said array.
    So

    float new_elevation_position[] = { 0.0, 0.0 };
    

    Should suffice, but that's just me.

    First up, mango version, and check logs to see what's coming in to the system. See if you can catch any warnings or errors about incoming data.

    Assuming this is modbus IP why not use wireshark to debug?
    If it's not and it's serial, why not write a sniffer to log all raw data between the endpoint and mango?

    Looking at the value, it looks like it might be trying to display a control character and thus treating it as so.
    From that deduction, are you certain the data fired is raw hex and not ascii?
    You'd need 0x30 for a 0 which would fall outside of your if statement rules...
    Otherwise, something's out of sync and thus you're receiving rubbish.

    Just throwing questions to get a better idea here...

    Fox


  • Hi Fox and thanks for your answer,
    the stm32 and it's mango are 400km away from me, I've not a so long cable to debug it using stlink, but maybe there's a way to do it over internet using openocd but I've to study about it, I was looking for a quick solution.
    in Mango 2.8.8. the datapoint is defined as

    0_1598249250295_5b55b1ef-dc26-46ea-8ea3-faf329108bf9-immagine.png

    but it is a float, I don't think it use character encoding Ascii.
    It is modbus TCP.

    In any case I don't think it is a Mango problem but an STM32 FW bug because the datapoint is read_only.
    For Mango just a bit of confuzione in the yellow fields

    0_1598249509491_9faea6c7-f308-44f6-9355-ad6f8525baa2-immagine.png

    For me is important to undeestand the value that fall outside the IF statement

    if (new_elevation_position[EL_MAIN] < 0.5f || new_elevation_position[EL_MAIN] > 89.5f){
          ... bugManager();
    }
    

  • Might be worth writing your own bridge to parse the data between the two systems.
    Are you using an RTU encapsulation to talk to the stm32 or is it just TCP directly to it?

    Just thinking it would definitely be a better option than trying to talk to your micro and not brick anything....

    Fox