12-21-2011 11:44 PM
Hi,
I am using the counter on my chassis cDAQ 9174 and the NI 9401 to measure period. I believe that I can simplify my setup if I can reduce the values measured to round milliseconds. For example, I measure a period in seconds as 0.00681, but, what I really want is 0.007, or 7 would be OK too. How do I get the values to be truncated or rounded like this? I can't figure out how to make the number of digits to the right of the decimal 3 instead of 5. Can it be done? I could even multiply the values by 1000 and then round to nearest integer, for example, but, I am not sure how to multiply each value entering the array by 1000. When I put in a multiplication value, then, my WRITE to spreadsheet stopped working.
Is it possible also to put in a function that scales the period values before sending them to the BUILD ARRAY function?
Thanks for your advice.
Dave
12-27-2011 09:28 AM
Hey dav2010,
Below is a screenshot of a small example of how to multiply all values in an array by 1000 and then round them to the nearest integer. I'm not sure if this is exactly what you are looking for, but I hope it leads you in the right direction. If this isn't what you were looking for, could you post a screenshot of what you are trying?
Regards,
Travis Ann