PC Example Applications

Revision as of 14:31, 17 October 2019 by Sascha F Zeller (Talk | contribs)

A number of PC Applications using the KMotion Libraries are available in the Software download.  Visual Studio should be used to modify/compile the applications.  Currently the projects are compatible with VS 2008 Standard but later Versions can upgrade the projects and can be used including the free Microsoft Version of VS 2013 Community.  In some cases MFC capability needs to be added as a separate download.


Note All the projects in KMotion Versions 4.34a and later have now been updated and should work out-of-the-box with VS2015.

Link to the Microsoft Free Visual Studio 2015 Community Version

When installing make sure options for C++ and MFC are enabled.

The Install Root directory contains a VS Solution BuildAllLibs.sln to build the KMotion Libraries.

The VS Solution \PC VC Examples\BuildExamples.sln will build most all of the Examples 


MFC C++ Examples - \PC VC Examples

  • KMotionCNC - CNC Application for controlling Mill/Router/Lathe etc
  • Download Waveform - simple example to download some data to the gather buffer
  • SimpleCoffload - simple example to compile/download a C Program to KFLOP
  • SimpleConsole - simple example to send Console Script commands to KFLOP
  • SimpleCoordMotion - simple example of creating coordinated motion paths in KFLOP
  • SimpleGCode - simple example to execute a GCode File


C# Examples - \PC VC Examples

  • KFlopWebNC - HTML CNC based App interfacing to KMotion Libraries
  • KMotion_dotNet Console - Windows Console App using .NET Library Interface
  • MeasureFiducials - Video Alignment Application to measure fiducial alignment marks and map coordinate space
  • SimpleFormsCS - Simple Windows C# Forms App includes USB speed test
  • TeachMotion - App for use with Lathe Spinners to teach Spinning motion and create GCode


Visual Basic Examples \PC VB Examples

  • DynoMotion VB.net - Demonstrates Coordinated motion, GCode Execution, Status, etc...
  • Jogger - Simple VB6 App to Jog Axes
  • Jogger.NET - simple VB .NET App to Jog Axes


LabView Examples \PC LabView Examples

  • Kmotion DotNet DLL Sample.vi - Simple GUI to Jog, Display Readout, Execute C Programs, Console messages


Iron Python Examples \PC Python Examples

  • OnOffWPF.sln - Demonstrates Bit Commands to KFLOP with WPF GUI


Installing your PC Application on a Target System

A number of KMotion DLLs EXEs and Data files in an expected structure are required for your application to run.  The Simplest solution is to install KMotion on the target system and place your executable in the \KMotion\Release Directory.  Otherwise you will need to include all the files referenced directly or indirectly by your application.


Here is a relevant thread from our forum:

KFlop and dotnet dependencies....

Quote:

The cleanest way of sandboxing a KFlop DotNet application seems to be this:

1-Create a new DotNet Solution/Project and set the Project/Properties for the following

Set the Debug Configuration's Build output path = bin\Debug1    (This can be anything except a folder named "Debug" or "Release")
Set the Release Configuration's Build output path = bin\Release1 (This can be anything except a folder named "Debug" or "Release")

2-Into your newly created Debug1 or Release1 folder(s), copy the appropriate debug or release versions of the following from the KMotion/Debug|Release folder:

KMotionDLL.dll
KMotion_dotNet.dll
KMotion_dotNet_Interop.dll
GCodeInterpreter.dll
KMotionServer.exe
TCC67.exe

3-Copy the folder DSP_KFLOP and it's contents into both the Debug1 and Release1 folders.

Why it works: By using names other than "Debug" and "Release" for the application container folders we prevent the KMotionDLL from looking for a parent folder containing the KFLOP headers and compiles. This causes KMotionDLL to look in the current apppath (whichhappens to be where everything else is as well) for the DSP_KFLOP folder.

At any point in the future, the Debug1 or Release1 container folders can be renamed with their app's name (or anything else other than the words Debug or Release) and moved, copied and the dotnet application within should continue to run without issue.

Last modified on 17 October 2019, at 14:31