home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
plugin Home Automation ModbusTCP
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="merlin38" data-source="post: 234108" data-attributes="member: 67319"><p>I just read the tutorial for creating your own plugin, and the example works fine (I program in VB.NET).</p><p>I want to develop a plugin so that MP can communicate with a device using the ethernet protocol ModbusTCP.</p><p>I have an ActiveX for the ModbusTCP communication.</p><p>How can I call that ActiveX when a button in MP is pressed to activate a lamp,....</p><p>I try to put the ommand under ButtonOne but it doesn't work. The dialog doesn't appear. </p><p>The code for the communication is correct because this works as EXE.</p><p></p><p></p><p> Private Sub OnButtonOne()</p><p></p><p> klant = New System.Net.Sockets.TcpClient(address, port)</p><p></p><p> master = Modbus.Device.ModbusIpMaster.CreateTcp(klant) ''activeX</p><p></p><p></p><p> Dim numInputs, startAddress As UShort</p><p> Dim inputs(3) As UShort</p><p></p><p> numInputs = 2</p><p> startAddress = 51</p><p> inputs = master.ReadHoldingRegisters(1, startAddress, numInputs)</p><p> tekst = CStr(inputs(0))</p><p> </p><p></p><p></p><p> Dim dlg As GUIDialogOK = CType(GUIWindowManager.GetWindow(CType(GUIWindow.Window.WINDOW_DIALOG_OK, Integer)), GUIDialogOK)</p><p></p><p> dlg.SetHeading("Button has been pressed")</p><p> dlg.SetLine(1, tekst)</p><p> dlg.SetLine(2, String.Empty)</p><p> dlg.SetLine(3, String.Empty)</p><p> dlg.DoModal(GUIWindowManager.ActiveWindow)</p><p> End Sub</p><p></p><p>Have I to use the ActiveX in another way.</p><p></p><p>Regards.</p></blockquote><p></p>
[QUOTE="merlin38, post: 234108, member: 67319"] I just read the tutorial for creating your own plugin, and the example works fine (I program in VB.NET). I want to develop a plugin so that MP can communicate with a device using the ethernet protocol ModbusTCP. I have an ActiveX for the ModbusTCP communication. How can I call that ActiveX when a button in MP is pressed to activate a lamp,.... I try to put the ommand under ButtonOne but it doesn't work. The dialog doesn't appear. The code for the communication is correct because this works as EXE. Private Sub OnButtonOne() klant = New System.Net.Sockets.TcpClient(address, port) master = Modbus.Device.ModbusIpMaster.CreateTcp(klant) ''activeX Dim numInputs, startAddress As UShort Dim inputs(3) As UShort numInputs = 2 startAddress = 51 inputs = master.ReadHoldingRegisters(1, startAddress, numInputs) tekst = CStr(inputs(0)) Dim dlg As GUIDialogOK = CType(GUIWindowManager.GetWindow(CType(GUIWindow.Window.WINDOW_DIALOG_OK, Integer)), GUIDialogOK) dlg.SetHeading("Button has been pressed") dlg.SetLine(1, tekst) dlg.SetLine(2, String.Empty) dlg.SetLine(3, String.Empty) dlg.DoModal(GUIWindowManager.ActiveWindow) End Sub Have I to use the ActiveX in another way. Regards. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
plugin Home Automation ModbusTCP
Contact us
RSS
Top
Bottom