||Trinamic Discussion Groups
For quick support, please browse or search the forum!
|Rajesh Kakde (TRINAMIC)
Joined: 20 Jul 2006
|Posted: Thu Jul 27, 2006 11:51 am Post subject: C++ programming option
|Currently TMCM module does not work with userís free C language.
If user wants to program TMCM module, then they need to get motion controller libraries. Is it possible that Trinamic could provide a setup/IDE wherein users can use C/ C++ to program the modules?
|Rajesh Kakde (TRINAMIC)
Joined: 20 Jul 2006
|Posted: Thu Jul 27, 2006 11:52 am Post subject:
|Currently the TMCL IDE does not support this feature. But we are considering to include such a feature in future releases of our software.
Joined: 06 Nov 2006
|Posted: Mon Nov 06, 2006 11:52 pm Post subject: TMCL DLL
|Do you mean programming in C++ for the microprocessor of a Trinamic module?
Or do you mean working with TMCL in C++?
For TMCL with C++ I have a solution.
It is also usable in Visual Basic, LabView, MatLab and other environments, which can connect to a DLL directly.
I developed a TMCL interface software.
Its code name is "TMCM-DLL" (subject to change).
It is a Windows program.
But I can rewrite the code for Unix/Linux too (given some time) .
I finished the EXE and the DLL parts of TMCM-DLL back in September of 2007.
Explanation of the progress of my work on the DLL is in this post:
Among other things, there I explain that Trinamic also offers several DLLs for RS232, RS485, and USB. They call them a "wrapper DLL".
Trinamic offers "wrappers" free of charge.
I offer my software TMCM-DLL for a one time fee (see below).
I may bundle it for my regular customers, who buy various hardware from me. I am a Systems Integrator, and a Distributor of Trinamic.
Here is a comparison of TMCM-DLL to other software:
I discuss more differences in many paragraphs below.
- TMCL-IDE is similar to my TMCM-DLL in that both are development environments.
The difference is that The TMCL-IDE is passive. It simply sends commands passively. It does not control the program flow.
TMCM-DLL is active. It is a development environment. You may prototype not only for a TMC module, but also for a host (PC, or any other device). It does control the program flow. It allows programming, troubleshooting, profiling - all directly within it. It provides programmatic access to its functionality (DLL).
The TMCM-DLL does not have a Stall Guard Profiler. It does not have a Wave Table Editor. But it has more of other features - that is what it was actually developed for. Yet in the future it might have the mentioned features as well... Advanced of course - not a mere duplicate.
- TMCL wrapper DLL. Available free from trinamic.
A wrapper is what the name suggests - it simply wraps a system call into a function call. So you are able to replace 5 lines of code with just 1. This suggests that a wrapper is a very basic library. It still requires lots of programming effort from you. You spend just the same, or even greater amount of time.
TMCM-DLL is far greater in complexity. This does not mean it is difficult to use. Of course it does offer "TMCL wrapping" for those who wish to use it. But it also provides a whole development environment, and programmatic access to it.
TMCM-DLL is not a fixed software.
I can promptly extend and reshape it (do custom programming).
The more custom funcions (your code) you get integrated directly within TMCM-DLL, the better your system works, and the easier is your own task. Also the cost is less, because a custom function is available for a subscribtion fee, rather than for a real cost of development. It would be available to all other subscribers. It would be flexible enough for many applications - not just yours.
TMCM-DLL is far easier than TMCL-IDE in controlling the module, and its parameters. It accepts binary and text TMCL programs. In the future it even might interpret C++, or at least some operators.
The TMCM-DLL allows more sophisticated manipulation of parameters, learning, programming, and a bit of automation (special macros). It is stable.
Using my TMCM-DLL, you can prototype the direct mode code for any compiler... And for any system - Not just a PC.
When done, then you simply port the code of direct mode.
The standalone code is ready as is.
The name "TMCM-DLL" is general. Actually the package would contain various solutions for various software, and operating systems.
It exists in three versions:
All three types are essentially the same software. Just the mode of access is different.
- An executable (EXE). Runs a Graphical User Interface (GUI).
- A programming (library (DLL). Also includes access to development environment in the GUI. Many software packages can attach to a DLL directly. Examples are: C++, Visual Basic (a separate one, or bundled with office programs), MathLab, LabView.
- Custom programming. This is the most flexible version. I can do custom programming in all the mentioned environments: Visual Basic, LabView, MatLab. Other environments too...
In the future I plan additional modes. For example a background batch (silent) program.
A library (in Windows - a Dynamic Link Library, or DLL) is a software, which you can call directly from your program, and which acts as part of your program like a function. Or rather a collection of functions - a library.
For example, a call to its function would look like this:
The TMCM-DLL is not limited to TMCL proper. It already has some advanced functions.
It is a development environment. It is programmable (TMCL with Macros). So it can substitute your own program.
My program brings up a Window, which allows you to manipulate the Module quite quickly, and I hope intuitively.
The essence of TMCM-DLL is that it is not a fixed piece of code. I can easily add any function (custom programming).
So there's no real need to reinvent the wheel. I spent about 2 years on this project.
You would be mad to go through the same pain.
Now it works quite well.
TMCL language is really simple. But the construct, needed to build on it, is very complex.
What custom tasks can it achieve?
Here is a non exhaustive list of such tasks:
Perhaps such features might allow to use this software in a form of EXE, without the need for DLL at all. Remember that TMCL with Macros transforms the TMCM-DLL software, as if it was your own software. You can program in it directly.
- File feed. You may feed files of data into your TMCL code, and into a TMC module.
For example you can send to a module large amounts of data serially from a file, using 1 coordinate buffer in the module (see description of command SCO in TMCL Reference).
The software may speed up the transfer by using special TMCL functions and parameters, as described in another section below.
In general the data is just a collection of any raw numbers. Usually it represents arrays of motion points for long trajectories in 3D.
The software interprets a file, and feeds it into your TMCL program. The program may then send the data to a module. But it is not required to. For example you might simply use this function to modify the code on-the-fly. So the data does not need to be a point in space.
The software can resize, or scale the raw drawing (or other kinds of data) in any direction and to any resolution of your drive.
This processing of data is not fixed, not dumb. You can control its flow by means of "TMCL with Macros" (see below). You program it similarly to ordinary other TMCL code.
A small sample code, written in the format of "TMCL with Macros" for TMCM-DLL, converts the data (the positions), and sends it to a module.
The module then produces the motion.
You, of course, can edit the sample code.
File feed provides for long trajectories of motion, while the TMCL code (with Macros) would still be very small (about a dozen commands).
This also allows an easy interface to existing software, which produces position data.
- Use undocumented or special features of TMCL.
The TMCM-DLL allows the use of items, which I mention below (the UF1, #138, and #255). They in turn allow to reduce the load of communication, and hence to increase the speed of upload of data, mentioned in previous section.
- Active Communication commands, like UF1 and #138 (Notify on arrival).
They are described here:
- Module parameters, which are not supported in TMCL-IDE currently, like global parameter #255 "suppress reply".
- "TMCL with Macros". Programming.
The TMCM-DLL software can open, display, and execute programs in the formats of "TMCL", and "TMCL with Macros". It also allows editing (programming).
The main GUI window of the TMCM-DLL software provides a compiler, and decompiler. It processes binary files, and simplified texts. "TMCL" and "TMCL with macros" formats.
The "TMCL with macros" format is my own invention. It extends the direct mode TMCL, so it becomes an active program. In many ways it substitutes the need to develop your own software.
Macros enable you to run, execute your TMCL programs on computer. This is different from TMCL-IDE, which merely sends commands in succession to a module.
You can use TMCM-DLL to write a fully fledged direct mode program. My programs can contain conditional jumps, and various functions (macros) (like the file processing described above.)
TMCM-DLL can execute a conditional jump in computer.
The TMCL-IDE cannot execute it. It simply sends the command JC to a module.
Using the TMCM-DLL, you can control the flow of a program running in direct mode. You can't do this in TMCL-IDE.
A discussion on this functionality is here:
You can troubleshoot your programs quickly. It has a timer. So you can measure duration of any operation. Minimal programming skills are required. You still need to have an idea about TMCL, and the rest of your job.
Using the development environment of TMCM-DLL, you can build whole programs ("TMCL with macros") without resorting to other compilers like Visual Basic, MatLab, C++, LabView, etc.
The GUI window is a function in itself. From the DLL inteface you simply call it via a function like:
You can also order custom extensions in order to tap into my Macros programmatically. So that your software can interact with the direct mode program while it runs in TMCM-DLL on your computer.
- Prototyping for any system. Not just a PC.
I devised an extension of TMC Language. I call it: "TMCL with Macros". (See above.) It is an automated language.
The extended "TMCL with Macros" runs on computer just as your own software would. That's why it is very suitable for prototyping.
It runs as a "direct mode" program, of course. That's as opposed to "standalone mode" in module.
As I mentioned many lines above, using my TMCM-DLL, you can even prototype direct mode code for other compilers.
You can prototype code for just any system - not just a PC. For example, for something like an "automat".
It does not matter where from the module takes its instructions eventually.
It allows to see if your chosen method does work in principle... Whether the duration of various operations is the desired time in microseconds.
All the checks are very easy, and quick.
Then you simply transfer (port) the direct part of the program into your "automat".
The standalone part would be ready as is.
When your "TMCL with macros" prototype is finished, you could do one of the following:
- Submit the prototype to me, and ask to make an equivalent function in the TMCM-DLL.
- Access the prototype programmatically by calling a DLL function, like TMCM_Run(Program).
- Port the prototype (rewrite it) entirely into another code in your own software.
- Inspection. Quick and easy:
The software displays extensive status information (errors, meaning of reply).
- module parameters (also manipulate).
- meaning of reply from module
- status of operation.
The software automatically displays help text for most commands and parameters.
- Simple configuration. The software requires virtually no configuration. It has some defaults, which a user may change later via an "*.ini" file, once one is comfortable with the software. The software easily detects a module on a port. No configuration of a port by user is necessary either.
- Custom extensions.
I can extend the EXE or DLL infinitely. Give me your feedback, and custom requests. I can customize the Graphical User Interface (GUI). I can do custom programming.
Several more advanced functions are planned. Some relate to management and maintenance of module parameters. Some would extend further the TMC Language with Macros.
For example, there is a macro, which allows to display progress information at custom points of a "TMCL with Macros" program.
If you would like to use this macro programmatically (in a DLL), I could extend it, so it reports the data to your software in any custom format. This macro could serve as a gateway between your software and TMCL programs, which it spawns (runs) on your computer in TMCM-DLL.
- DLL - the programmatic access.
Currently TMCM-DLL has 3 functions in its DLL part:
Access to other internal functions of TMCM-DLL is not implemented. I could do it in a myriad of ways. I prefer to do a custom solution, which actually works for you.
- TMCM_Dialog(ParentWindow); //calls the main GUI window (the development environment);
- TMCM_Run(Program); //Runs an entire TMCL with Macros program, which your software may construct at run time.
Please send me suggested commands, candidates for inclusion in the DLL.
The GUI window is a development environment. It provides lots of functions itself (see one of the sections above).
You may want to study the EXE part of TMCM-DLL software. Learn what it can do, and ask me to provide programmatic access to the desired functions, and put it into the "DLL part".
The following samples are available for connection to the TMCM-DLL:
Combined with my service of custom programming, it may become very flexible indeed.
The "EXE part" has the benefit that you can evaluate it without doing any programming with DLL. - Simply launch it. You opt for a DLL, only when the EXE, or custom programming cannot suit you.You of course can evaluate the DLL part as well. From your software simply call the function "TMCM_Dialog".
I can incorporate your software into mine.
Do you develop your own software?
Do you think it might be suitable to incorporate your software into mine?
It might be, if it is not too specific to one particular task?
Then provide me with an overview of the architecture of your software.
I can incorporate it in may ways: directly in code, as a DLL, or anything else...
I do not post my e-mail address publicly for various reasons.
Trinamic knows my address. You can route your mesages through them, or as a private message to me.
Please provide your e-mail address for easy communication.
Pricing, and availability.
The software TMCM-DLL is my own development. It is available only from me.
Trinamic has a copy for evaluation. But I do not have any idea if, and when they would be ready to offer it in their product range.
I also do not know what pricing Trinamic would suggest.
It is posible that the program might have some price to it. Also it might become free, or bundled.
I can't tell now. I am not in Trinamic. I am a distributor of Trinamic in my country. So, today I can't foretell what our bilateral decision would be.
Suppose there is a price to the TMCM-DLL.
Why would you have to pay extra?
Because you are going to pay for it, or for your mistakes anyway... and you pay 10 times more.
Consider this whole forum. Many users have grabbed the TMCL wrapper DLL... Just because it is free... They did not realize, that a wrapper adds almost no value. It simply wraps the Operating System. - You would better make direct system calls.
Then those users struggle daily with numerous issues. They spend countless hours in vain reinventing the wheel... and it still does not work well, and has bugs.
Is your working hour that cheap?
You save 100 Euro. But you pay 1000...
If I bundle the software wth hardware (in case you buy from me), you save nothing, and still you pay 1000.
You decline my offer of software and support... You give your money for modules to someone else...
But then you come to this forum to ask for free advice from me.
Look who is providing on this forum: only Trinamic, and me.
Look whom you bought your modules from: not from Trinamic, not from me.
Another reason why you should pay is...
Because the price would be fair.
The prices may not be fixed... They may be negotiable. At this moment you may send me privately suggestions of a price. How much you might be prepared to pay.
My suggestion would be somewhere in the region of 70-140 Euro. Actually I do have a specific price, but I would rather not publish it now. I would like to know your opinion. Some users may be prepared to pay 20 euro, some - 200, depending on their needs.
Price also could depend on the size of installation. Some would run the software just on one machine. Some - on a hundred.
My idea of an extra price is that my software is a custom solution going beyond the primary means of motion control.
The software does the job, which the user is supposed to do by oneself.
Ideally all software could be bundled with hardware. But currently the cost of its development does not fit into the price of the module...
Especially that you buy your modules from another distributor - not me. You do everything to bypass me, and to give money to someone who simply "sits" on the pile of stocked hardware, just sells it, and does essentially nothing.
If you buy hardware from me, I could indeed bundle the software.
If you buy from someone else, then they take money... - I get nothing...
There are ways to eliminate the expence and inconvenience of extra money transfer separate from the initial purchase of hardware.
You could simply buy the software TMCM-DLL in advance - with the initial purchase of hardware (a module)...
It is a subscription fee. So, the money is not lost, because you buy a custom programming service and support. - Not just the dumb software.
I usually bundle the software for a user, who buys a 10th module, and more thereafter. So, you get some money back after your 10th module anyway.
I may defer, or waive the fee.
Various deals are possible, especially if, as a Systems Integrator and distributor, I become your supplier of this and other hardware, electronics, drives, and other mechanics.
Distributor of Trinamic
Our TMCM-DLL is here (not free): http://www.trinamic.com/ttdg/viewtopic.php?t=30 | Power supplies: http://www.trinamic.com/ttdg/viewtopic.php?t=394
On request: System integration services, custom programming, mechanics,etc
||All times are GMT + 2 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Powered by phpBB © 2001, 2005 phpBB Group