InTouch indirect tags

sryan

Member
Join Date
Sep 2005
Location
NJ
Posts
7
Is it possible to set an indirect tag's reference "indirectly"?

For example, I have a number of indirect tags TAG_INDIRECT_1, TAG_INDIRECT_2, ... TAG_INDIRECT_n, and a function GetTagname(i) that returns the i'th tagname from some list (a config file, for instance).

I could explicitly set the references like so:

TAG_INDIRECT_1.Name = CALL GetTagname(1);
TAG_INDIRECT_2.Name = CALL GetTagname(2);
etc.

What I would like to do is something like this:

FOR i=1 TO n
SetTagname("TAG_INDIRECT_" + i, CALL GetTagname(i));
NEXT i

I'd prefer a WW Script solution, but would be willing to write a custom DLL if necessary.

Any ideas?

Thanks,

Steve
 
Greetings Syran,
Well I don't have InTouch installed in my PC right now (I'm at home) But I don't think that you can loop on your indirect tag name to get it change with each iteration of the loop.

Well the easy way, You may simply creat a macro in Excel and generate any number of lines of code easly then copy & paste it in a function.

One day I was developing a SCADA software for a water treatment unit, It was about 800 I/O, I used visual basic to do it, Imagine the number of he lines of code ... It was 20,000 line!!

The project was finished within 3 months (We were only two engineers in this) .. The key of generating all these lines of code was Excel macros.
 
I don't think you can do it. The problem is that you need to use the .Name of the indirect tag, in which case you can't use a string (or build a string) to represent the tag itself. At least I haven't been able to find a way.
 
Thanks, guys.

The problem with generating the code to cut and paste is that I don't know until runtime how many tags I'll be using. Of course, all the TAG_INDIRECT_x tags must be in the dictionary, but by looping I can bail out early when I detect the end of my list.

Tark, I think you may be right- what I was hoping for was something along the lines of the SetCommentField(strTagname, strComment) function from the KBCD.

Steve
 
sryan said:
Thanks, guys.

The problem with generating the code to cut and paste is that I don't know until runtime how many tags I'll be using. Of course, all the TAG_INDIRECT_x tags must be in the dictionary, but by looping I can bail out early when I detect the end of my list.
I see ...
Another thing: You said that you don't know until runtime how many tags you 'll be using.
Ok, Do you know how many possibilities that you have in runtime. If it is known you may use an If Then ElseIf statment or Select case statment to select which lines of code to be used.

Or maybe, You have to change the hall idea!
You may share us your application need so we can think with you.

Best regards.
 

Similar Topics

Hi! I have problem with intouch script and indirect tags. I have script which create csv files and i want to automatize it to write data from...
Replies
0
Views
834
Is it possible to have an indirect tag screen (i.e. motor/pump/servo screen) with an alarm banner? Presently I have 4 pump screens that all...
Replies
9
Views
3,350
Hi, I am having trouble in the Intouch Application maping indirect real tags to IO real tags to grab information.
Replies
2
Views
3,401
I am a beginner in SCADA programming and am currently using InTouch. I want to create an array of tagnames, though I know this is not possible. I...
Replies
9
Views
8,333
i try to set constant value to indirect tag but it is not set i write it in button script : boaz.value=23; (boaz is an indirect real tag name )...
Replies
7
Views
10,121
Back
Top Bottom