This problem is most likely caused by
timing, and the Citect main task thread. The tag association
command runs in a common task with all other functions, which may
include some foreground/blocking functions. The tag association
function calls can get interrupted or will not execute if there are
other blocking functions executing (SQL, Database lookups). The
easiest way to solve this problem, is to create a new cicode task
by calling your PLCWrite() function using TaskNew(). I.e.
TaskNew("PLCWrite","",0).
|