04-07-2008 04:22 AM
I am using cDAQ-9172 with NI 9263 and NI 9215 for my hardware and MSVC++8.1 for my software.
Plan:
1. ao0 pin is connected to ai0 pin
2. ao0 will output a certain voltage to ai0.
.......
.......
m_writer->WriteMultiSample(true, *pData);
m_taskAO->Start();
m_taskAI->Start();
.......
m_reader = std::auto_ptr<CNiDAQmxAnalogMultiChannelReader>(new CNiDAQmxAnalogMultiChannelReader(m_taskAI->Stream));
m_reader->InstallEventHandler(*this, &CContAcqVoltageSmps_IntClk_PauseTriggerDlg::OnEvent);
m_reader->ReadMultiSampleAsync(m_numberOfSamples, m_data, NULL);
m_taskAO->Triggers.PauseTrigger.ConfigureDigitalLevelTrigger(triggerSource, m_gateLevel);
......
m_writer->WriteMultiSample(false, *pData);
m_taskAO->Start();
Questions:
1. Item #2 is running but my problem starts at #3.
2. Does the program implementation makes sense? I am not sure specially about item #3.
3. If I run item #3, I encounter an error saying that the specified property cannot be set while task is running.
How can I continue without stopping the output task in #2.
4. Is it possible to have two output waveforms? One is the voltage sourcing of AO and 2nd is the pause trigger
for AO task.
Thank you and please advise.
A
04-08-2008 05:38 PM
04-08-2008 08:43 PM
Hello Mallori,
Thanks for the enlightenment. Right now, I am rearranging my lines and figuring out how to manage the start or stop of tasks.
For my application, its true that I want to pause the analog generation based based from the analog input module. But in my case, I have two analog channels. The 1st is the analog channel that sourced a voltage to an analog input module. 2nd is the analog channel that was paused triggered by an analog input module.
Best regards,
Angel
04-09-2008 05:36 PM
Hi Angel,
I apologize, but I am afraid I am still confused. So you are outputting on two channels of your 9263. The first analog output channel is wired to your analog input module. The second analog output channel is outputting another waveform, which you would like to programmatically start and stop? If you could perhaps attach a drawing that might help clear things up.
To help with a discussion oif what type of triggering you want you can look at this document, which includes explanations of the types of triggers. While the program is Traditional DAQ, the illustrations of signals are still helpful.
Regards, Mallori M.
04-15-2008 10:12 PM
Hello Mallori,
Sorry for the late reply. I am attaching an illustration of what my program should do. By the way, our order for the NI 9401 module recently arrived. I used the PFI as trigger source in the original pause trigger program and also tried other trigger examples. I was able to execute it. It was easy and convenient. Nevertheless, I want to explore using non-pfi signals as trigger source.
Using the same concept based from the attachment, I rewrote the program to cater two NI 9263 modules but my program ended up with the status error: -89137. I also tried another strategy wherein I have one output task and created two voltage channels. Nevertheless my status error is -89137.
Best regards,
Angel
04-17-2008 05:21 PM
Hi Angel,
I guess a better question to ask is for an idea of your end goal, what you are trying to do, or your complete application. The diagram was helpful but I am still unclear as to trigger direction and trigger routing from that diagram.
Whne you say ai/Pause Trigger, that pauses the analog input. If you want to pause the analog output you will need to use the ao/Pause Trigger and define a source. You can look at pages 24-26 of the cDAQ-9172 User Guide for a great explanation with images of Analog Out Pause Triggering. Elsewhere in the guide it discusses Analog Input Pause triggering.
After reading this guide, you can post back with what conditions you want to pause with.
Hope this helps, Mallori M.
04-17-2008 10:35 PM
04-18-2008 04:45 PM
Hi Angel,
So, as I understand it, you are outputting two voltages to a scope. You want to stop and start your second voltage (AO1) based off of your first output voltage (AO0). To do so, you are using the analog input module to monitor AO0.
1. Is AO0 a constant voltage or is it varying?
2. Do you want to stop and start just AO1, or both AO0 and AO1?
3. Do you just want to stop the generation, or start the generation, or both stop and then start the generation?
4. What conditions do you want to stop and start AO1 under? For instance, when AO0 reaches a certain point, do you want to stop outputting on AO1? And then when AO0 drops below that point, do you want to start outputting once again? If this is the case, this is Hardware Analog Pause Triggering. You are monitoring an analog signal to determine when to start and stop some action, typically using what is called a window to define the voltage limits.
5. In your post you mentioned a START button. Is this a physical button on hardware that you push with your finger? Or is this a software button on your program’s user interface that you click with a mouse?
6. Are you displaying the analog input on a graph and watching it to see when to press this START button? What relation does the analog input have to the START button?
7. Do you want the START button stop the analog output of AO1 when pressed down, and start the generation again when the button is released? Or when it is pressed again?
I think that the answers to these questions will get us on the same page.
Regards, Mallori M.
04-20-2008 05:06 AM