09-02-2009 04:15 PM
I've written some c code to control X,Y scanning mirrors (generating output identical to this, but with triangle waves), but I don't know how to go about integrating it into labview or with the DAQ. This will end up being it's own SubVI, but I dont know if/how you can incrementally run a for loop and spit out single variables per iteration.
Can I run the c code within labview to produce an (X,Y) voltage pair to control the mirrors?
Do I need to save the output to a file and read from the file?
Any tips or links are appreciated.
-jm
09-02-2009 05:33 PM
You can compile your C code into a DLL and then you can call it from LabVIEW using Call Library Function Node. There's a section in the LabVIEW Help on calling code from text-based languages. There are also examples that ship with LabVIEW. The "Call DLL" example (search for "dll" in the Example Finder) is a convenient shell that allows you to open each example.
Are you sure you can't do the same thing your C code does in LabVIEW?
09-03-2009 07:19 AM
I am sure that I can (and in fact this is what I am trying to emulate - except adding a "Triangle wave" in Y to control two stepping mirrors).
For me, this behavior is a lot easier to achieve as a handful of for-loops in C. For some reason, I have a difficult time making the jump to writing the same functionality in labview. Even with the above VI in hand, I'm having a hard time seeing where to revise it to acheive my goals.
If some kind soul would like to help, it would be greatly appreciated!
09-03-2009 08:45 AM
09-03-2009 09:03 AM
09-03-2009 09:49 AM
09-03-2009 10:07 AM