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.
06-20-2017 09:22 PM
I'm trying to create Pressure and Volume plots for cylinder pressure data.
The pressure data comes in with 216,000 data points (720 samples over 300 engine cycles)
The volume data comes in with only 720 samples. The volume simply repeats every 720 degrees, and doesn't change. (Think of it as simply 2 cycles of a sine wave).
What is the best way to plot this x-y data? I'm looking for speed. Does Diadem have a "block mode" where it recognizes that every 720 samples of the pressure data corresponds with the volume data? Or should I simply extend the 720 samples of volume data out 300 times? Seems like that would be slow.
Solved! Go to Solution.
06-21-2017 01:05 AM
Hi RussellSenior,
To plot the pressure data against the volume data, both channels must have the same length. Therefore you can extend the volume channel and append for each cycle the 720 samples. Please have a look at the script (which takes on my PC 0.1 sec.):
dim iLoop, iNoOfCycles, oChnSource, oChn iNoOfCycles = 300 set oChnSource = Data.Root.ChannelGroups(1).Channels("Test") set oChn = Data.Root.ActiveChannelGroup.Channels.Add("NewChn",DataTypeChnFloat64) oChn.ReservedSize = iNoOfCycles * oChnSource.Size for iLoop = 1 to iNoOfCycles call oChn.SetValuesBlock(oChnSource.GetValuesBlock(1, oChnSource.Size, eValueBlockVbArray) ,oChn.Size + 1, eValueBlockValueInsert) next
Greetings
Walter
06-21-2017 08:41 AM
SetValuesBlock appears to be a Diadem 2015 addition, yes? I'm still on 2014, since my add-on is not yet compatible with 2015's bar manager. So, am I stuck with DataBlCopy until I finally update to 2015?
06-21-2017 10:28 AM
Hi Russell,
You can use the old DataBlCopy() command instead.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
06-21-2017 10:34 AM
Thanks!
On the same vein, if I am plotting 300 cycles of engine data on a P-V plot, how could I view only one cycle, or a block of data? Say I want to view cycle 45, so I would like to view only samples 32,400 through 33,120 on both the pressure (y-axis) and volume (x-axis) plots?
06-21-2017 01:50 PM
HI Russell,
I'm afraid the only solutions are to scale the X axis to just that value range or to extract that value range from the X and Y channels and put them into new, much smaller Xcyc and Ycyc channels that you then plot.
Brad Turpin
DIAdem Product Support Engineer
National Instruments