Now() in Expression Tags

Kathy, I think your explanation is interesting but it ignores that the “now(pollRate)” function in an expression tag does not exhibit the end result expected behaviour that is documented in the Ignition User Manual for that function.

The pollRate argument is clobbered by the scan rate and is effectively useless in a tag expression.

The runScript expression function with its “pollRate” parameter has the same problem that now(pollRate) has. Someone else wrote about it here: viewtopic.php?f=72&t=12271&p=44499&hilit=now+expression+tag#p44499

I can test if runScript with a pollRate of one second runs once a second in an expression tag with a scan rate of 10 seconds.

I used this expression in an expression tag and the “[default]test” tag to test this:

toint(runScript("system.tag.write('[default]test',system.tag.read('[default]test').value+1)",1000),7)

This expression should increment the “[default]test” tag every second even though the scan class on the expression tag is 10 seconds, but it does not. The runScript “pollRate” argument is effectively and pedantically not working.

Anyway, I think the real issue and the real question is why do expression tags have scan classes associated with them? If they need them then why should they clobber the pollRate parameters of now and runScript? I might be wrong but it seems to me that in an earlier version of Ignition expression tags didn’t have scan classes or they didn’t effect the pollRate of now() and runScript.

Perhaps the issue I have brought up here in the first place is a bit persnickety since it is easy to configure and use a scan class on an expression tag that uses now() or runScript(). I do at least think that some additional documentation should be added to the now() and runScript() functions saying that the pollRate parameter doesn’t work in expression tags and that the scan class is used for polling instead.