Wonderware Script Error

Apel

Member
Join Date
Aug 2007
Location
Singapore
Posts
98
DEAR ALL,
i AM SENDING FOLLOWING WW SCRIPT ,(ONLY SMALL PART), WHICH I FOUND WITH FOLLOWING ERROR MESSAGE...I CANT UNDERSTAND WHY?
FOR INDEX_X=1 TO 5
FOR INDEX_Y=1 TO 8
A_STSTOP="A_CSTOP"+Text(INDEX_X,"#")+Text(INDEX_Y,"#");
CALL TIME2INT(A_STSTOP , A_INTMTOT);
A_INTSTOP= A_INTMTOT;

A_STSTART="A_CSTART"+Text(INDEX_X,"#")+Text(INDEX_Y,"#");
CALL TIME2INT(A_STSTART , A_INTMTOT);
A_INTSTART= A_INTMTOT;


IF (A_TIMEMIN_NOW>A_INTSTOP AND A_TIMEMIN_NOW<A_INTSTART)
THEN CompressorNOT="Compressor"+Text(INDEX_X,"#");------->>ERROR:CAN NOT MIX ANOTHER TYPE WITH STRING.CompressorNOT DESCRETE TAG.

PLEASE HELP..
 
Doh.

Just what it says on the tin.... you've declared CompressorNOT as a discrete tag and are trying to assign a string value to it.
 
I'd check:
1. the variable type of Compressor (one being assigned value)
2. Casting function - "Text()", apparently in your case, so that the + operator deals with 2 strings.
 
Dear KRK,
THEN CompressorNOT="Compressor"+Text(INDEX_X,"#");------->>ERROR:CAN NOT MIX ANOTHER TYPE WITH STRING.CompressorNOT DESCRETE TAG

Compressor1-Compressor5 are descrete tag.
 
As I said before, this part of the script is trying to assign a string value to a tag named 'CompressorNOT' which looks to have been declared as a discrete.


...
 
Last edited:
Apel said:
DEAR ALL,
i AM SENDING FOLLOWING WW SCRIPT ,(ONLY SMALL PART), WHICH I FOUND WITH FOLLOWING ERROR MESSAGE...I CANT UNDERSTAND WHY?
FOR INDEX_X=1 TO 5
FOR INDEX_Y=1 TO 8
A_STSTOP="A_CSTOP"+Text(INDEX_X,"#")+Text(INDEX_Y,"#");
CALL TIME2INT(A_STSTOP , A_INTMTOT);
A_INTSTOP= A_INTMTOT;

A_STSTART="A_CSTART"+Text(INDEX_X,"#")+Text(INDEX_Y,"#");
CALL TIME2INT(A_STSTART , A_INTMTOT);
A_INTSTART= A_INTMTOT;


IF (A_TIMEMIN_NOW>A_INTSTOP AND A_TIMEMIN_NOW<A_INTSTART)
THEN CompressorNOT="Compressor"+Text(INDEX_X,"#");------->>ERROR:CAN NOT MIX ANOTHER TYPE WITH STRING.CompressorNOT DESCRETE TAG.

PLEASE HELP..

I've highlighted CompressorNOT for you -- that's where the problem is. CompressorNOT is a discrete and you're trying to assign it as a string.

But I think I see what you're trying to do. Are you trying to use an indirect tag? If so, you're building it wrong. You will want to define CompressorNOT as an indirect discrete. Then, you'll be wanting to assign CompressorNOT.name in the above location.
 
Last edited:
As others have indicated, you are constructing the assignment wrong. You cannot do an Indexed assignment like that. You need something like:

IF (A_TIMEMIN_NOW>A_INTSTOP AND A_TIMEMIN_NOW<A_INTSTART)
THEN
MyIndirectDiscrete.Name = "Compressor" + Text(INDEX_X,"#");
CompressorNOT.Value = MyIndirectDiscrete.Value;

MyIndirectDiscrete is a Tag defined as Indirect Discrete
 

Similar Topics

Hi all, Currently delving into Wonderware/Aveva System Platform for the first time, and I'm trying to set up a script to automatically write to...
Replies
3
Views
934
I have an older application that seems to rely on ICTMOUSE.DLL. I cannot locate this script extension using good ole google ANYWHERE! Would anyone...
Replies
4
Views
1,990
Hey I was needing help with some alarm scripting in Woderware System Platform. What would be the best way to write a script to auto acknowledge...
Replies
2
Views
2,544
I have an intouch condition script that generates 8 different csv files everyday at 0830 and populates them with totals for the previous day. For...
Replies
5
Views
2,419
Hi, I am trying to use Script function Library. I used Visual Studio to write the C# dll i will import in Archestra. So I import my dll...
Replies
1
Views
2,585
Back
Top Bottom