08-13-2012 09:28 AM
Hi,
I have a C program meant to allow for acceleration of a stepper motor - it's in C, but I need to convert it to Labview to run it on my DAQ. Could someone help me convert it or show me what I would have to do?
I'm new to Labview, so any help would be much appreciated.
Thanks a lot!
08-13-2012 10:44 AM
Did you write this C program, or are you intimately familiar with what the C program does?
I would suggest starting by writing a flow chart or some kind of state chart that describes what the program does, etc..
08-13-2012 11:07 AM - edited 08-13-2012 11:09 AM
Nobody wants to convert a long C program into LabVIEW. (... and google translate cannot do it yet :D)
Instead, tell us exactly what the program is supposed to do, and we can give hints how to implement it in LabVIEW from scratch. Chances are that a LabVIEW version already exists.
08-13-2012 12:04 PM
Hi,
The program is an algorithm meant to simulate linear acceleration that can be used to help run a stepper motor - I am trying to use Labview and
I have looked at a lot of Labview examples of algorithms and fomulas already but I don't know how to incorporate so many variables into one program.
If you guys could point me in the right direction any input would be greatly appreciated.
Thanks a lot!
08-13-2012 12:56 PM - edited 08-13-2012 12:57 PM
LabVIEW does not have "variables" in the same sense as text based code. Value are received by the code via front panel controls (human interaction or assigned connectors in the case of a subVI). For the duration of the code, the data lives inside wires (and possibly shift registers if it needs to persist across iterations).
theodyssey12 wrote:The program is an algorithm meant to simulate linear acceleration that can be used to help run a stepper motor - I am trying to use Labview and
You want the acceleration to increase linearly or the speed to be a linear ramp? Big difference! A linear speed increase is a linear ramp and linear acceleration is a nonlinear ramp of velocities that needs to be translated into stepper motor pulses. What kind of hardware do you use? What kind of drivers do you use for the stepper motors?
Can you describe the capabilities that the program needs? How is initialized? What triggers the start of the ramp? what determins the start and end values? What are the limits? What determines the timing?
If you can give us a nice flowchart of states, translating it into LabVIEW will be easy. Trying to translate a C program verbatim into LabVIEW would result in a horrible mess, because native LabVIEW is so much more elegant. 😄
As a possible quick workaround, you could compile the C porgram into a dll to be called from within LabVIEW. Do you have this capability?