LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stepper motor sequencing

Hi,

 

I am trying to operate a stepper motor using a DO to specify its direction of rotation and a CO to generate digital pulses (hardware: NI 9401, NI cDAQ 9178). I want to have control over its operation in two modes: programmed (where it extracts the displacement angle from an array) and user-defined (where the angle by which the motor needs to turn is provided on the front screen by the user). In the attached VI, a case structure is used to control which of the two sources provides the angle to the motor for rotation. However, the user-defined part is placed inside the False case and runs as soon as the Enable button is pressed. The code appears to work fine for the programmed mode though. I want to start the program and have it wait for user input so that manual rotation can be done as many times as the user wants. Then, whenever the programmed mode is required, it is started with a button pressed on the front screen. How do I modify the VI to do this? 

 

Thanks,

lza

0 Kudos
Message 1 of 3
(120 Views)

Hello, Iza.

 

     Thank you here, and in your earlier "Channel Wire" post, for attaching VIs for us to study.  However, I (and possibly other LabVIEW users) have been unable to open them.  I'm beginning to suspect that the "problem" is that I'm (still) running 32-bit LabVIEW.  I think of the graphical Block Diagram as somehow being "agnostic" to whether the code was ultimately going to compiled for a 32-bit or 64-bit environment.  Certainly for a text-based program (from Fortran to Python to C++), whether the compiler generated 32-bit or 64-bit output didn't stop you (as a programmer) from "viewing the code" and suggesting programming changes.  But that's just a conjecture on my part for why I can't open your code and make suggestions based on your code.

 

     In the Environment section of the Tools/Options choice, I have checked "Separate compiled code for new files".  I also open the Properties page on my Project and make sure that I "mark" all of the LabVIEW code in the Project (to save the VIs without the compiled code).  That, also, might explain why I can't open any of the VIs that you've kindly saved for me in LabVIEW 2019.

 

     I'll try to make some hopefully-helpful suggestions over this weekend.  

 

Bob Schor

0 Kudos
Message 2 of 3
(60 Views)

Zip file attached. Please find more details in the block diagram.

 

Thanks,

lza

0 Kudos
Message 3 of 3
(22 Views)