LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with DAQ assistant

Hello,
I started using labview just a month ago and so my learning curve's been really steep.
I've attached a sample vi of what I'm working on. I use LabView 7.0 and all the examples posted seem to be for LabView 7.1 and above, and so I can't open any of them. I have the following problems which I can't seem to solve, though it seems simple enough.
I use a PCI-MI0-16E daq card, with the SC-2345. I have a stepper motor connected to the digital IO of the SC-2345, and a strain gauge on an anaolg I/O channel.
1) I've been trying to get the data coming out of the DAQ assistant to be written in one column of an excel file, but it seems to be writing it rows instead of columns
2) I'm also trying to display the data on a graph in the front panel of the vi.
Another question I have is, will it be possible to vary the frequency of the digital pulses in real time? To vary the speed of the stepper motor.
Any help with the above will be greatly appreciated.
Thank you
0 Kudos
Message 1 of 5
(3,223 Views)
Here's the attached sample vi. It somehow did not attach earlier.
0 Kudos
Message 2 of 5
(3,208 Views)

Hi,

Had a look at your VI

I have two points to tell.

1. why is your AI reading DAQ assistant outside while loop? This way, it will not read continously fom the AI channel but read only once before starting the while loop.

2. And to vary the frequency of pulses in real time, look at example 'Gen Dig Pulse Train-Continuous.vi' shipped with labview and see how you can modify this vi to work as you want.

Also look at Multi function Sync examples in which you can achieve simultaneous AI read and Pulse generation

Hardware input output ->DAQmx ->Synchronization ->Multi-Function ->Multi-Function-Ctr Pulse Train Genereration for AI Sample Clock.vi

This might serve your purpose better

regards

Dev

 

 

 

 

 

Message 3 of 5
(3,197 Views)

Hi stepper-

You will need to transpose your array before writing to the file.  You can use the "Transpose 2D Array" function from the All Functions>>Arrays palette.  Dev is also correct- you will need to move the DAQ Assistant inside the While loop if you expect to receive readings with each iteration.

Dev's suggestion to use the pulse train generation example for your stepper control would require the use of one of your device's counters rather than the digital I/O lines.  The digital I/O lines are not hardware-timed on your device, so the only method to adjust the pulse specs with hardware-timed accuracy is to use a counter.  This example shows one method to change the specs of a hardware-timed pulse generation on the fly.

Hopefully this helps-

Tom W
National Instruments
Message 4 of 5
(3,184 Views)

Tom wrote:
> Hi stepper-
> You will need to transpose your array before writing to the file.  You can use the "Transpose 2D Array" function from the All Functions>>Arrays palette.  Dev is also correct- you will need to move the DAQ Assistant inside the While loop if you expect to receive readings with each iteration.
> Dev's suggestion to use the pulse train generation example for your stepper control would require the use of one of your device's counters rather than the digital I/O lines.&nbsp; The digital I/O lines are not hardware-timed on your device, so the only method to adjust the pulse specs with hardware-timed accuracy is to use a counter.&nbsp; <a href="http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=DE27921DB53A4D8DE034080020E74861&amp;p_node=201198&amp;p_source=External" target="_blank">This example</a> shows one method to change the specs of a hardware-timed pulse generation on the fly.
> Hopefully this helps-

Message 5 of 5
(3,156 Views)