MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal 1 » Community Skins and Plugins » Plugins


Plugins Plugins developed and maintained by users. Want to create your own plugin? Start a thread in here.

Reply
 
Thread Tools Display Modes
Old 2008-02-11, 17:05   #1 (permalink)
Portal User
 
Join Date: Feb 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

Country:


Question plugin Home Automation ModbusTCP

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.W indow.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.
merlin38 is offline   Reply With Quote
Reply

Bookmarks

Tags
automation, home, modbustcp, plugin

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
X10 Home Automation Plugin Problem damian General Support 6 2006-04-12 08:01
Home automation 'My Ambience' snowflake Plugins 3 2005-10-29 17:46
Home Automation Anonymous Improvement Suggestions 2 2005-03-30 08:58
X10 Home Automation Plugin devo Plugins 19 2005-02-25 23:58
Home automation, using “My News” Anonymous Plugins 0 2004-12-28 17:53


All times are GMT +1. The time now is 05:02.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress
Advertisement System V2.6 By   Branden