06-22-2010 02:55 AM
I am outputting a 30Hz signal from a pulse generator, and I have reduced the vi to the bare minimum, but the program still only logs a timestamp about 2-3 times a second. Checking timestamping in ni-max test panels has the same result. The cables are fine and I've tried PFI0, 1, and 2. What's going on?
06-23-2010 09:12 AM
Hi Steve-
You have selected 'Read Single Timestamp' as the polymorphic instance of the niSync Read Trigger Timestamp.vi. Change that to 'Read Multiple Timestamps' from the drop-down menu. This will enable you to pull an array of timestamps from the 6682, as opposed to just a single timestamp, as you had it configured. The reason you were only getting 2-3 Hz is because you were pulling only a single timestamp with every iteration of the while loop, which was only iterating at 2-3 Hz. With the Multiple Timestamps enabled, your while loop will still iterate at 2-3 Hz, but you can pull several timestamps with every iteration. To specify the number of timestamps to pull, right-click on the number of timestamps input and select Create»Constant. Start out with 10 as the constant and increase from there until you are pulling 30 timestamps every second. Be sure to also wire a timeout value to the timeout input as well (ten seconds should be sufficient, but you can fiddle with this number also).
Your number of timestamps indicator will now be the 'detected edges' output of the niSync Read Trigger Timestamp.vi instead of the number of loop iterations. Be sure to also place an niSync Close.vi at the end of the program to properly close the niSync session and clear it from memory.
This should now run how you want it to. I hope this helps, and best of luck with your application!