Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Daq mx pause sampling

Hi,
I've a problem with an NI DAQ card, the NI DAQ 6229 PCI card. I use the card to generate an analog signal (sine wave) with frequency variable.
I use the DAQ to simulate a 3 phase encoder.
I use LabView 7.1, below I've explain the step that I've done:
- use DAQmx Timing (Sample Clock).vi to set the "continous sample" as sample mode
- use DAQmx Write (Analog 1D Wfm Nchan NSample).vi to write the samples for the 3 sine waves
- Start the task
- during the vi I change the "SampClk.Rate" in the DAQmx Timing Property Node to change the frequency of the sine waves.

Theese are ok, but my problem is, if I paused the generation of the sine waves?
If I write 0 on the property generate an error (of course). I want to paused the generation and mantain the analog level.

What I can do?

Thanks a lot,

0 Kudos
Message 1 of 7
(3,998 Views)

Hi Alexspin,

I'm not sure I've understood you. what I can understand from your post, is that you need to stop the sine generation but it is not clear to me where the problem exactly is.

Below I've attached a screenshot of a Block Diagram where I generate, on an Analog Output, a Sine wave when a counter signal level (used as a reference signal) is high and Nothing when counter signal level is low.

If you need instead a value different from 0 V when Sine Wave generation ends, you have to modify the Block Diagram. For example you can insert into the while loop a stop task.vi, then writing a new wave (in your case a constant function of value different from 0 V) and then restart the task.

I hope this help you, try working a bit on it!

Have a nice day

carlo>  

0 Kudos
Message 2 of 7
(3,982 Views)
Hi,
yes this is what I need. Only one thing, I want to pause the task not with a counter but with a variable (comparation result).

An other thing, If I stopped the task the level of the sine wave remains or it's reset to 0? (sorry but I can't have the board always so I must prepare before the tests).

Thanks a lot!

Alessandro
0 Kudos
Message 3 of 7
(3,965 Views)

Hi Alexspin,

About your second question when you stop the task the output value goes to 0 V, but not for a sort of "reset" as you spoke, but because when you stop the task you stop to generate anything and so you read 0 V.

About the first question, you can simply pause the output task using an analog trigger instead of a digital one: you need only to change the properties of the "DAQmx Trigger property node" from "digital" to "analog" [see the attached screenshot]. The problem is that you can't specify as a Source for the pause trigger the analog output itself, you can only select an analog input as a Pause trigger Source, so you have to:

1. Generate the analog output

2. Define an Analog input task that read from the analog output you've created and use this as Pause trigger Source for the analog output task itself.

I hope this help you

Have a nice day

carlo> 

0 Kudos
Message 4 of 7
(3,961 Views)
Hy Carlo,
I want to pause the analog sampling with a button on the VI for example.
I will explain my application, I want to make a train encoder that simulate the movement of the train. The frequency of the sine waves was directly proportional to the speed of the train. In some point of the trip the train was stopped (like a train station) and after some seconds restart. So:

1) the sampling generation must be paused
2) the continuity of the waves must be mantain

Thanks a lot!
0 Kudos
Message 5 of 7
(3,955 Views)

Hi Alexspin,

Take a look to this vi. I think you can work on it in order to have what you need.

Try also looking into LabVIEW Examples (Help >> Find Examples >> Search Tab >> "Keyword", where "Keyword" must be what you're looking for).

You can also find something going to www.ni.com , clicking on Example Library Code and inserting into the search field the "Keyword".

Have a nice day

0 Kudos
Message 6 of 7
(3,921 Views)
Hi carlo,
I can't open the vi that you've post because I have labview 7,1. I've finally solve the problem using one PFI as trigger and write to the corresponding I/O bit. I use PF0 and P1.0.
It's work, the analog wave paused and mantain the analog level.

I've post an image of the VI that I've test.

Thanks!
0 Kudos
Message 7 of 7
(3,911 Views)