Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 9401 & Status Code: -200474

Hello Everyone,
 
Software: Visual Studio 2003, VC++
Hardware: cDAQ - 9172
 
I have 2 NI 9401 modules .  1st module is configured as DO while the 2nd module is a CI.  I tried using them in a single chassis and even
on separate chassis but I still have this problem.  Please see attachment.
 
I modified the 2-separate measurement shipping example.  I included a DO task that will write a data to the AUX pin of the 2nd NI 9401 module.  I want to measure the time the command has been generated and captured by the 2nd module.   
 
// Create counter input task
CNiDAQmxTask myTask;
 
myTask.CIChannels.CreateTwoEdgeSeparationChannel(physicalChannel, "", minimumValue, maximumValue, firstEdge, secondEdge,    DAQmxCITwoEdgeSeparationUnitsSeconds);
 
// Create the digital output task
CNiDAQmxTask myTask2;
 
// Create the digital output channel
 myTask2.DOChannels.CreateChannel(physicalLines2, "", DAQmxOneChannelForAllLines);
  
// Arrange the data in a CNiBoolVector
unsigned long length = sizeof(m_checks) / sizeof(BOOL);
CNiBoolVector vector(length);
  
for (unsigned long i = 0; i < length; i++) {
                if (m_checks[i]) {
                     vector[i] = true;
                }     
                else {
                    vector[i] = false;
                 }
 }
 // Write data (digital output)
 CNiDAQmxDigitalSingleChannelWriter writer(myTask2.Stream);
 writer.WriteSingleSampleMultiLine(true, vector);
 // Create a reader for the channel (counter input)
 CNiDAQmxCounterReader reader(myTask.Stream);

 // Read the data (counter input)
 double acquiredData = reader.ReadSingleSampleDouble(); 
 
 // Display the data (counter input)
CNiString acquiredDataString;
acquiredDataString << acquiredData;
m_acquisitionResult.SetWindowText(acquiredDataString);
 
Please advice.
 
Thanks again,
A
 
 
 
0 Kudos
Message 1 of 4
(7,677 Views)

 

Hello,

This post also seems to relate to this thread with a Counter Output instead of a Digital Output.

I noted that you want “to measure the time the command has been generated and captured by the 2nd module”.  Please clarify the reasoning and how it relates to the application.  I am assuming that you are interested in the time between when the signal is generated and acquired on the different modules.  Are you interested in this because you are wiring the output directly to the 2nd 9401’s AUX and also routing the generated signal through other hardware and then to the 2nd 9401’s GATE of the Counter Input. Please explain more about your application and physical wiring setup.

At this point, I am assuming the error 200474 is likely occurring at the Counter Input due to a lack of signal on the GATE.  Please look to this older post for a discussion on wiring for a Two Edge Separation task.

Please clarify the application and let me know if I have misunderstood your application.

Samantha
National Instruments
Applications Engineer
Message 2 of 4
(7,602 Views)
Hello Samantha,
 
Yes you are right about my objective to measure the time between the command generation and capture by the 2nd module.  Regarding the two-separation measurement shipping example, I am sure I wired it correctly (took my sometime to figure out though) and executed it.  I modified it to include the command generation from another module.  And this where my trouble start brewing.
 
Well anyway, for I shifted to another strategy using DI & DO.  Its got more software overhead but less  pin connections needed and hence less.   However, using this two-edge separation is the easiest.
 
Thanks again for the info!!!
A
0 Kudos
Message 3 of 4
(7,581 Views)

Hello,

I am a bit confused if you actually got the two edge separation working and if you need further assistance with the application.  Please clarify if you are up and running with the DO and DI and are still interested in getting the two edge separation working or if you are satisfied with the DO and DI.  Please layout what your current setup is with the two edge separation if any changes have been made and you want to discuss the application further.

Samantha
National Instruments
Applications Engineer
0 Kudos
Message 4 of 4
(7,561 Views)