Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-6221

Hi guys,

Anyone can help me?

I have USB-6221 and I want to acquire pressure of 12 points with one pressure gage and one stepper motor.

So at the beginning of the program, I have to send a home position signal (Digital output) to stepper motor to go home position and after that I want to acquire an analogue signal (pressure) of first point.

Then by sending another digital output to stepper motor cases to advance to new point, I want to measure new pressure and loop this condition 11 times.

But I do not know how can I trigger two D/O and following my needs.

Thank you so much in advance for your help

0 Kudos
Message 1 of 6
(3,764 Views)

Hi,

The first thing I will suggest is to break your problem in small part so we can attack them one by one.  You say you want to trigger two digital outputs but from your post you only specify one (go home), or the other digital output is advance? I guess you are sending digital signals to a controller, right?

Second let’s clarify a concept “triggering”: as stated in the DAQmx help is: “When a device controlled by NI-DAQmx does something, it performs an action. Two very common actions are producing a sample and starting a waveform acquisition. Every NI-DAQmx action needs a stimulus or cause. When the stimulus occurs, the action is performed. Causes for actions are called triggers” So a trigger is not generating the digital output a trigger will make your digital output start.

Suggestion will be to take a look at the DAQmx examples include in LabVIEW for digital generation and also for multifunction synchronization. Take a look at those and let me know if they help: “help->find examples->hardware input and output -> daqmx”

Jaime Hoffiz
National Instruments
Product Expert
0 Kudos
Message 2 of 6
(3,746 Views)

Hi Jaime,
Thanks for your reply.

Yes, the other one is advance and you are right, I want to send digital signals to a controller.
About the trigger, you are right. Also I want to use the trigger to start acquiring the data.
And about the stimulus that cases the trigger be activated, can I use a timer or counter? Actually my program is not so difficult but the problem is that I do not have enough knowledge in Labview. Let me explain my program procedure:

1-     Start the program

2-     Send D/O1 (Digital Output) to set the home position of controller just for 30 milliseconds and stop sending this D/O ( I do not know how I can stop it).

3-     Wait for 60 sec

4-     Acquire one sample of data from A/I (analogue input)

5-     Send D/O2 to set the advance of controller just for 30 milliseconds and stop sending this D/O.

6-     Go to item No.3 (and do this loop 11 times and end)

It means that just by timing or using a common counter as a stimulus of the trigger of acquiring DAQ-max, I should be able to do it but I do not know how.
Please look at this procedure and if it is familiar to you or you know any example that can do almost the same, let me know ( I am really confused and I have very short time to do this job).

Thanks again for your kind cooperation.

0 Kudos
Message 3 of 6
(3,739 Views)

Hi,

I’ll be more than glad to help you giving you guide lines and examples to look at but if your new with LabVIEW you will have to be patience and like I said before try simple stuff first. What I’m going to do is to point you to example that will do something very similar to what you want.

Step 2: I will strongly recommend using the counter of the 6221 luckily you need to and we have two counters on that board. “Gen Dig Pulse.vi”, I have attached and modification of that example that tells you when the pulse is done.

Step 3: Use LabVIEW wait function for the 60 sec (software time and OS depended but since is 60 seconds this will be more than fine).

Step  4. Acq&Graph Voltage-Int Clk.vi (set the samples to read to 1)

Step  5. Same step 2 but using the other counter.

I hope it helps

Jaime Hoffiz
National Instruments
Product Expert
0 Kudos
Message 4 of 6
(3,725 Views)

Hi Jaime,

I really appreciate your patience to answer my questions.

I used your advices and they were very helpful but I have another question also.

As you can see in attached file, I want to define my own signal and send it to another stepper motor (this signal is not a pulse or even an analogue signal, it is a signal that define +5 and –5 volt in different time steps).

Would you please let me know how I can do this job?

I know that with simulate arbitrary signal (by defining some X and Y points), I can define this signal but is it a real signal or it is just a simulation?

How can I send this signal that I made to a stepper motor? Can I use analogue signal generation output port of my DAQ device or that port can transmit only its own generation signal and cannot accept a previously generated signal as an input and send it to stepper motor.

Thanks again for your help.

 

0 Kudos
Message 5 of 6
(3,696 Views)

Hi,

Your are absolutely right with the card that you have you cannot do +/- 5 volts form a digital line since digital lines on this card are not differential , they are all TTL compliant. But you are already in the right track you can use the analog output to generate your signal.  “Cont Gen Voltage Wfm-Int Clk-Non Regeneration.vi” an easier approach will be this software time example: “Gen Mult Volt Updates-SW Timed.vi”.  Here you will have to take a more proactive approach so the best suggestion is to familiarize yourself with those two examples.  Don’t forget to always make use of the amazing DAQmx help, if you search for: “Generating Voltage Programming Flowchart” and “Analog Output Programming Flowcharts” you will find a lot of useful information.

I hope it helps

Jaime Hoffiz
National Instruments
Product Expert
0 Kudos
Message 6 of 6
(3,677 Views)