Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

timestamp & change detection digital events

Hello All,
 
I have 4 optical shutters as my duts.  I need to measure the time between the switching from a reference to low magnification or high magnification.  The driver board or reference generates the command.  Once I start the tasks, the generation begins and the acquisition starts to capture samples to measure the time elapsed.
 
Basically I have one counter output pin, write digital data (command).  Two counter input pins, low mag and high mag.
 
 
I can use a two-edge separation method.  Still, I am in the process of planning how to maximize 2 NI-9401 modules to test 4 optic shutters.
 
 
 Another option is to use software, so I am planning to use a call back , change detection digital events.   The 1st marker is at the start of task, a synch input /output.  My trigger is start or arm start trigger (not sure which).  Next the 2nd marker need to be placed somewhere else but I don't know where.
 
 
3rd option:
1. start trigger/ arm start trigger (counter output pin)  
2.  generate pulse
3.  pause trigger change detection event
 
These are experiments in progress.  Please advice if these make sense.  Thanks, A
 
 
 
 
 
 
0 Kudos
Message 1 of 4
(7,235 Views)

Hi angelmcdoggie,

I’d be happy to help you figure out the best way to set up your application. If I understand your application, the DAQ hardware will send out a digital pulse. This will pulse will then trigger your shutters to go to high or low magnification. Once the shutter has switched you will receive a pulse back from the shutter. So you are trying to measure the time difference between when you send out a pulse and another pulse comes in? Do you need to test all four shutters at the same time? I’m assuming you are using the 9172 cDAQ chassis with your 2 – NI-9401 modules.  The 9172 has two counters available. You will need to have the 9401 modules in slots 5 and 6 to have access to the counters. You can then use 2 edge separation to measure the time between the two pulses. Text based examples of this can be found under the “C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples” directory.  Please let me know if you have any questions or if my assumptions are wrong. Take care.

Thanks,

Nathan
NI Chief Hardware Engineer
Message 2 of 4
(7,215 Views)
Thanks Nathan for the info.  I have drafted a code for one optical shutter to include the digital write.  Right now I am having trouble running the program error free.  In the same program, I have a digital output task.  This will command the driver board to write a '1' and make the shutter move.  For this problem, I posted it on another topic.  My question: digital output task + counter input task, are OK???  I also tried another variation, counter output task (pulse generation) + counter input task, will this work??? 
 
 
Thanks a bunch,
A
0 Kudos
Message 3 of 4
(7,200 Views)

Hey angelmcdoggie,

A digital output task and a counter input task will work together just fine. A counter input and a counter output task at the same time can work depending on the type of counter tasks you are using. Some counter tasks require two counters. There are only two counters available in the 9172 chassis. For counter input is you are doing two edge separation it only requires one counter. For counter output if you are doing a single pulse generation or a continuous pulse generation it only require one counter. A multi pulse finite generation however requires both counters. So you should be able to generate a single pulse with a counter and measure 2 edge separation on the other counter.  Please let me know if you have any questions.

Thanks,

Nathan
NI Chief Hardware Engineer
Message 4 of 4
(7,184 Views)