Scripting visual basic in Factorylink


Thread Starter

Oriel Babilonia

I wonder why despite using Variables.Add instruction "OPCCluster: VARIABLENAME" 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? influenced by the fact that the expression fvVariableTypeText the end of the sentence is no place?

thanks in advanced.
Oriel B

Gustavo A. Valero P.

Hola de nuevo Oriel!

Veo que sigues intentando domar a ese caballo salvaje y poderoso que es FactoryLink, jeje

<b>Moderator's note:</b> translated, "I see you're trying to tame that wild horse and FactoryLink powerful it is, lol"

Your problem is caused by a thing: Time or Patience!

Although you use the "Variables.Add" command to declare FL tags or internal variables that are not included in the mimic you are opening, you must wait some time to have these tags registered in VBA environment.

If there are many tags/variables, the registering process will last a little more in order to read/write them with no errors later.

The trick/suggestion is to carry out all this registering process when the app is starting using a global program (public) in VBA. In this way, you have all declarations in a same place and you can give Client Builder more time while it registers your tags.

I hope it can help you.

Gustavo A. Valero P.
Hola Gustavo, En buena hora tu respuesta!!!

As forever, thanks a lot for your answer.

Best regards.
Oriel B.