Results 1 to 8 of 8

Thread: Creating RR Plugin's. Help required

  1. #1
    Low Bitrate
    Join Date
    Oct 2008
    Location
    Wiltshire, UK
    Posts
    63

    Creating RR Plugin's. Help required

    Please can someone point me in the correct direction? I am a hardware guy with limited software experienceÖ.

    I am trying to write a plugin to take data from a com port, parse the data and then pass variables and labels to RR.

    I can do the two functions separately.
    a) I can compile the VB.net example, create a DLL (Class Library) and interface with RR.
    b) I can create an exe (Windows Form Application) with VB.net to open the COM port, parse the data and create the data ready to be sent to RR.

    However, I canít get the com port to work correctly within the DLL and I canít get the EXE to talk to RR.

    I would happily go with either approach, if I could understand how to make them work:-
    1) Use the DLL. With this I can already open the com port in the DLL but Iím unsure where to put the code to continually read com port data (and parse it)
    2) When using Windows form application and I can pretty much do everything I need from the Com port point of view, but can I add the RRSDK interface and then embed the application?

    Iím guessing these questions are really down to my fundamental lack of understanding of VB etc.

    My motivation for this is, I have done a lot of work reverse engineering the can bus of the BMW E84 and I would like to pass this info into RR. Currently I am translating the data into old iBus style data and using iBusRR. Whilst this works I am limited at what I can pass back. Ultimately this should benefit a lot of people with BMWís that no longer have iBus.

    Thanks,

    Trev.

    A list of the ID's that i have decoded for the BMW can bus can be found here:-
    _http://www.loopybunny.co.uk/CarPC/k_can.html

  2. #2
    Variable Bitrate
    Join Date
    Jul 2010
    Posts
    321
    However, I can’t get the com port to work correctly within the DLL
    1) Use the DLL. With this I can already open the com port in the DLL...
    Contradiction?

    I can’t get the EXE to talk to RR.
    Normally exe's are separate programs that won't talk to other programs. A DLL is the way to go for plugins.

    unsure where to put the code to continually read com port data (and parse it)
    Do you know about timers?

    If you got the example dll to compile, interface, and work in RR, then it shouldn't be that difficult to get "your code" to work in a dll. I'm not avid in the way RR at all, but the core of the .NET software stuff is the same.
    Current Worklog: TBA - '05 Rav4 (Mobo Dead).
    www.rav4world.com - Forums for Rav4 owners
    www.flavorfeasts.com - Cooking website/forums
    -Basic forums live atm, come contribute!

  3. #3
    MySQL Error
    Auto Apps:loading...

    Join Date
    Oct 2004
    Posts
    5,256
    you can talk to rr in an exe if you want to...

    ideally a plugin is best

    comport should be set to event, when char is rx, then you process data

    there is no reason to continually read, if you do, better do it in a thread, or rr will be waiting too
    -Thanks
    Mitch
    www.rush2112.net

    "Did you test it in carwings??"

    Sun, Come shine my way
    May healing waters bury all my pain
    Wind, Carry me home
    The fabric of reality is tearing apart
    The piece of me that died
    Will return To live again

  4. #4
    Raw Wave pierrotm777's Avatar
    Join Date
    May 2008
    Location
    Bordeaux, France
    Posts
    2,855
    Quote Originally Posted by TrevorC2 View Post
    1) Use the DLL. With this I can already open the com port in the DLL but I’m unsure where to put the code to continually read com port data (and parse it)
    2) When using Windows form application and I can pretty much do everything I need from the Com port point of view, but can I add the RRSDK interface and then embed the application?

    metod 1):
    into your dll, just build a function that parse your data and use a timer for read them each n seconds!
    youcan launch your timer into the Initialise function:
    dedine your timer:
    Public WithEvents RefreshInfo As Timer
    initiate your timer:
    '************************************************* ****************
    '* This sub is called immediatly after plugin is loaded and
    '* enabled, its only called once.
    '* pluginDataPath = contains where the plugin should store any of
    '* its WRITEABLE\SETTINGS data to.
    '*
    '* NOTE: The plugin is required to create this directory if needed.
    '*
    '************************************************* ****************
    Public Sub Initialize(ByRef pluginDataPath As String)

    On Error Resume Next

    ' pluginDataPath will contain a USER Profile (my documents) folder path
    ' suitable for storing WRITEABLE settings to
    ' this would make your plugin OS compliant (VISTA and onward)
    ' not to mention, its proper programming, user data should NOT be stored in "Program Files"
    '
    ' example (typical vista): "C:\Users\Username\Documents\RideRunner\Plugins\My Plugin\"
    '
    ' App.path will be the path of the ACTUALL LOADED .dll (not recomend for any writes)
    '
    ' uncomment code below if u need the directory
    '

    If Directory.Exists(pluginDataPath) = False Then Directory.CreateDirectory(pluginDataPath)
    MainPath = pluginDataPath


    'Initiate a timer.
    RefreshInfo = New Timer()
    RefreshInfo.Interval = 5000
    RefreshInfo.Enabled = True
    RefreshInfo.AutoReset = True

    RefreshInfo.Start()
    and build your elapsed fonction that parse your data:
    Public Sub RefreshInfo_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles RefreshInfo.Elapsed

    '... your code

    End Sub
    method 2):
    and in you .exe just add this !
    If SDK.Created = False Then
    SDK.SetSDK()
    End If
    Attached Files Attached Files

  5. #5
    Low Bitrate
    Join Date
    Oct 2008
    Location
    Wiltshire, UK
    Posts
    63
    Thanks for the replies, they give me an idea of the direction I should be taking.
    I'll stick with the DLL and see where I get over the weekend.

    Trev,

  6. #6
    Confusion Master
    Auto Apps:loading...
    Enforcer's Avatar
    Join Date
    Sep 2003
    Location
    If you go down to the woods today, You're sure of
    Posts
    14,612
    As mitchjs said, don't use a timer to keep polling the com port.

    The com control will have a raise event to alert you when new data has arrived, respond to that and process the new data.

  7. #7
    Low Bitrate
    Join Date
    Oct 2008
    Location
    Wiltshire, UK
    Posts
    63
    Thanks to everyone for their replies.
    I have managed to open the com port and pass the serial info through to RR using a DLL (using events). I still have a lot of work to do coding the parsing of the CANBUS data, but the basics are all now in place.
    Considering I had never used Visual Basic 2010 express or compiled a DLL until 3 days ago. I think I have done well.

    Hopefully I should have a plugin to enable CANBUS BMW's to interface to RR very soon. In some-ways it will be similar to an OBDII plugin but will also allow the use of steering wheel buttons and access to a lot more of the BMW specific Can ID's.

    Thanks,

    Trev.

  8. #8
    Raw Wave pierrotm777's Avatar
    Join Date
    May 2008
    Location
    Bordeaux, France
    Posts
    2,855
    I should like the same thing for the MOST Audi bus :-(

Similar Threads

  1. Trouble Creating rr.ini
    By OrangeFish in forum Road Runner
    Replies: 2
    Last Post: 06-11-2008, 01:46 AM
  2. Creating Skins
    By tsteward in forum MediaCar
    Replies: 0
    Last Post: 12-06-2004, 12:31 PM
  3. Creating VIS
    By Hartlove in forum Software & Software Development
    Replies: 4
    Last Post: 02-02-2004, 09:21 PM
  4. Creating ME Skin???
    By tilezzzzz in forum ME Archive
    Replies: 0
    Last Post: 06-23-2003, 02:29 AM
  5. Plugin's
    By acid in forum Software & Software Development
    Replies: 2
    Last Post: 09-21-1999, 07:16 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •