08-19-2014 05:07 AM - edited 08-19-2014 05:07 AM
Hi,
I investigate 3D printers and use de open source software slic3r to slice my stl files.
But i want to integrate this software in a vi in labview so that i can control the software from the vi itselfs.
Do anybody know how i can do this?
08-19-2014 07:42 AM
08-20-2014 06:45 AM
still i don't have any idea how to do this...
from this site i get de code https://github.com/alexrj/Slic3r
but i don't know which files i have to use...
08-20-2014 07:23 AM - edited 08-20-2014 07:24 AM
My first thought is that you're in over your head. How much LabVIEW experience do you have? Have you done any work using external libraries in LabVIEW? Forgive me if this comes off as offensive, I certainly don't mean to insult your abilities but you haven't offered much information. Perhaps, show what you're trying to do and what you've done so far?
08-20-2014 09:39 AM
08-20-2014 09:41 AM - edited 08-20-2014 09:43 AM
Are you able to program C and C++ in at least intermediate mode? The core slic3r library is a C++ library. Interfacing c++ directly to LabVIEW is not an option since there is no standard ABI definition for C++ that would be used by all different C++ compilers out there. Specifically MS VC and GCC do create completely incompatible ABI interfaces, and even if you use MinGW, which supposedly tries to be binary compatible to MS VisualC you ran into many troubles especially in C++ ABI compatibility.
So with direct C++ interfacing out of question you have basically two options:
1) Write a C wrapper DLL for the C++ library that exports global standard C functions for every object method that you want to access from LabVIEW. The first parameter of all these functions is the actual object pointer and all successive parameters of the method follow.
2) If this is for MS Windows only you could try to create an ActiveX or .Net wrapper for your C++ library. There are supposedly tools that help you automate much of the task to turn a C++ API into an Active X or .Net interface but I have never tried this nor do I know how well those tools work. I would expect some bumps on the road if you follow this path.
Bottomline is: If you don't know much about C and C++ programming and compiling, this is not likely a project you will ever finish in any way and if you know about it, it's going to be a major work to do anyways.
If you want to integrate the actual GUI application itself, you should probably follow the advice from Dennis. That is most likely the easiest solution, unless the slic3r application supports some exhaustive inter application communication interface.
08-20-2014 11:43 AM
@rolfk wrote:
Are you able to program C and C++ in at least intermediate mode? The core slic3r library is a C++ library. Interfacing c++ directly to LabVIEW is not an option since there is no standard ABI definition for C++ that would be used by all different C++ compilers out there. Specifically MS VC and GCC do create completely incompatible ABI interfaces, and even if you use MinGW, which supposedly tries to be binary compatible to MS VisualC you ran into many troubles especially in C++ ABI compatibility.[...]
Now we're in over my head.