Author Topic: instantiate a AdvancedHMIDrivers  (Read 1255 times)

frutuopa

  • Newbie
  • *
  • Posts: 7
    • View Profile
instantiate a AdvancedHMIDrivers
« on: October 04, 2019, 12:55:28 PM »
Hello

Can y do that ?

        Dim vnomedavariavel As String = "TotalCiclos"
        Dim ETHIPCLX As New AdvancedHMIDrivers.EthernetIPforCLXCom

        ETHIPCLX.IPAddress = "151.93.93.148"



        Dim bl As New AdvancedHMIControls.BasicLabel
        bl.ComComponent = ETHIPCLX
        bl.PLCAddressValue = vnomedavariavel

        bl.AutoSize = True


        Me.Controls.Add(bl)
        bl.Visible = True

I always have a message:

INVALID TAG NAME

but if I do it in design mode I have no problems.

Can you help me?
Thanks

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: instantiate a AdvancedHMIDrivers
« Reply #1 on: October 04, 2019, 01:19:11 PM »
Is this the exact message "INVALID TAG NAME" or does it also include something like CIP error 4 ?

frutuopa

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: instantiate a AdvancedHMIDrivers
« Reply #2 on: October 04, 2019, 02:09:03 PM »


On the basic label i have the message Path Segment Error[Invalid Tag Name]

Thanks

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: instantiate a AdvancedHMIDrivers
« Reply #3 on: October 04, 2019, 02:48:14 PM »
Your tag doesn't exist in the PLC. A Path Segment Error is a response from the PLC saying it can't find the tag specified.

frutuopa

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: instantiate a AdvancedHMIDrivers
« Reply #4 on: October 04, 2019, 03:13:23 PM »
Notice the file I send you.
The variable exists ... I have no doubt.
Thank you for your answer.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: instantiate a AdvancedHMIDrivers
« Reply #5 on: October 04, 2019, 03:17:39 PM »
- Open your form in Design view
- Double click in a blank area on the form
- Paste in this code:
Code: [Select]
        Dim t() As MfgControl.AdvancedHMI.Drivers.CLXTag
        t = EthernetIPforCLXCom1.GetTagList(60000)
        Using sw As New System.IO.StreamWriter(".\TagList.txt")
            For i = 0 To t.Length - 1
                sw.WriteLine(t(i).TagName)
            Next
        End Using

- Run the application
- Close the application
- Browse to AdvancedHMI\bin\Debug
- Post the file TagList.txt on this forum

frutuopa

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: instantiate a AdvancedHMIDrivers
« Reply #6 on: October 04, 2019, 03:31:20 PM »
Here it goes

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: instantiate a AdvancedHMIDrivers
« Reply #7 on: October 04, 2019, 03:39:02 PM »
- In design view select your driver instance
- Post a screen shot of the properties of the driver

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: instantiate a AdvancedHMIDrivers
« Reply #8 on: October 04, 2019, 03:40:35 PM »
In your code, change this:

bl.ComComponent = ETHIPCLX

to

bl.ComComponent = EthernetIPForClxCom1

frutuopa

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: instantiate a AdvancedHMIDrivers
« Reply #9 on: October 04, 2019, 04:12:59 PM »
If i want to control 10 variables in 10 different plc I need 10 hdmidrivers in form.....
Thanks

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: instantiate a AdvancedHMIDrivers
« Reply #10 on: October 04, 2019, 04:31:09 PM »
If i want to control 10 variables in 10 different plc I need 10 hdmidrivers in form.....
Is this a statement or a question?

Every PLC normally has its own driver instance.

frutuopa

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: instantiate a AdvancedHMIDrivers
« Reply #11 on: October 04, 2019, 04:41:21 PM »
a statement.
if possible I would like to do everything just with code
Thanks

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: instantiate a AdvancedHMIDrivers
« Reply #12 on: October 04, 2019, 04:53:32 PM »
if possible I would like to do everything just with code
Technically everything is done in code. The designer is writing code in the designer.vb files when you add things to the form.