OK, I was just going through the documentation for the functions used in the code-sample above, because the measurements that the code sample produced seemed a little off, and I have one more question for you:
According to the doc for NISCOPE_VAL_TIME_DELAY, "The algorithm finds the first time that the waveform from channel 0 crosses its mid reference level. Next, the algorithm finds the first TWO times that the waveform from channel 1 crosses its mid reference level. The time delay is the time between two edges with the same slope."
Am I correct in understanding that NISCOPE_VAL_TIME_DELAY will measure the time between the first two positive peaks on the channel 1 wave-form? The waveform on channel 0 is simply used to trigger the beginning of that measurement but does not affect the time delay directly.
If this is the case then this does not correctly solve my problem. I need to measure the time delay between the first peak on the channel 0 waveform and the first peak on the channel 1 waveform. I am measuring the velocity of an object as it passes two points. Each of these two points is represented as a separate waveform on the digitizers channels, point A is Channel 0, point B is Channel 1. The distance between point A and point B is known and constant. What I need to do is measure the time that elapses between the time that the object passes point A and the time the object passes point B.
Currently, my code (VB6) looks as follows:
niScope_ConfigureTriggerEdge (vi, "0", 1.0, NISCOPE_VAL_POSITIVE, NISCOPE_VAL_DC, 0.0, 0.0)
niScope_SetAttributeViString (vi, "0", NISCOPE_ATTR_MEAS_OTHER_CHANNEL, "1")
niScope_InitiateAcquisition (vi)
niScope_FetchMeasurement (vi, "0", 1.0, NISCOPE_VAL_TIME_DELAY, scalarResult)
How would I need to change the above code sample to get the desired results? Also, there is a separate function where I need to send n objects past points A and B in rapid succession and then calculate the average velocity and standard deviation as well. I assume that will be accomplished by adding the following:
niScope_FetchMeasurementStats (vi, "0", timeout, NISCOPE_VAL_TIME_DELAY, scalarResult, Mean, Stdev, Min, Max, numInStats)
Thanks again for your input.