PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

PXI 6040E: How to generate a counter from an analog sine with varying frequency and synchronize this counter with the analog sine?

Hi,

 

I am currently using the PXI-6040E board to collect an analog sinewave from an analog signal generator. The frequency of this analog signal is slightly varying (100 Hz variation to 40000 Hz base). I am trying to generate a counter which runs synhronized with this analog signal at a rate of 240 kHz (=6*40kHz). With this counter I later want to sample my incoming measurements which I collect on the PXI-6123 board. 

I am using the CounterPulse.vi which I found here.

The two images in attachment show how I am trying to accomplish this. Yet when I try to run it I get following error: 

 

Error -200557 occurred at Property Node DAQmx Channel (arg 1) in Pulse Generation from Analog.vi

Specified property cannot be set while the task is running.

Set the property prior to starting the task, or stop the task prior to setting the property.

Property: CO.Pulse.Freq

Task Name: _unnamedTask<80>

 

Can anyone help me with this problem? 

 

Thank you very much in advance!

 

Dieter

 

Download All
0 Kudos
Message 1 of 2
(3,143 Views)

Hi Dieter,

 

You are receiving that error because changing the frequency of the output from the counter makes changes to how the counter is configured. This cannot be done whilst the counter is outputting, i.e. once the DAQmx Task has been started, so the task must be stopped first before a change can be made to the counter frequency. I hope helps understanding this error.

 

Just as a note for the future, when uploading code to the forum it is often helpful if you can post the VIs themselves or use VI Snippets as this allows people to run the code you are trying to use.

 

Best regards,

Joe

Joe P
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 2 of 2
(3,114 Views)