Scripting Factorlink V7.5

O

Thread Starter

Oriel Babilonia

How do I use a FL tag in VB scripting if that is dynamic array?

example
for i = 0 to 10
fltag
next i

if the correct way to write it is: [OPCcluster:fltag]

i have a error message when type [OPCcluster:fltag]

thanks in advanced
 
O

Oriel Babilonia

I usually type on program with FLtag, like this:

[Opccluster:fltag[0]] or [Opccluster:fltag[1]], etc..

But, How do I use when variable is a dynamic array?

for example

for i = 0 to 9
[Opccluster:fltag]
next i

the above code, show a message error.

thanks in advanced.
 
G

Gustavo A. Valero P.

Hola Oriel,

Try using the info shown here: http://control.com/thread/1026233631#1026233924

I still think what you want to do in VBA isn't possible but the thread I suggested can give you a workaround.

Instead, you can declare FactoryLink array tags in VBA with no problems using this syntax:<pre>
For ndx = 0 To 10
Variables.Add "Opccluster:msg1[" & ndx & "]", fvVariableTypeText
Variables.Add "Opccluster:msg2[" & ndx & "]", fvVariableTypeText
Next</pre>
but try reading/writing array tags using an indirect addressing is another story!

Let us know if this helped you.

Saludos desde Venezuela!

Gustavo A. Valero P.
 
O

Oriel Babilonia

Thank for your answers.

I could actually make indirect addressing with external variables, I had to do the fixed addresses and the program quite large.

Regards.

Y saludos desde Colombia!!
 
O

Oriel Babilonia

Dear Gustavo V.

I wonder why despite using Variables.Add instruction "OPCCluster: VARIABLENAME" fvVariableTypeText before using an OPC variable in any judgment of visual basic scrip in FactoryLink.

when I restart the computer and get back into the FactoryLink application, I get error messages when trying to run some of the codes programmed. these error messages refer to the variable is not recognized. I get a window with the end or debug option, choose either. I try again to run the routine and the error code no longer appears? because is this?

thanks in advanced.
Oriel B
 
Top