LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with DAQmx

Hello,

A little assistance would be greatly appreciated. I've totally run out of ideas and my inexperience with LabView hasn't helped either. I've attached my .vi along with this post. I'm using LabVIEW 7.0, so please keep that in mind if you intend to modify my program. Thank you.

I'm trying to run a stepper motor and measure strain at the same time. The counter in the program provides the input to the stepper motor. The device in the second part of the program decides the direction of rotation. I'm using a stepper motor driver chip. The third part (the DAQ Assistant) measures strain.

My issues are as follows,
1) The first time I run the program, the motor does not start rotating till I decide the filename/path for the strain, but if I run it a second time without resetting the motor starts moving without strain measurement. I tried to resolve this by pushing the 'Start Task' for the motor into the loop but I get a device conflict saying that the 'specified resource is already being used'. I need the motor to start only after the strain measurement begins. I understand that the error occured because there are two DAQmx tasks running, but from the help resource on ni.com, it said that one analog input and one analog output could be run at the same time. This is digital out and analog in, so shouldn't it work?

2) When the program is run and I'm prompted for the filename/path, and I 'Cancel' instead of specifying a path/filename I get an error at the end saying that "NI-488: Command requires GPIB Controller to be Controller in Charge.

3) I need to specify the number of samples, sampling rate and continuous/finite samples for strain measurement in the front panel of my program. Its available in the DAQ assistant, but I need to be able to specify it on the front panel.

Thank you in advance,
Prithiv
0 Kudos
Message 1 of 4
(2,995 Views)
Just had a brief look and picked up a few errors :-

You are setting up the duty cycle for ctr0 to be 10 - you should really set this to 0.5 for a standard waveform - that will stop the .vi erroring.

For finite samples you also need to specify the number of samples.

D Clark
David Clark
CLA | CTA
Genesee Technologies Ltd
Hampshire, England
Message 2 of 4
(2,980 Views)
Thank you for responding.
The duty cycle is generally set to 0.5 before I run it. That was a modification I'd made before I posted the .vi. I just haven't changed it to default at 0.5 as yet.
I'll look into the error for finite samples, any other suggestions for the rest?

Prithiv
Message 3 of 4
(2,971 Views)

What you have is a data flow problem, loops dont start until all inputs (wires) have been satisfied,  you might consider a state machine architecture.  Labview will try to run processes in parallel, the only way to enforce order is through data flow (usually can be done with the error cluster wires.  A few other points, you can run this in multithreads using synchronization techniques and handle user events with an event structure instead of polling methods for better CPU efficiency.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 4 of 4
(2,968 Views)