DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Search...but not quite!

Solved!
Go to solution

Hi Peter,

 

I've created a script for you that I think does everything you've requested.  It assumes that all the raw data sets are loaded in the Data Portal, one per group and no other data in the Data Portal.  It assumes that for each raw data Group in the Data Portal you have the correct values listed in the Array() functions in the first few lines of the script for the following items

TorqueOffsets = Array("", 0.04, 0.06, 0.07, 0.09, 0.10, 0.11, 0.12)
PressureMins  = Array("", 2.75, 3.44, 4.13, 4.81, 5.50, 6.19, 6.88)
PressureMaxs  = Array("", 2.77, 3.46, 4.15, 4.83, 5.52, 6.21, 6.90)
PressureVals  = Array("", 2.76, 3.45, 4.14, 4.82, 5.51, 6.20, 6.89)

 

The script applies the TorqueOffsets to the "Torque 1" channel in each Raw Group

Call CorrectOffsets("Torque 1", "Torque C", TorqueOffsets)

 

The script deletes any raw channels not needed for the analysis and reporting (you will probably want to add to or remove from this list)

Call DeleteChannel("Time(s)")
Call DeleteChannel("Flow 2")
Call DeleteChannel("Motor Temperature")
Call DeleteChannel("Oil Temperature")
Call DeleteChannel("Pressure 2")
Call DeleteChannel("Pressure LPC")
Call DeleteChannel("Torque 1")
Call DeleteChannel("Torque 2")

 

The script concatenates all the raw data Groups into the first Group, renaming it "ConcatResult"

Call ConcatGroups("ConcatResult")

 

The script renames the concatenated Channels in the first Group as you indicated

ChnName("[1]/Motor Speed Feedback") = "Speed"
ChnName("[1]/Line Pressure") = "Pressure"
ChnName("[1]/Torque C") = "Torque"

 

The script creates the new calculated channels as you indicated, using ANLYSIS functions instead of the Calculator

Call ScaleCalcChannels("VoEff",    "Flow",     "/", "Speed", 100/(16.5/1000), 0)
Call ScaleCalcChannels("MeEff",    "Pressure", "/", "Torque", 10000*16.5/(2000*Pi), 0)
Call ScaleCalcChannels("PowerIn",  "Torque",   "*", "Speed", 1/9.549, 0)
Call ScaleCalcChannels("PowerOut", "Flow",     "*", "Pressure", 100/60, 0)
Call ScaleCalcChannels("OvEff",    "PowerOut", "/", "PowerIn", 100, 0)

 

The script sorts all the concatenated Channels by the "Pressure" value on each row.  Then it finds the row ranges for each PressureMins(i) - PressureMaxs(i) range and sends those rows to a new Group called "Pressure = " PressureVals(i).  It then sorts the excerpted Channel values in the new PressureVals Group by the value of the "Speed" channel in each row of that Group.

Call CreatePressureGroups("Speed", "Pressure", PressureMins, PressureMaxs, PressureVals)

 

The script finally removes the first concatenated Group and then loads and configures a REPORT sheet for each remaining Channel in all the PressureVals Groups, with the exception of the "Speed" channel, which it only uses on the X axis of each graph.

Call Data.Root.ChannelGroups.Remove(1)
Call CreateReportSheets("Speed", CurrentScriptPath & "Concatenate By Pressures.TDR")

 

Ask as you have further questions,

Brad Turpin

DIAdem Product Support Engineer

National Instruments

 

0 Kudos
Message 11 of 23
(2,551 Views)

Hi Brad,

 

I think we're on the right track but the results are not quite what I need, but perhaps I did not explain clearly enough, or the history of where this is coming from.

 

We currently use an Excel macro to do much of this work create dby someone who has long left the company, but it's very awkward and prone to freezing up computers with higher log rate data sets, if it can load them at all. By only taking the subset of data I needed with ChanEventSearch I had hoped to bypass that problem, but your offer of help in creating a VBS script to do it all is much appreciated.

 

After gathering the data within the pressure windows I need to average the points based on the speed, to create the matrix of values that the graphs are generated from, rather than plotting all the points within the pressure windows on the graph.

 

The data here is what was used to generate the mechanical efficiency graph in my last post, and is something that I may need to generate to satsify customer requests. Each curve therefore represents pump performance over a range of speeds at a specific pressure

 

Data Table.JPG

 

 

Thanks again for the assistance,

Peter

0 Kudos
Message 12 of 23
(2,536 Views)

Hi Peter,

 

It's not a problem to average the final results we have so far to a desired set of Speed values, but how should/can the script know which Speed values are desired?  Is it the same Speed values every time?

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 13 of 23
(2,526 Views)

Hi Brad

 

The channels pre- concatenation each represent a steady speed - 400,500,600...1000

0 Kudos
Message 14 of 23
(2,524 Views)

OK Peter,

 

I decided not to try to determine the target speeds from the acquired speed data, but instead to add another array at the top of the script with the target speeds in them,  I then added a few lines to average the resulting values into those target speed bins.  Here's the result.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 15 of 23
(2,519 Views)

Hi Brad,

 

We seem to be only getting one value for speed/pressure instead of the required 7 values for speed per pressure, with the exception of 5.51 which is coming up with 2 speed points

 

Thanks

Peter

0 Kudos
Message 16 of 23
(2,513 Views)

Hi Peter,

 

That's right, that's what's in the data you sent me.  Each Groups's "Motor Speed Feedback" channel has values centered around one of the speed bins you requested.  I assumed you had different data you could run the script on.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 17 of 23
(2,507 Views)

Hi Brad,

 

Each speed has a pressure range from 0-8+ Bar, so what I am searching for is the 7 pressure windows in each of those speeds and then creating the curves for flow, torque, power, etc at each pressure level across the speed

 

With Thanks

Peter

0 Kudos
Message 18 of 23
(2,504 Views)

Doh,

 

I checked back again and realized I had a parameter set to 1 when it should have been 0 in the ChnMultipleSort() command in line 97.  The result was that only the Pressure channel was sorted, not all the channels.  Grrr.

 

Now you get the curves you insisted were there,

Brad Turpin

DIAdem Product Support Engineer

Download All
Message 19 of 23
(2,502 Views)

Perfect, exactly what I need!

0 Kudos
Message 20 of 23
(2,497 Views)