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 reply. I have this on my cicode file:
    FUNCTION MTR1_KW_C()
    WHILE 1 DO
    MTR1_KW_CALC = (MTR1_KW_H*65536 + MTR1_KW_L)/1;
    SleepMS(100);
    END
    END
    FUNCTION MTR1_MAIN_C()
    While 1 DO
    ErrSet(1); // Disable error checking, e.g.: divide by Zero
    MTR1_KW_C();
    ErrSet(0); // Re-enable error checking.
    SleepMS(100);
    END
    END
    Does your function update the disk tag correct if you call your function manually (from a button for example)?
    -i tried this ando doesnt update the disk tag

    And if you use citect 2016 or higher, please take a look at Calculated Variables. This functionality could do exactly what you want, just by defining a Cicode I/O Decvice and filling in your formula in the address field of a variable tag.
    -This is exactly what i need, but im using Citect 2015 7.50 SP1 Patch 29 [5] :(

    Thank you,
    Regards,
    Pavel Lopez
Reply
  • Hi Patrick,
    Thank you for reply. I have this on my cicode file:
    FUNCTION MTR1_KW_C()
    WHILE 1 DO
    MTR1_KW_CALC = (MTR1_KW_H*65536 + MTR1_KW_L)/1;
    SleepMS(100);
    END
    END
    FUNCTION MTR1_MAIN_C()
    While 1 DO
    ErrSet(1); // Disable error checking, e.g.: divide by Zero
    MTR1_KW_C();
    ErrSet(0); // Re-enable error checking.
    SleepMS(100);
    END
    END
    Does your function update the disk tag correct if you call your function manually (from a button for example)?
    -i tried this ando doesnt update the disk tag

    And if you use citect 2016 or higher, please take a look at Calculated Variables. This functionality could do exactly what you want, just by defining a Cicode I/O Decvice and filling in your formula in the address field of a variable tag.
    -This is exactly what i need, but im using Citect 2015 7.50 SP1 Patch 29 [5] :(

    Thank you,
    Regards,
    Pavel Lopez
Children
No Data