Author Topic: how to put the ModbusTCPCom info in a file  (Read 5554 times)

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: how to put the ModbusTCPCom info in a file
« Reply #15 on: May 21, 2019, 05:10:43 PM »
I DON`T KNOW HOW TO MAKE THE PROPERTY MAKE THE INI READ IT AS THE PLAYLIST

THIS IS THE CODE

Code: [Select]
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles cam1Btn.Click


        If AxVLCPlugin22.Visible = False Then

            AxVLCPlugin22.playlist.add("rtsp://admin:admin1234@192.168.1.64:554/Streaming/Channels/101/")
            AxVLCPlugin22.playlist.play()
            AxVLCPlugin22.Visible = True
            AxVLCPlugin22.Enabled = True
        Else
            AxVLCPlugin22.playlist.stop()
            AxVLCPlugin22.Visible = False
            AxVLCPlugin22.Enabled = False


        End If


    End Sub

I NEED TO EDIT IT TO READ
Code: [Select]
rtsp://admin:admin1234@192.168.1.64:554/Streaming/Channels/101
FROM THE INI FILE

AND I NEED THAT WORK INSIDE THE FORM1.VB I DON`T PREFER TO EDIT BUTTON VB


Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5317
    • View Profile
    • AdvancedHMI
Re: how to put the ModbusTCPCom info in a file
« Reply #16 on: May 21, 2019, 05:30:44 PM »
         Dim p As New AdvancedHMIDrivers.IniParser(iniFileName)
        AxVLCPlugin22.playlist.add(p.GetSetting(MysectionName, MySettingName))

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: how to put the ModbusTCPCom info in a file
« Reply #17 on: May 21, 2019, 05:50:58 PM »
IT GIVES AN ERROR

THIS IS THE INSIDE OF THE INI

Code: [Select]
[door1cam]
url=rtsp://admin:admin1234@192.168.1.64:554/Streaming/Channels/101/

AND THIS IS THE NAME OF THE FILE

Code: [Select]
ipcamurl
AND THIS IS THE CODE WHEN I TRIED I

Code: [Select]
  Private Sub Button1_Click(sender As Object, e As EventArgs) Handles cam1Btn.Click


        If AxVLCPlugin22.Visible = False Then
            Dim p As New AdvancedHMIDrivers.IniParser(ipcamurl.ini)
            AxVLCPlugin22.playlist.add(p.GetSetting(door1cam, URL))

            AxVLCPlugin22.playlist.play()
            AxVLCPlugin22.Visible = True
            AxVLCPlugin22.Enabled = True
        Else
            AxVLCPlugin22.playlist.stop()
            AxVLCPlugin22.Visible = False
            AxVLCPlugin22.Enabled = False


        End If


    End Sub

AND THE ERROR IN THE ATTACHMENTS

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: how to put the ModbusTCPCom info in a file
« Reply #18 on: May 21, 2019, 05:53:49 PM »
BY THE WAY I WORK ON visual studio 2017 enterprise

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5317
    • View Profile
    • AdvancedHMI
Re: how to put the ModbusTCPCom info in a file
« Reply #19 on: May 21, 2019, 05:56:16 PM »
The values are strings, they need quotes

 Dim p As New AdvancedHMIDrivers.IniParser("ipcamurl.ini")
 AxVLCPlugin22.playlist.add(p.GetSetting("door1cam", "URL"))

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: how to put the ModbusTCPCom info in a file
« Reply #20 on: May 21, 2019, 06:01:04 PM »
IT WORKED LIKE A CHARM

THANK U VERY MUCH

YOU GUYS ARE THE BEST

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: how to put the ModbusTCPCom info in a file
« Reply #21 on: May 23, 2019, 05:03:47 PM »
The original design was intended to have your ini file added to your project in Solution Explorer, then set the CopyToOutputDirectory property of the file to CopyIfNewer.


But I would expect that if you want it in another place, you can specify the full path in the IniFileName Property such as :


C:\MyDirectory\MyIniFile.ini

The file is opened and parsed in the IniParser.vb file found in the AdvancedHMIDrivers project under the Common folder.


i can`t change the path it is locked


oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: how to put the ModbusTCPCom info in a file
« Reply #22 on: May 26, 2019, 12:33:20 AM »
am trying to read the sitting from the ini file

but it is not working
the code
Code: [Select]
Dim pnnn As New AdvancedHMIDrivers.IniParser("ipcamurL.INI")

        phwo2.Text = pnnn.GetSetting("meare", "typem")

the inside of the ini file

Code: [Select]
[meare]
typem = Flo1

i don`t know how to do it


Godra

  • Hero Member
  • *****
  • Posts: 1446
    • View Profile
Re: how to put the ModbusTCPCom info in a file
« Reply #23 on: May 26, 2019, 01:16:28 AM »
Are your names correct: is it "ipcamurl.ini" or "ipcamurL.INI"?

You also have spaces: typem = Flo1, which should be typem=Flo1.
« Last Edit: May 26, 2019, 01:46:13 AM by Godra »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5317
    • View Profile
    • AdvancedHMI
Re: how to put the ModbusTCPCom info in a file
« Reply #24 on: May 26, 2019, 07:06:16 AM »
am trying to read the sitting from the ini file

but it is not working
the code
Code: [Select]
Dim pnnn As New AdvancedHMIDrivers.IniParser("ipcamurL.INI")

        phwo2.Text = pnnn.GetSetting("meare", "typem")

the inside of the ini file

Code: [Select]
[meare]
typem = Flo1

i don`t know how to do it
What error do you get?

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: how to put the ModbusTCPCom info in a file
« Reply #25 on: May 27, 2019, 03:43:39 PM »
the error in the attachment

and the code is in the form load

Code: [Select]

Dim pnnn As New AdvancedHMIDrivers.IniParser("ipcamurL.INI")
  phwo2.Text = pnnn.GetSetting("meare", "typem")



        If phwo2.Text = "Flo1" Then

            ToolStripStatusLabel.Text = "الطابق الاول"

            ActiveMdiChild.Dispose()

            Dim ChildForm As New floor1

            ChildForm.MdiParent = Me
            ChildForm.WindowState = FormWindowState.Maximized
            ChildForm.FormBorderStyle = FormBorderStyle.None
            ChildForm.ControlBox = False
            ChildForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
            ChildForm.MaximizeBox = False
            ChildForm.MinimizeBox = False
            ChildForm.ControlBox = False
            ChildForm.WindowState = System.Windows.Forms.FormWindowState.Normal
            ChildForm.Dock = DockStyle.Fill
            ChildForm.AutoScroll = True

            Cursor = Cursors.Default
            ResumeLayout()
            ChildForm.Show()
            Grbtn.ForeColor = System.Drawing.Color.DodgerBlue
            F2btn.ForeColor = System.Drawing.Color.DodgerBlue
            F1btn.ForeColor = System.Drawing.Color.Red
            Outbtn.ForeColor = System.Drawing.Color.DodgerBlue
            F1btn.FlatStyle = System.Windows.Forms.FlatStyle.Flat
            Grbtn.FlatStyle = System.Windows.Forms.FlatStyle.Standard
            F2btn.FlatStyle = System.Windows.Forms.FlatStyle.Standard

            Outbtn.FlatStyle = System.Windows.Forms.FlatStyle.Standard

        End If
        If phwo2.Text = "2" Then

            ToolStripStatusLabel.Text = "OutSide"
            Dim ChildForm As New OUT

            ChildForm.MdiParent = Me
            ChildForm.WindowState = FormWindowState.Maximized
            ChildForm.FormBorderStyle = FormBorderStyle.None
            ChildForm.ControlBox = False
            ChildForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
            ChildForm.MaximizeBox = False
            ChildForm.MinimizeBox = False
            ChildForm.ControlBox = False
            ChildForm.WindowState = System.Windows.Forms.FormWindowState.Normal
            ChildForm.Dock = DockStyle.Fill
            ChildForm.AutoScroll = True

            Cursor = Cursors.Default


            ChildForm.Show()
            Grbtn.ForeColor = System.Drawing.Color.DodgerBlue
            F2btn.ForeColor = System.Drawing.Color.DodgerBlue
            F1btn.ForeColor = System.Drawing.Color.DodgerBlue
            Outbtn.ForeColor = System.Drawing.Color.Red
            F1btn.FlatStyle = System.Windows.Forms.FlatStyle.Standard
            Grbtn.FlatStyle = System.Windows.Forms.FlatStyle.Standard
            F2btn.FlatStyle = System.Windows.Forms.FlatStyle.Standard

            Outbtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat
        End If
« Last Edit: May 27, 2019, 04:21:34 PM by oqapsking »

Godra

  • Hero Member
  • *****
  • Posts: 1446
    • View Profile
Re: how to put the ModbusTCPCom info in a file
« Reply #26 on: May 27, 2019, 05:55:09 PM »
I did get the same error if spaces were used: typem = Flo1, which should be typem=Flo1.

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: how to put the ModbusTCPCom info in a file
« Reply #27 on: May 27, 2019, 06:06:39 PM »
thanks it worked i did not notice it  lol

thanks again