From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
11-23-2006 04:10 AM
11-24-2006 06:03 AM
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |
11-24-2006 06:29 AM
Hello Matthias,
Thank you for replying!
I am working with *TDM files. I am writing a script to automize a couple of calculations, because I have to calculate over a hundred files.The data acquisited are "time", "speed" and "distance". These measurements are recorded from braking tests un dry surface where the driver of the vehicle speeds up to 110 km/h and then starts braking. The data starts recording from 100 km/h till 10 km/h. For this I have written commands to find the distance travelled at 60 km/h and saved these as variables R. I used the formula:
R1=CHD(Find("'Speed 1'<60"), "Distance 1")
The problem is that some tests have 8 repeating measurements and other test have only 5. So in one file I accuire 9 different variables and in the other only 6. I have to calculate the average brakingdistance, but I want to do this with a command to put these averages in a tabel in the report.
Also a problem i have encountered is that I have repeated the formula above for the other Variables (R2-R9), but as i was saying some files only have 5 repeatings and therefore the program gives an error. It doesn't recognize "Speed 7" cause there isn't. Maybe you can help me solve this as well.
Greets,
Robert
11-24-2006 07:18 AM
Dim i
' fill (demo)
L1 = 4
RV1(1) = 1.234
RV1(2) = 2.345
RV1(3) = 3.456
RV1(4) = 4.567
' calculate sum
R1 = 0
For i=1 to L1
R1 = R1 + RV1(i)
Next
' calculate average
R1 = R1 / L1
MsgBox "Average = " & str(R1,"ddd.dd")
Note: The maximum value count for RV1 is 15!
If this doesn't suits you have a look at the DIAdem FormulaCalc
command. This command can calculate expressions from a string.
Matthias
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |
11-27-2006 07:06 AM
OK thank you very much, this helps a lot!
greets,
Robert