RobotStudio event

WebWare SDK - S4VarSubList [WebWare SDK]

Thomas J
Thomas J United States

Hello -

Has anyone successfully used "S4VariableSubscription" in a VB project?

I am attempting to create an applicaiton where the user must specify the names of rapid variables that are used for an application in an INI file and then use that information to connect to variables in the robot controller automatically.

Can someone provide some working examples of this object?

Thanks,

Tom 

Thomas H. Johnston
PACs Application Engineer

Comments

  • RussD
    RussD United States

    Hello Tom,

    Here is a simple application that demonstrates the use of the S4VariableSubscriptionList object.

    The user can view the current var sub list for an alias and also add their own vars to that alias profile.

    Please note that this application is for demonstration only, and is not intended to represent "production" code.

    varsub.zip

    Russell Drown
  • Thomas J
    Thomas J United States

    Hello Russ -

    Thankyou very much for your example, it was most helpfull.

    After playing for a while and trying different things, I was finally able to do what I needed simply by using the S4VariableSubscriptionList wrapper only. (It worked virtually anyways, I will know later this month if it works on the real robot)

      Set S4VarSubLst = Helper1.VariableEventList
      S4VarSubLst.RemoveAll
      S4VarSubLst.Add mstrEnable, "bool", 0
      S4VarSubLst.Add mstrPurge, "bool", 0
      S4VarSubLst.Add mstrPurgeTime, "num", 0
      S4VarSubLst.Add mstrDwell, "num", 0

    Then using the num and bool changed events in my program I was able to accomplish what was needed.

    Something must have gotten messed up in my previous attempts because I could not "delete" a variable subscription until I re-boot my computer. After re-booting everything worked as expected in the property pages and the VB code page.

    Thanks again for your help. 

    As always it is much appreciated.

    Tom

    Thomas J37991,6144097222
    Thomas H. Johnston
    PACs Application Engineer