04-25-2013 03:30 PM
i am trying to make a delta robot. i used a c code for the kinematics of the robot and created a dll file to use in labview. i found the c code online http://forums.trossenrobotics.com/tutorials/introduction-129/delta-robot-kinematics-3276/.
i have attached the VI and also the c file i am using.
but it doesnt work. the servos dont move and the program gives an error. i have attached the necessary files. i do not have any experience with calling function node and i know i am doing something wrong but i cam completely stuck.
can someone tell me what to do?
how can i correctly implement the function node.
when i used a similar arduino code(from trossen robotics), it worked perfectly. but with labview i am not getting anywhere.
thanks
04-25-2013 04:04 PM
You got it backword.
You should define IO in LabVIEW, wire to the CLFN.
Right click on it to generate a c prototype.
Finish the c code, and compile it into a dll.
Load the dll into LabVIEW.
04-26-2013 03:51 AM
could you elaborate more.
I right clicked on CLFN to 'create a c file', But when i load my code in it and build it, it gives error. and then how will i convert it into a dll file.
why is doing it this way necessary?
04-26-2013 07:00 PM
> why is doing it this way necessary?
To make sure data pass from LabVIEW to dll correctly.
> how will i convert it into a dll file.
Create a project in your C compiler, build into a dll.
How did you do it before?
04-29-2013 12:13 PM
this is how i followed your instrucions:
1- i created a CLFN block diagram
1a- double clicked it to add library path.
i used the dll file i had alreay created from 'inverseKinematics.cpp' so i could select the function for each CLFN i have in the VI.
2- defined input, output
3- right clicked it, then clicked on 'Create C File', saved it as code.c
4- opened 'code.c' in visual sudio
5- copied one function from inverseKinematics.cpp into it and saved it.
6. but now it does not give me an option to build it into a dll file. so thats where i got stuck
i have attached the VI, code.c my C program
04-29-2013 02:32 PM - edited 04-29-2013 02:32 PM
These are just general mathematic calculations that can be very easily recreated in LabVIEW, either with LabVIEW primitives on the diagram or with mostly copy and past in the script node or mathscript node.
That's definitely an order of magnitude less complicated than trying to get a DLL compiled without any formal C programming knowledge.
04-29-2013 05:13 PM
Sounds like you don't know how to use Visual Studio.
Before you load code.c into Visual Studio, you should create a PROJECT in Visual Studio for build dll.
Since you're not family with Visual Studeo, you should try Rolf's idea.
04-29-2013 05:29 PM
i have already done it using math script node. that was never the issue. i am just trying to use different techniques to solve one problem. its a requirement of our project, thats why i am experimenting with all this. i agree i am not exactly familiar with visual studio.
i will try creating a project and then loading code.c in it. hope it works..thank you for the guidance .. but besides this fault, is their any other fault in the steps i described earlier.
04-30-2013 02:25 PM - edited 04-30-2013 02:29 PM
@zee20 wrote:
i will try creating a project and then loading code.c in it. hope it works..thank you for the guidance .. but besides this fault, is their any other fault in the steps i described earlier.
I didn't check the entire code, as I consider that a useless exercise considering that the mathscript node allows to do the same without C difficluties. But I noticed at least one more fundamental error as you can not pass back results in parameters passed by value, only when they are passed by reference. If those terms don't mean anything to you then you should really stop trying to do a DLL.