Sign in to follow this  
Followers 0
marsheng

Citect- SQL TagWrite TagRead

4 posts in this topic

I'm having problems with with Citect ver 7.2, the code runs well on previous versions but not 7.2 I'm doing the following Clearing out 20 variables in KOYO PLC eg FOR i=1 TO 7 DO TagWrite("SS_SlAbs"+IntToStr(i),0); END I reading in data from an SQL iReq1=SQLGetField(hSQL,"Knife1RequiredCuts"); iReq2=SQLGetField(hSQL,"Knife2RequiredCuts"); iLen1=SQLGetField(hSQL,"Knife1sLength"); Doing some calcs and then writing the new data eg TagWrite("SS_SlAbs"+IntToStr(i+1),(iSlitCurrPos*10)); The values for SS_SlAbsXX should be in the order 0-2500. I'm getting 7 digit numbers. Ok so if I put a Message and a Screen prompt after the SQL reads and wait a few seconds before proceeding, I get the right values written to SS_SlAbsXX Suggestions please .

Share this post


Link to post
Share on other sites
Have you tried TagWrite("SS_SlAbs"+IntToStr(i+1),IntToStr(iSlitCurrPos*10)); TagWrite("sTag","sValue")

Share this post


Link to post
Share on other sites
I don't understand your reply. It is not a syntax issue but a timing one.

Share this post


Link to post
Share on other sites
I have had a problem in the past when passing an "int" to tagwrite(), i would not always get the values i was expecting. It only seemed to happen when calling tagwrite() numerous times in the one function.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0