System.tag.read and direct read

Hi,
if I program something like this:

val=system.tag.read(tagPath).value if val==10: #do something

am I sure that the if clause gets a fresh value for tagPath, i.e. that the system.tag.read reads directly from the PLC and not from an Ignition internal cache?
My communication setup is
Ignition<->KepWare<->S7-1500

Thanks in advance

It does not. The SQLtags are read according to the scan class timing that’s been set up. system.tag.read() will retrieve the most recently read value. You need to use system.opc.readValue() to bypass the SQLtag system to read precisely when you ask.