02-13-2008 08:10 PM
02-13-2008 08:14 PM
Woops I meant to post this in the Labview forum as it seems more appropriate.
Sorry for the duplicate posts....
best
SS
02-14-2008 09:35 AM
What you're seeing is almost certainly just a "wrap-around" or "rollover" effect as your edge counts get to the maximum possible 32-bit integer number. The internal count register will simply wrap around back to 0 again whenever this happens. There are workarounds, but since I don't have LV near my network PC, I can only give a verbal description.
There's a DAQmx Property node (I *think* it's a DAQmx Channel property node) you can query that tells you whether this has occurred. The terminology to look for is something like "TC reached?" where TC stands for "terminal count". If you get a True output, you'll know that you've crossed that barrier sometime since your last query. (Note: subsequent queries will return False until the *next* time the counter does a wrap-around.) Each time you get a True, you can increment a software count to track the number of wrap-arounds.
You can then multiply this # of wrap-arounds by 2^32 and add it to the instantaneous count value to get a total cumulative count. It's probably safe to do the addition using floating-point DBL's, but a pure integer method would be even better if you've got a version of LabVIEW that supports 64-bit integers. You can perform a U32 DAQmx Read to get a 32-bit integer count and also track the # of wrap-arounds as a 32-bit count. Then you can combine them with a low-level numeric manipulation function named something similar to "Join Numbers", which combines the two 32-bit values as a low and high segment of a 64-bit integer.
-Kevin P.
02-14-2008 11:35 AM
Kevin,
thanks for the info and the method of getting around it. I think I know how to implement your suggestion.
thanks again
SS