Announcement

Collapse
No announcement yet.

Creating RR Plugin's. Help required

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    My Projects:-

    2010 BMW X1 install

    1955 Austin A30 install

  • #2
    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!

    Comment


    • #3
      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

      Comment


      • #4
        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

        Comment


        • #5
          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,
          My Projects:-

          2010 BMW X1 install

          1955 Austin A30 install

          Comment


          • #6
            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.

            Comment


            • #7
              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.
              My Projects:-

              2010 BMW X1 install

              1955 Austin A30 install

              Comment


              • #8
                I should like the same thing for the MOST Audi bus :-(

                Comment

                Working...
                X