Hi there,
This is my first post in this great forum.
We expected the writeBlocking will block the script till the opcTag has been written. After tests and simulations we saw a difference between tags and opcTags after writeBlocking function.
Without sleep-function is a difference between refValue and opcValue
With sleep is no difference.
Can anybody tell me how witeBlocking work?
In my mind writeBlocking block the script but after testing I think it will not do this?!?
Setup:
the Tags we want to write are opcTags on a siemens plc
TagGroup is new defined group with 100ms, mode = direct
Code:
import time
tagPath = '[MyTagProvider]tagPath'
for i in range(0,30):
refValue = i
writeResult = system.tag.writeBlocking([tagPath], [refValue],2000)
#time.sleep(0.10)
opcValue = system.tag.readBlocking([tagPath])[0].value
if not refValue == opcValue:
print('value different - refValue: {0} | opcValue:{1}'.format(refValue, opcValue))
else:
print('No Difference')