some tags are not refreshing on DskDevice IO Device

Hi All,

I cant figure out why some tags doesnt refresh.

I am reading an ION meter via modbus tcp, and Total Power data is coming on 2 registers. So, in variable tags i have one for High Value Register and other tag for the Low Value register. and via cicode i make the calculation formula Value=High Value * 65536 + Low Value. I have other variable tag on DskDevice L15 named Value. but this isnot refreshing while on runtime. also if i make other text with the same expression tag "Value=High Value * 65536 + Low Value".

could someone help me please

Parents
  • Hi Patrick,
    Thank you for take your time to help me, I make what you suggest and still frozen values. but now I notice a strange behavior that you may help me, I think is easier.

    When I use this cicode, and I erase raw Zero scale, Raw Full Scale, Eng Zero Scale, Eng Full Scale on variables tags for "MTR1_KW_CALC":

    FUNCTION MTR1_KW_C()
    ErrSet(1); // Disable error checking, e.g.: divide by Zero
    MTR1_KW_CALC = MTR1_KW_H * 65536 + MTR1_KW_L;
    ErrSet(0); // Re-enable error checking.
    END

    FUNCTION MTR1_MAIN_C()
    ErrSet(1); // Disable error checking
    WHILE TRUE DO
    TaskNew("MTR1_KW_C", "", 8); // Call this function as a new task, but only if it does not run already
    SleepMS(100);
    END
    ErrSet(0); // Re-enable error checking.
    END

    It works fine, and refresh very well. But, now I get the whole number (-32789 for example) and I need to move the decimal point 3 espaces (-32.789 for example)

    I tried to maked on cicode dividing by 1000 but it freeze again.also I tried using raw scale and eng scale to move the decimal point and it also freeze.

    right now, my new issue is that I cant move the decimal point without freezing the value :(

    thank you very much

    regards,
Reply
  • Hi Patrick,
    Thank you for take your time to help me, I make what you suggest and still frozen values. but now I notice a strange behavior that you may help me, I think is easier.

    When I use this cicode, and I erase raw Zero scale, Raw Full Scale, Eng Zero Scale, Eng Full Scale on variables tags for "MTR1_KW_CALC":

    FUNCTION MTR1_KW_C()
    ErrSet(1); // Disable error checking, e.g.: divide by Zero
    MTR1_KW_CALC = MTR1_KW_H * 65536 + MTR1_KW_L;
    ErrSet(0); // Re-enable error checking.
    END

    FUNCTION MTR1_MAIN_C()
    ErrSet(1); // Disable error checking
    WHILE TRUE DO
    TaskNew("MTR1_KW_C", "", 8); // Call this function as a new task, but only if it does not run already
    SleepMS(100);
    END
    ErrSet(0); // Re-enable error checking.
    END

    It works fine, and refresh very well. But, now I get the whole number (-32789 for example) and I need to move the decimal point 3 espaces (-32.789 for example)

    I tried to maked on cicode dividing by 1000 but it freeze again.also I tried using raw scale and eng scale to move the decimal point and it also freeze.

    right now, my new issue is that I cant move the decimal point without freezing the value :(

    thank you very much

    regards,
Children
No Data