Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

An error in the Synchronizing Analog Input and Output example

�2 analog outputs and 1 analog inputs simultaneously in C/C++�

I need to outputs two sine waves of different frequencies, phases and amplitudes to analog outputs 0 and 1. It simultaneously synchronously reads from analog input 0 and when the acquisition stops it graphs analog input 0.

The clock signal of the analog input is routed to one of the analog outputs so every time an analog input occurs, an analog out is triggered to occur, thus synchronizing the input and output.

I want to modify the this program (2 analog outputs and 2 analog inputs): http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3E72F56A4E034080020E74861&p_node=DZ52337&p_source=External .
However, I just keep re
ceiving error information.

Could you please tell me how to do it?

Thank you very much!

Marlon
0 Kudos
Message 1 of 7
(4,347 Views)
Marlon,

what have you tried? Which errors are you getting? You should be able to change:

ai_channels[2] = {1,2} to ai_channels[1] = {1}
You will also need to change the number of channels input.

Regards,
Anuj
0 Kudos
Message 2 of 7
(4,347 Views)
Hi, AnujD:

Can I run LabWindows/CVI programs in MS Visual C++ 6.0?

I changed that example to 2 AO and 1 AI.
When I run that example in LabWindows/CVI, I get " NON-FATAL RUN-TIME ERROR: "AIAO_Sychronize.c", line 149, col 18, thread id 0x000006AC: Function DAQ_DB_HalfReady: (return value == -10608 [0xffffd690]). noTransferInProgError: No transfer is in progress for the specified resource."

After that, nothing can be run, even MAX gives me "10609 transferInProgError " or sometimes "-10845 overFlowError " errors.

Could you please throw some light on this problem?

Marlon
0 Kudos
Message 3 of 7
(4,347 Views)
Actually, first I got this information:

NON-FATAL RUN-TIME ERROR: "AIAO_Sychronize.c", line 141, col 18, thread id 0x00000744: Function WFM_DB_HalfReady: (return value == -10608 [0xffffd690]). noTransferInProgError: No transfer is in progress for the specified resource.

Thanks.
0 Kudos
Message 4 of 7
(4,347 Views)
Hi, Anuj:

Here are there questions about this example ( please see the attachment):

The program can run for several seconds. Then I get this error:
NON-FATAL RUN-TIME ERROR:
"AIAO_Sychronize.c", line 142, col 18, thread id 0x0000090C: Function WFM_DB_HalfReady: (return value == -10608 [0xffffd690]). noTransferInProgError: No transfer is in progress for the specified resource.

The program should outputs two sine waves of different frequencies to analog outputs 0 and 1. It should simultaneously synchronously reads from channels 0 and when the acquisition stops it graphs channel 0.

However, I can only see the outputs for several seconds, and then I got the error information. How does this happen?
Moreover, it is expected that the AOs w
on't actually output any points until the AI starts doing D/A conversions and so they will both start at the same time, but when I run the program the AOs output without any AI starting.
Finally, it is said that when the acquisition
stops the program should graph channel 0. How can I do this? Does that mean when I stop my snesor's working?

Thank you very much!

Marlon
0 Kudos
Message 5 of 7
(4,347 Views)
Hi, Anuj:

Actually, if I change the value of NORMAL_MODE from 0 to 1, the outputs can last till the ITERATIONS finished. Then I get the same error information.
1. I think the value of NORMAL_MODE should be 0.
2. I still can't get the AI pop-up graph.
3. The outputs still start without the starting of AI, which should not be.

Marlon
0 Kudos
Message 6 of 7
(4,347 Views)
Here is the modified example (attachment) and error information:
NON-FATAL RUN-TIME ERROR: "AIAO_Sychronize.c", line 157, col 18, thread id 0x0000036C: Function WFM_DB_HalfReady: (return value == -10608 [0xffffd690]). noTransferInProgError: No transfer is in progress for the specified resource.

Thanks
0 Kudos
Message 7 of 7
(4,347 Views)