AdvancedHMI Software

General Category => Support Questions => Topic started by: frutuopa on October 04, 2019, 12:55:28 PM

Title: instantiate a AdvancedHMIDrivers
Post by: frutuopa 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
Title: Re: instantiate a AdvancedHMIDrivers
Post by: Archie 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 ?
Title: Re: instantiate a AdvancedHMIDrivers
Post by: frutuopa on October 04, 2019, 02:09:03 PM


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

Thanks
Title: Re: instantiate a AdvancedHMIDrivers
Post by: Archie 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.
Title: Re: instantiate a AdvancedHMIDrivers
Post by: frutuopa 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.
Title: Re: instantiate a AdvancedHMIDrivers
Post by: Archie 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
Title: Re: instantiate a AdvancedHMIDrivers
Post by: frutuopa on October 04, 2019, 03:31:20 PM
Here it goes
Title: Re: instantiate a AdvancedHMIDrivers
Post by: Archie 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
Title: Re: instantiate a AdvancedHMIDrivers
Post by: Archie on October 04, 2019, 03:40:35 PM
In your code, change this:

bl.ComComponent = ETHIPCLX

to

bl.ComComponent = EthernetIPForClxCom1
Title: Re: instantiate a AdvancedHMIDrivers
Post by: frutuopa 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
Title: Re: instantiate a AdvancedHMIDrivers
Post by: Archie 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.
Title: Re: instantiate a AdvancedHMIDrivers
Post by: frutuopa on October 04, 2019, 04:41:21 PM
a statement.
if possible I would like to do everything just with code
Thanks
Title: Re: instantiate a AdvancedHMIDrivers
Post by: Archie 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.