10-25-2017 09:33 AM
Hello,
I have a bunch of groups with a Column called "Angle" and each of these have about 2000 items. My issue is that each of these has 8 decimal points, but I want none. I'm planning on using the Round() function to just round all these to an integer, but am not sure the best way to do this. Is there a way I can do something like:
For item in Range(Length("[group index]/Angle")):
"[group index]/Angle/[i]" = Round("[group index]/Angle/[i]"
So for each element in the Angle channel it will replace it with a rounded number?
10-26-2017 03:32 AM
Calculate can be used to assign a method to each value of a channel
Call Calculate("ch(""[1]/Speed"")=int(ch(""[1]/Speed""))")
If you want to loop over all groups the following example might help building a solution
Option Explicit dim grpO : for each grpO in data.Root.ChannelGroups if grpO.Channels.Exists("Speed") then dim chO : set cho = grpO.Channels("Speed") dim chRef : chRef = chO.GetReference(eRefTypeIndexIndex) Call Calculate("ch("""& chRef & """)=int(ch(""" & chRef & """))") end if Next
10-26-2017 04:36 PM
Hi Strange,
If you have a modern version of DIAdem, you will find a "Rounding" function in the "Basic Mathematics" palette of the ANALYSIS panel.
Brad Turpin
DIAdem Product Support Engineer
National Instruments