DynoMotion .Net


Page 1 of 2 12 LastLast
Results 1 to 20 of 38

Thread: DynoMotion .Net

  1. #1
    Member bradodarb's Avatar
    Join Date
    Oct 2004
    Location
    usa
    Posts
    147
    Downloads
    0
    Uploads
    0

    Default DynoMotion .Net

    Whether a simple plugin or a full blown custom application, accessing the DynoMotion hardware from .Net makes devlopment a breeze.

    Discuss using the API for custom automation projects as well as CNC applications.... or just general DynoMotion.net API questions.

    -Brad

    Similar Threads:
    Last edited by bradodarb; 12-04-2011 at 08:53 PM.


  2. #2
    Registered
    Join Date
    Mar 2007
    Location
    US
    Posts
    217
    Downloads
    0
    Uploads
    0

    Default

    hehe, ok, (redundant) does it work in VB6?

    (NO) lmao. OK, I need to go learn dotNET, but....

    I am 50 years old and have been programming in BASIC since the VERY early days. Enter WinBlows 95, and I have to "learn" VB1.X..... Ok, I made it all the way to VB6, then, quite honestly, I got too damn old to re-write everything again. (You can say it "easily ports", but that is a LIE for my POS system that is 95% of what I write code for and is 20k+ lines long and uses the old ODBC interface to an Access 95 DB.) I am NOT saying dotNET isn't better, just NOT worth MY effort, nor worth me paying for. So I have a licensed copy of VB6, lots of skills/code libraries in VB6, but NO real desire to purchase VS.NET to develop open source apps to promote somebody else's products (obviously I have a "copy", but NO desire to develop anything public from a "shareware" install.) I have NO C skills nor knowledge, and VB6 isn't "supported" by dynomotion .... and the "example App" for VB.Net doesn't work on my PC.....as the self-appointed KFlop #1 fan, I am more than a bit disappointed (CERTAINLY NOT YOUR FAULT, and the performance of the KFlop is STILL FABULOUS, no complaints there); my main goal is to make the KFlop and other family products more accessible to hobbyist, but it APPEARS I need to do that w/o access to the API Calls to the KMotion.DLL from VB6. Darn, Lol. If there is ANYTHING you can do to make the DLL available to me via VB6 I promise I will make some trivial, but very user friendly, user apps for the KFlop.

    please

    Fish



  3. #3
    Member bradodarb's Avatar
    Join Date
    Oct 2004
    Location
    usa
    Posts
    147
    Downloads
    0
    Uploads
    0

    Default COM Interop

    Hello Fish,


    I am not quite the same vintage, but I started early too. From manipulating sprites on my TRS80 then Commodore64.... 8086 thru 486 though I did not get access to VS until VB3. Then came the days of creating my data access layers in c/c++ then whipping out quick UI's with VB6.. it was magic at the time.

    Throughout the past decade I have come to terms that there is nothing that can be said or done to convert certain VB6'ers over to .net. There seems to be a few that are loyal almost to the point of religion. And why not, VB6 is a poweful tool and as you said you have developed much skill and many libraries using it. I am in no way bashing it, just noting I understand what you are saying and I know better than to argue with a devout VB6 person.


    On the opposite end of that spectrum, you have people who need to try the newest frameworks and api's and re-write perfectly working code just to see if they can make it better. And the worst of it is that they keep doing it no matter how many times it bites them in the backside.

    Unfortunatley, people like that come along and build a tool you want to use -but its in a newer technology.


    This is where Microsoft should be praised for being the king of taking care of their developer pool.


    If you open BuildAllLibs.sln in VS2008 express, right click on the KMotion_dotNet project and select Properties....


    On the Build Tab at the bottom you will see a checkbox that says "Register for COM Interop"

    Click this and rebuild the solution. VS has now created all the TypeDefinitions for you to access it in VB6!


    Check out this KB for details::

    How to call a Visual Basic .NET or Visual Basic 2005 assembly from Visual Basic 6.0


    __________________________________________________ __________

    Some extra steps will need to be taken if you want to use the api's on machines without VS.

    If you plan to deploy things created this way you shoould read this post::

    Use .Net created dll in VB6?



    Good luck and enjoy,

    -Brad Murry



  4. #4
    Member bradodarb's Avatar
    Join Date
    Oct 2004
    Location
    usa
    Posts
    147
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by Fish4Fun View Post
    .... and the "example App" for VB.Net doesn't work on my PC.....


    I would like to hear more about this issue if you dont mind. What versions of .net do you have installed under your OS?

    -Brad



  5. #5
    Registered
    Join Date
    Mar 2007
    Location
    US
    Posts
    217
    Downloads
    0
    Uploads
    0

    Default

    Sorry, we had a couple of beautiful weather days and I took the time to get some "outside projects" closer to completion :-)

    For better or worse, I installed VS 2010. The .net framework I upgraded from MS, so I would guess it is the latest: dotNetFx40_Full_setup.exe

    When I said: "....'the example' App for VB.Net doesn't work on my PC..." I simply meant I opened it using VS10, and VS10 reported that the code was for a previous version of VS, and would need to be "converted". After the conversion, I attempted to "debug it" (run it), and there were something like 140 warnings/errors, all seemed to be in relation to the the DLL references. I did not pursue it any further, but opened the "jogger app" and went through the same process, except it ran w/o errors/warnings after being "converted".

    I will likely need to take a few days (weeks, months???) to familiarize myself with VS.net before I can even give you reliable feedback on what is going on. It may all be "working fine" and I am just too dumb to know it, lol. I am certainly not a programmer by trade or training, but more out of simple necessity. When I first wrote my POS system in the mid 80's, there wasn't a PC based POS available/affordable/flexible enough. By the time POS systems became available/affordable/flexible enough, I already had one written that all my employees were trained to use. The last "major revision" wrt the "counter sales" portion of the application was over 10 years ago, but I am constantly adding "features" to make MY life easier. All of that is to say, I really am "one of those guys stuck in VB6", opening a "solution" in VS10 was like wandering through an alien world.

    I look forward to giving MM3 a try, you obviously have dedicated a great deal of effort to it and I am confident it will have some amazing features!

    Fish



  6. #6
    Member bradodarb's Avatar
    Join Date
    Oct 2004
    Location
    usa
    Posts
    147
    Downloads
    0
    Uploads
    0

    Default

    I see... Well again I'm not bashing the VB6.


    Are you able to run the VB.net example's .exe file I wonder?

    There have been some build version conflicts with the .net interop stuff vs the latest Kmotion builds, so that may be part of it.


    I will try to repeat your steps and see how it works, to be honest I have not tried to debug that example since it was assimilated into DynoMotion's code base.


    Thanks for the feedback.

    -Brad Murry



  7. #7
    Registered
    Join Date
    Jan 2012
    Location
    us
    Posts
    33
    Downloads
    0
    Uploads
    0

    Default

    I too am a 50+ vb6 guy and long time Galil user. Stumbled on Dynomotion, immediately bought a Kflop, Kanalog and a Snapamp. Like Fish, I love the product but am frustrated that I can't use it with vb6. I emailed TK and he replied right away that vb6 isn't supported. OK that's fine, I understand, but I still want to make it work in vb6.

    I did eventually get the jogger app to work by simply copying all the kmotion dll's to the jogger folder. So now I can at least control motors with vb6 and there is renewed hope. I've read/skimmed all the help files, and spent many hours trying to figure out how to get either GCodeInterpreter.dll or the Coordinated Motion Buffer to work in vb6. Found this thread and Brad,s "Register for COM Interop" suggestion, but couldn't get it to work in VS2008 or VS2010. C:\KMotion428\KMotion_dotNet\KMotion_dotNet.csproj cannot be opened because its project type (.csproj) is not supported by this version...

    Any suggestions?

    Shannon



  8. #8
    Member bradodarb's Avatar
    Join Date
    Oct 2004
    Location
    usa
    Posts
    147
    Downloads
    0
    Uploads
    0

    Default

    Hello Shannon,

    Just so I am clear, you are trying to open the project KMotion_dotNET in VS2008 or VS2010 and it will not let you open it?

    I cannot imagine why that would be the case.

    -Brad



  9. #9
    Registered
    Join Date
    Jan 2012
    Location
    us
    Posts
    33
    Downloads
    0
    Uploads
    0

    Default

    Hi Brad
    Yes, that's correct. I get the error when I open BuildAllLibs.sln. I was trying to follow your "create all the TypeDefinitions for access in VB6". I notice there is no .vcproj in C:\KMotion427\KMotion_dotNet only .csproj. I looked for a way to convert the C# csproj but came up empty. I tried regasm.exe but that didn't work either. Is that the problem?

    Thanks for your help,
    Shannon



  10. #10
    Member bradodarb's Avatar
    Join Date
    Oct 2004
    Location
    usa
    Posts
    147
    Downloads
    0
    Uploads
    0

    Default

    Hello Shannon,

    It sounds like maybe you were opening BuildAllLibs in VS2008/2010 c++ express version.

    If this is the case, try downloading the VS2008 c# express and only open the KMotion_dotNET project insted of the entire solution.



    -Brad Murry



  11. #11
    Registered
    Join Date
    Jan 2012
    Location
    us
    Posts
    33
    Downloads
    0
    Uploads
    0

    Default

    Hi Brad,
    I did as you suggested and was able to build kmotion_dotnet in C# without errors. Ultimately it did me no good. ...or maybe it did? I guess the problem is that I really don't know what I'm doing. I added __stdcall to the functions as I saw done in kmviavb but then was unable to build. Even if I do get it to work I have not been able to find any documentation on the coord motion, gcode functions usage .

    I have kmviavb.dll and it works so I can do pretty much everything I can do with Galil (except upload C programs, KMViaVB_LoadCoff doesn't work) but, I'd sure like to be able to use GCode and Trajectory Planner. I downloaded your MM III and installed it and it worked great. Very nice program! Unfortunaltely it won't work well in our (rockofages.com) manufacturing plant. We have many machines that integrate Motion control, PLC's, cad and barcode for job setup. These are all wrapped and intermingled in a custom HMI written in VB6. If you know anyone, I'm happy to pay to help me make this work in VB6.

    Shannon



  12. #12
    Member bradodarb's Avatar
    Join Date
    Oct 2004
    Location
    usa
    Posts
    147
    Downloads
    0
    Uploads
    0

    Default KM.net in vb6

    Hello Shannon,

    I would like to help you get vb6 working and I think we can do it pretty easily.

    You do not need to add the __stdcall in the c# libs. You literally only need to check a single checkbox.


    Follow these steps::
    1) Open KMotion_dotNET project in VS

    2) Edit the project properties(see pic # 1)

    3) Click the Register for COM Interop checkbox on the Build Tab(see pic #2)

    4) Rebuild All


    At this point the DLL should be ready to use in VB6 and the TypeDefinitions have been generated. The DLL should also now be registered in the GAC for use with COM
    ***(note that you will need to manually regisiter the dll on other computers that you did not perfrom the above steps with, though it is easy with one command line)

    5) Start Visual Basic 6.0.
    6) On the File menu, click New Project, and then click to select Standard EXE in the New Project dialog box.

    By default, a form that is named Form1 is created.
    7) On the Project menu, click References.
    8) In the Available References list, double-click to select KMotion_dotNet, and then click OK.


    In your form's loaded event add the following code

    Dim _Controller As KMotion_dotNet.KM_Controller
    Set _Controller = New KMotion_dotNet.KM_Controller


    Obviously, you should move the Dim statement to place the variable in theright scope for your use, but now you have access to all the goodies.

    Please follow these steps and let me know how it worked out.

    -Brad Murry



    -Brad Murry

    Attached Thumbnails Attached Thumbnails DynoMotion .Net-edit-kmotion_dotnet-properties-png   DynoMotion .Net-set-kmotion_dotnet-com-interop-png  


  13. #13
    Member bradodarb's Avatar
    Join Date
    Oct 2004
    Location
    usa
    Posts
    147
    Downloads
    0
    Uploads
    0

    Default Machine Manager

    Hello Shannon,

    I also wanted to follow up with your testing of Machine Manager.

    Galil is on the list of devices to support, and general automation processes are being developed right now.

    Would you mind explaining why MM would not work for your application? This could help drive development efforts to make it more flexible.


    Thank you,
    Brad Murry



  14. #14
    Registered
    Join Date
    Jan 2012
    Location
    us
    Posts
    33
    Downloads
    0
    Uploads
    0

    Default

    Hi Brad,

    Many of our HMI's have an embedded cad engine, VectorDraw Drawing components 3D and 2D ActiveX CAD CAM, that I use for 3d graphics and some math. The operator will scan a barcode and the job data will be sent to the cad engine where the operator will inspect and possibly modify the lines and arcs. After he is satisfied a dxf file will be created and another utillity extracts the vector data and sends it to the Galil. All have an automation direct PLC with ethernet interface and a Galil with Ethernet interface. The PLC controls and monitors safety devices, motor starters, process variables etc.. Some of the machines run several days on a single job without stopping and when there is a problem the PC calls or emails the operator.

    After writing this and giving it more thought, I suppose MM would work although it would take a fair amount of rewriting my vb code. We have some tools like a laser etcher and stencil cutters that it would work as is on. Can MM be used without an interface? How much are you going to charge for it?

    Shannon



  15. #15
    Registered
    Join Date
    Jan 2012
    Location
    us
    Posts
    33
    Downloads
    0
    Uploads
    0

    Default

    Thanks for the quick and thorough response Brad,
    Most of the questions below are now mute. I had to set check "make assembly com-visible" under assembly information in the *application tab. the intellisense is working and I can see all the functions but when I try to run I get a run time "Automation error". on Set controller = New KMotion_dotNet.KM_Controller. I'll try to find the problem.

    RESOLVED:
    I followed the steps and everything went fine until here: Dim Controller As ... the intellisense in VB is not finding KMotion_dotNet. I was able to set a reference to the KMotion_dotNet.tlb without issue. I have written DLL's in VB and am familiar with how to reference. If I use "Dim Controller As KMotion_dotNet.KM_Controller" anyway and try to compile I get an error "User Defined Type not Defined". I tried manually registering and I get an error that says dll loaded but no dllregisterserver entry point was found. In the C# Build, I tried setting configuration to release (it was set to debug by default) but got the same errors. BTW, I get no errors in the build and am using 2010 express. I did get 78 Warning 2 Missing XML comment for publicly visible type or member 'KMotion_dotNet.KM_Controller.KM_Controller_MainSt atus.IsVersionAndSizeValid' C:\KMotion428\KMotion_dotNet\DM Controller\KM_Controller_MainStatus.cs 12 26 KMotion_dotNet

    Shannon

    Last edited by sdavenport; 01-08-2012 at 07:22 PM.


  16. #16
    Member bradodarb's Avatar
    Join Date
    Oct 2004
    Location
    usa
    Posts
    147
    Downloads
    0
    Uploads
    0

    Default

    Hello Shanon,

    I replied to your MM related quesitons here::

    http://www.cnczone.com/forums/1047241-post39.html

    To keep things tidy


    -Brad Murry



  17. #17
    Member bradodarb's Avatar
    Join Date
    Oct 2004
    Location
    usa
    Posts
    147
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by sdavenport View Post
    Thanks for the quick and thorough response Brad,
    Most of the questions below are now mute. I had to set check "make assembly com-visible" under assembly information in the *application tab. the intellisense is working and I can see all the functions but when I try to run I get a run time "Automation error". on Set controller = New KMotion_dotNet.KM_Controller. I'll try to find the problem.

    RESOLVED:
    I followed the steps and everything went fine until here: Dim Controller As ... the intellisense in VB is not finding KMotion_dotNet. I was able to set a reference to the KMotion_dotNet.tlb without issue. I have written DLL's in VB and am familiar with how to reference. If I use "Dim Controller As KMotion_dotNet.KM_Controller" anyway and try to compile I get an error "User Defined Type not Defined". I tried manually registering and I get an error that says dll loaded but no dllregisterserver entry point was found. In the C# Build, I tried setting configuration to release (it was set to debug by default) but got the same errors. BTW, I get no errors in the build and am using 2010 express. I did get 78 Warning 2 Missing XML comment for publicly visible type or member 'KMotion_dotNet.KM_Controller.KM_Controller_MainSt atus.IsVersionAndSizeValid' C:\KMotion428\KMotion_dotNet\DM Controller\KM_Controller_MainStatus.cs 12 26 KMotion_dotNet

    Shannon
    If I could get my hands on a legal copy of VS6 I would make this happen....

    The KM_Controller should be available as it has a default parameterless constructor.

    I'm afraid that I am going to need to do some more research. I will post back as soon as I find something.

    In the mean time, I wonder how much effort it would be to skip the com exposed .net dll and just use the KMotion_dotNet_Interop dll that I created for use for the .net dll. It has all the methods labled for extern __stdcall
    so they should be accessible. Can you try that?

    Good luck,
    -Brad Murry



  18. #18
    Registered
    Join Date
    Jan 2012
    Location
    us
    Posts
    33
    Downloads
    0
    Uploads
    0

    Default

    In the mean time, I wonder how much effort it would be to skip the com exposed .net dll and just use the KMotion_dotNet_Interop dll that I created for use for the .net dll. It has all the methods labled for extern __stdcall
    so they should be accessible. Can you try that?


    I'll try it and let you know,
    Thanks again,
    Shannon



  19. #19
    Registered
    Join Date
    Jan 2012
    Location
    us
    Posts
    33
    Downloads
    0
    Uploads
    0

    Default

    It has all the methods labled for extern __stdcall
    so they should be accessible. Can you try that?


    I tried it and when I call a function I get a "Can't find entry point" error.



  20. #20
    Member bradodarb's Avatar
    Join Date
    Oct 2004
    Location
    usa
    Posts
    147
    Downloads
    0
    Uploads
    0

    Default

    grrr.......


    OK Shannon, thanks for the effort.

    Give me a little time and we will figure this out, there is no reason it should not work. I'm sure we are just missing some small implementation detail.

    In the mean time, there is always .net.......

    (just jerking your chain)

    -Brad Murry



Page 1 of 2 12 LastLast

Posting Permissions

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


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

DynoMotion .Net

DynoMotion .Net