I'm afraid that I am going to need to do some more research.
Please don't spend a lot of time trying to make this work. I'll take a longer look at MM.
I really appreciate all your help.
Shannon
I'm afraid that I am going to need to do some more research.
Please don't spend a lot of time trying to make this work. I'll take a longer look at MM.
I really appreciate all your help.
Shannon
I don't know if this means anything but using
KM_Controller_MainStatus instead of .KM_Controller works fine
Dim controller As KMotion_dotNet.KM_Controller_MainStatus ' .KM_Controller
Private Sub Form_Load()
Set controller = New KMotion_dotNet.KM_Controller_MainStatus ' .KM_Controller
Debug.Print controller
End Sub
Shannon,
That does not make a lot of sense.
The Main_Status class is actually of type::
KMotion_dotNet.KM_Controller.KM_Controller_MainSta tus
So in .net, that means that KM_Controller_MainStatus class is a nested class of KM_Controller in the KMotion_dotNet namespace
I have to imagine the instance you created is null yes?
-Brad Murry
Brad,
Yes, the Debug.Print controller output is as you said.
KMotion_dotNet.KM_Controller.KM_Controller_MainSta tus
I don't know if the instance is Null. This is the entire code in the project.
Dim controller As KMotion_dotNet.KM_Controller_MainStatus ' .KM_Controller
Private Sub Form_Load()
Set controller = New KMotion_dotNet.KM_Controller_MainStatus ' .KM_Controller
Debug.Print controller
End Sub
Shannon
Can you see the members available in the KMotion_dotNet.KM_Controller_MainStatus?
There should be a few methods and a couple properties.
-Brad Murry
No I see no members. I can see all the classes in the object browser but none of them have any members except KM_Token which has 3 constants.
Hello Shannon,
Maybe we can make a simple .net class lib with one class that has a method to return a cheesy string like "hello world".
By doing this we can verify that the steps I outlined from MSDN work and that we are not missing something.
From there we can take further action.
-Brad Murry
Maybe we can make a simple .net class...
Ok Brad,
I'm tied up until the weekend but will give it a try then. Tonight I am playing with MM and 3 servos on the kitchen table.
Hello Brad,
Regarding the "automation error" I was getting in vb6. I copied all the kmotion dll's to the same folder that my project is running from and I no longer get any errors in the code show below. However, no intellisense properties or methods are showing for controller.
Shannon
Dim controller As KMotion_dotNet.KM_Controller
Private Sub Form_Load()
Set controller = New KMotion_dotNet.KM_Controller
End Sub
Hello,
I posted a thread on the DynoMotion group about the possibility of a CNC-Kflop controller with an HTML user interface.
I thought I would post here as well to see if there was a broader audience than the DynoMotion Yahoo group.
I have created a prototype Windows application that can host HTML content. The application can communicate to the HTML page and the HTML can also trigger commands in the application.
Imagine just writing an HTML web page and simply by setting an element's ID it would automatically hook up to the controller.
I am trying to see if there is anyone who might fall within any of the following scenarios::
1) OEM’s or integrators here that could make use of HTML technology in lieu of Mach3 with custom screens
2) Hobbyists who are proficient in basic formatting HTML and would like to create their own custom interfaces without needing to write any code
3) Hobbyists who want to create their own interface that have no knowledge of HTML, but can use a free website designer to build a custom interface
(see Free Website Design Software)
If you fall into any of these categories or you have knowledgeable constructive criticism to offer please let me know.
-Brad Murry
Hello Shannon,
I have been playing around with accessing the .net libs via Javascript and it seems I can if I perform the following from a Visual Studios Command Prompt:
regasm KMotion_dotNet.dll /tlb:KMotion_dotNet.tlb
It regeisters the dll for COM, and you can see it in VBA when you add a reference, so it should also show up in VB6.
Regards,
Brad Murry
Hi Brad,
I appreciate you keeping me in the loop on this. I spent a fair amount of messing with regasm, regtlbv12, exptlb and thier associated paramaters etc. I just tried setting a reference in VBA and that didn't work either. I can set the reference to the tlb but in the object browser the only class I see is globals and it has no members. Your dll I'm registering is v1.0.1.0 I've tried regasm V2.0.50727.3053 and V4.0.30319.1 with the same results.
Shannon
Hi Brad,
I finally got this working. I'm not sure everything I did was or is needed but its working.
downloaded C# VS2010 free express version
Open C:\KMotion428\KMotion_dotNet\KMotion_dotNet.csproj from c#
Made the following changes to the project options:
Build Events
Pre build: "$(FrameworkSdkDir)bin\gacutil.exe" "$(TargetPath)" /u
Post build: "$(FrameworkSdkDir)bin\gacutil.exe" /i "$(TargetPath)" /f
Check 'Make assembly com visible' in assembly information
Check 'Sign the assembly' in signing
Check 'Register for com interop' in Build
Made changes to the code as follows:
Modify the classes and add
[ClassInterface(ClassInterfaceType.AutoDual)] ///without this VB will work but without intellisense.
ad this before the public partial class line as shown below.
like this:
in KM_Controller.cs
[ClassInterface(ClassInterfaceType.AutoDual)]
public partial class KM_Controller : IDisposable
in KM_CoordMotion.cs
[ClassInterface(ClassInterfaceType.AutoDual)]
public partial class KM_CoordMotion : IDisposable
in KM_Interpreter.cs
[ClassInterface(ClassInterfaceType.AutoDual)]
public partial class KM_Interpreter : IDisposable
Rebuild solution and then from a command prompt use Regasm.exe. The build will create a dll and a tlb file in C:\KMotion428\KMotion\Debug. I copied these 2 files to the Release folder and used Regasm there. You will need to locate regasm and copy it to the release folder.
Use regasm like this
C:\KMotion428\KMotion\Release\regasm KMotion_dotNet.dll /tlb:KMotion_dotNet.tlb /codebase
In VB set a reference to KMotion_dotNet.tlb and paste the following code in a form:
Dim ctrl As New KMotion_dotNet.KM_Controller
Label1.Caption = "This is the board number returned from KM_Controller: " & ctrl.BoardNumber
Label2.Caption = "This is the board number returned from KM_CoordMotion: " & ctrl.CoordMotion.BoardNumber
Label3.Caption = "This is the board number returned from KM_Interpreter: " & ctrl.Interpreter.BoardNumber
Saved this project to the C:\KMotion428\KMotion\Release folder
When I tried to run the project I was getting automation errors. I had to double click .vbp in the release folder for it to work. Some kind of a path dll not found problem I suspect.
That's all I've done at this point.
Thats funny.... looks like you've done a lot!That's all I've done at this point.
Thanks for sharing the details, it is pretty cool that you have it working.
The directory thing is a bit of a bear right now, for proto apps I just move the project output to the KMotion4xx\KMotion\Release, and for production apps I load the KMotion_dotNet.dll at runtime so I can just point to the most current DLL.
I'm not sure how to do that in vb6/COM, so you might consider just running your apps from the Dynomotion install directory.
Once you get this all dialed in would you consider adding the sample application + notes to the Dyno code base? This way other people using COM can use it too.
Thanks for the update,
Brad Murry
would you consider adding the sample application + notes to the Dyno code base?
Gladly
Hi Shannon,
Yes we would really like to include that in the Release.
If possible please make a VB6 example that is under the "
C:\KMotion429z\PC VB Examples"
directory and targets the executable to:
C:\KMotion429z\KMotion\Release
directory
It wil be included in the next release.
Thanks!
TK
TK
http://dynomotion.com