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
  • It is a problem to have an endless loop in both the main function and the calc function. However, it won't start a new task each time. Since the main function in the original code just calls the calc function directly, that blocks the main function from continuing to run until the calc function finishes (and it will never finish since it has an endless loop). It would make more sense to remove the loop from the calc function since the main function will call it every 100ms.

    If your code is more complicated than the sample you shared, then it is possible that the code could do something to generate a fatal error (like dividing by 0). That would cause Citect to terminate the task and both functions would stop running. It is better to avoid endless loops like this in your code and call the function periodically from an Event.
Reply
  • It is a problem to have an endless loop in both the main function and the calc function. However, it won't start a new task each time. Since the main function in the original code just calls the calc function directly, that blocks the main function from continuing to run until the calc function finishes (and it will never finish since it has an endless loop). It would make more sense to remove the loop from the calc function since the main function will call it every 100ms.

    If your code is more complicated than the sample you shared, then it is possible that the code could do something to generate a fatal error (like dividing by 0). That would cause Citect to terminate the task and both functions would stop running. It is better to avoid endless loops like this in your code and call the function periodically from an Event.
Children
No Data