LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stepper motor

HI All,

 

Just so you are aware, I am new to using Labview. I only started a couple of weeks ago.

 

So far to get myself familiar to labview 8.5 I create a simple thermometer, using  a DAQ NI9205 and NI9172. I am now looking to control a stepper motor and was surfing the internet for some example.

 

I found one very good example

 

 http://etidweb.tamu.edu/projects/labview/stepper/vi.htm

 

which helps explain what each block does. However there is one section I am stuck on, this would be the  sub VI that is called "write to digital I/O port" 

 

This section is about 3/4 the way down the page. See quotes below. Is this symbol in labview 8.5 and if so where? Any help is much appreciated.

 

Thanks and Regards

John

 

 We did this so that if the direction or mode was changed while the motor was running, we would still be able to see how the motor was operating.  These values can be changed while the motor is running; however the motor will not be affected before the compilation of the “for loop”.  A view of the full front panel and the full diagram of the program is included as part of this report.  To get the output from the VI program to the digital I/O port, we had to send the data to a sub VI that is called "write to digital I/O port".  The "write to digital port" sets up the 8255 PPI.  The sub VI has 5 inputs.  The port width input allows the user to set the number of bits that will be used.  The device number picks the DAQ.  The port number input chooses which port will be used on the 8255 PPI.  The pattern input is the data that will be written to the digital I/O port.  The iteration input is used to initialize the 8255 PPI. The first time the loop is executed the port is initialized because the input is zero.  Any non zero number will not initialize the port; by connecting this input to the loop iteration counter the port will only be initialized once 

 

 

0 Kudos
Message 1 of 8
(3,718 Views)

That example is OLD.  It uses LabVIEW 5 and traditional DAQ.  What version of LabVIEW are you using?

 

EDIT:  I see that you already said ver. 8.5.  You REALLY want to use DAQmx.  I doubt your hardware will even support traditional DAQ.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 2 of 8
(3,713 Views)

Thanks for the reply. I will look at that channel

0 Kudos
Message 3 of 8
(3,694 Views)

Hi JDonne,

 

NIQuist is right you should be using the DAQmx drivers with newer hardware and software. What stepper motor are you using? What kind of inputs does it take?

 

Usually with a stepper motor you need to provide a digital pulse of varying frequency to move it at different speeds and set another digital line to high or low to control the direction of movement.

 

The write to digital IO port.vi is no longer available in the later versions of LabVIEW but digital write functionality is possible with the DAQmx VIs.

 

Kind regards,

Joel G
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 4 of 8
(3,679 Views)

Thanks Joel G For the Reply and sorry for the delay in getting back

 

I am using a faulhaber two phase stepper motor.

 

As i said i am new to Labview and I am wondering if there are any examples online as i am finding it difficult to understand the icon and there ability

 

Any help is much appreciated

 

John

0 Kudos
Message 5 of 8
(3,645 Views)

Hi John,

 

Start using context help to understand the functions, (ctrl-h).

 

I would advise taknig a look at the DAQmx examples in the example finder (Help>>Find Examples), specifically the ones in the folder Hardware Input and Output>>DAQmx>>Generating Digital Pulses.

 

There is one called Gen Dig Pulse Train-Finite-Retriggerable.vi which I think you will find useful. It will generate a train of pulses with a specified frequency when you give it a trigger. You can configure this to move your stepper motor a specified number of steps.

 

It's always good practise to use the DAQmx VIs in the DAQmx palette when doing DAQ tasks (Controls Palette>>Measurement I/O>>NI-DAQmx).

 

When you're configuring the pulse train make sure it outputs a frequency and pulse width that is suitable for your stepper motor, you should be able to find a maximum and minimum pulse width and frequency in the datasheet.

 

Are you going to be using a digital output module to control your stepper motor? If so, which one?

 

Kind Regards,

Joel G
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 6 of 8
(3,635 Views)

Thanks Joel G

 

I have a NI 9472 which i beleieve will be ok as i see it in the requirement.

 

In the "Instruction for Running" in the information column it tells me the first thing that i need todo is  select the "Physical channel which corresponds to the counter...", howvere when i goto the count in the front panel i see Dev1/ctr0 and when i click on the drop down i see only browse and nothing else

 

Do i have to tell the the VI which output module i have

 

JOhn

 

0 Kudos
Message 7 of 8
(3,633 Views)

Hi John,

 

You don't need to specify the module in the VI, ensure it's connected correctly by identifying it in the Measurement and Automation Explorer. If the device is recognised the counters should appear in the drop down list.

 

I'm sorry I can't help you further at the moment but I'll have another look into this in the New Year.

 

Happy Christmas,

Joel G
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 8 of 8
(3,629 Views)