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
  • If you want to store a floating point value in a disk tag, it makes more sense to store it in a REAL (and you can use the same range for both the raw and engineering scales, like -100000 to 100000). However, it is technically valid to store a floating point value in an integer data type. This is often used with PLCs registers or sensors that don't support floating point values. Citect will take the floating point value and apply the engineering to raw scaling factor to it. Then, if it is still in the raw range it will write it to the variable, dropping any extra decimal places.

    For example, say your tag is a LONG with the scales:
    Raw zero: 0, Raw Full: 100, Eng Zero: 0, Eng Full: 10
    If you write 5.5 to the tag, it will be stored in the LONG as 55, but when Citect reads it back to display it on screen it will display as 5.5. However, if you tried to write 10.5 it would scale to the raw value 105 and since those are above the max value it would fail to write to the tag.

    Pavel, what are the scales on your tags and what value are you trying to write? If you leave the scales blank, I believe it defaults to 0 to 32000, which is a problem if you're trying to write a negative number. Try writing with the TagDebugForm() tool instead of your code (just call TagDebugForm() from a button). That way you know if it's the code or the tag that is the problem.

Reply
  • If you want to store a floating point value in a disk tag, it makes more sense to store it in a REAL (and you can use the same range for both the raw and engineering scales, like -100000 to 100000). However, it is technically valid to store a floating point value in an integer data type. This is often used with PLCs registers or sensors that don't support floating point values. Citect will take the floating point value and apply the engineering to raw scaling factor to it. Then, if it is still in the raw range it will write it to the variable, dropping any extra decimal places.

    For example, say your tag is a LONG with the scales:
    Raw zero: 0, Raw Full: 100, Eng Zero: 0, Eng Full: 10
    If you write 5.5 to the tag, it will be stored in the LONG as 55, but when Citect reads it back to display it on screen it will display as 5.5. However, if you tried to write 10.5 it would scale to the raw value 105 and since those are above the max value it would fail to write to the tag.

    Pavel, what are the scales on your tags and what value are you trying to write? If you leave the scales blank, I believe it defaults to 0 to 32000, which is a problem if you're trying to write a negative number. Try writing with the TagDebugForm() tool instead of your code (just call TagDebugForm() from a button). That way you know if it's the code or the tag that is the problem.

Children
No Data