LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time Stamping Signal from NI9422

Would you happen to have any examples/code on how to do this?  I'm still trying to learn Labview.  Thanks Mike.
0 Kudos
Message 11 of 19
(1,015 Views)

Hi Brandon,

see the "Count Digital Events.vi" from the example finder and the attached example. Smiley Happy

Hope it helps.

Mike

0 Kudos
Message 12 of 19
(1,011 Views)

Hi Mike,

    In your code you you have text were it says write your data to a file, which file can I write here.  I'm a bit confused on this.  I finally realized how to use the counter by putting the physical module in slot 5 of the cDAQ-9172.  I am seeing some issues with the edge counter.  I am using a limit switch for my activation of the count and when I test it out I end up reading 3-5 edge counts for 1 opening and closing of the switch.  Is this normal or am I doing something wrong?  Thanks for your help.

Brandon 

0 Kudos
Message 13 of 19
(975 Views)


coxbd316 wrote:
...
I am using a limit switch for my activation of the count and when I test it out I end up reading 3-5 edge counts for 1 opening and closing of the switch.  ...

Hi Brandon,
you can add a timer into your program and count only one event within a specified time.
"write your data to file" shows the position where you can add the code to write the events to your file, maybe a txt file or something like that.
 
Mike 
0 Kudos
Message 14 of 19
(969 Views)
Hi Mike,
     I tried this code but all I got in the text file was 1 point.  In the current program, were does this timer need to be added that you mention?  Didn't think it would be this difficult just to capture signals from the qDAC unit and give each one a current time.  Thanks for all your help Mike.   
0 Kudos
Message 15 of 19
(946 Views)

Hi Brandon,

see the attached picture. Now only events with a time difference grater than 100 ms will be added to the file. If you need a very frequently access to the file, i recommend to store the data for some loops in a shift register and write them from time to time all together.
Hope it helps.

Mike



Message Edited by MikeS81 on 05-19-2008 03:24 PM
0 Kudos
Message 16 of 19
(941 Views)
Hi Mike,
    I tried it out and it seems to be saving the info to the file, but there seems to be some issues.  I noticed it only saves one point while loop 1 is incrementing.  After Loop 1 increments to 101 it resets back to 0 and starts over.  If I don't activate my limit switch at all while loop 1 increments to 101, loop 1 stops and loop 2 goes crazy and increments to the millions in no time.  If it gets into starting loop 2 it doesn't save anything.  I may not see my limit switch activate out on the line for maybe possibly hrs. at a time or it could be secs., just depends on if the line runs or not.  I did notice as long as I activate my limit switch while loop 1 runs and resets back to 0 and a activate it again, it will save the data and time stamp, but it will only save one during the time frame before loop 1 resets.  I think its close to working correctly.  Also, I noticed in the .txt file it saves the data across from the last point.  Is there a way to save each point under each other in the file to read better?  Thanks. 
 
On a side note.  I tried bumping the Wait Until Next ms Multiple from 100 to 500 and loop 1 goes to 21 and resets back to 0.  But the other conditions are still true as stated above.  I guess the main thing I see is that only 1 sample can be saved while loop 1 runs.  When it resets back to 0 I can save a new point.  Thanks for your help Mike.   
Download All
0 Kudos
Message 17 of 19
(924 Views)
Hi Brandon,
change the stop condition in the second loop to "stop on error". Smiley Happy Now it should work. Attached you find an example on how to simulate your real system.
Hope it helps.
Mike
0 Kudos
Message 18 of 19
(906 Views)

Hi Mike,

           Thank you very much for your help.  It looks like this is going to work for what  I need to do.  Just from test runs at my desk it is working great.  I will try a real test next week during a line trial.  Thanks again Mike.

0 Kudos
Message 19 of 19
(903 Views)