DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make DataPlugin that create wavefrom

Solved!
Go to solution

I would like a Data Plugin for a custom data format. Example of data follows: 

$ (name) some_name_1
$ (id) 1
$ (Color) 1.000000 0.000000 1.000000
$ (X axis) time [ms]
$ (Y axis)                 [kN]                
  0.00000000E+00 ,  -4.30788916E-09
  1.0112.999E-01 ,  -2.26056017E-02
  4.99011459E+01 ,   3.88890062E-23
  5.00010223E+01 ,   2.55677929E-23
$ (name) some_name_2
$ (id) 2
$ (Color) 1.000000 0.000000 0.000000
$ (X axis) time [ms]
$ (Y axis)                 [mm]                
  0.00000000E+00 ,   4.53233423E-10
  1.01121999E-01 ,  -2.85587949E-03
  4.99011459E+01 ,   7.13293237E-24
  5.00010223E+01 ,   2.88725773E-23
$ (name) some_name_3
$ (id) 2
$ (Color) 1.000000 0.000000 0.000000
$ (X axis) time [ms]
$ (Y axis)                 [g]                
  0.00000000E+00 ,   4.53233423E-10
  1.01121999E-01 ,  -2.85587949E-03
  4.99011459E+01 ,   7.13293237E-24
  5.00010223E+01 ,   2.88725773E-23
*END

 

 

File always come with bunch of channels. Channels allways have two column - time and values.

 

I have working Data Plugin whitch loads the data for me, but I have plenty of useless time channels. So I would like to create a waveformat channels rather than set of double numeric.

 

Easy approach that I just add waveform properties doesn't work.

 

Please how can I create waveform from this data format?

 

The code, that I'm using is attatched

 

Thank you.

Radek

0 Kudos
Message 1 of 4
(4,320 Views)
Solution
Accepted by topic author Radek_Codr

Hi Radel_Codr,

 

the approach to add waveform properties is the correct one.

One important property is missing. Please see below the list of available Properties for Waveforms and its data types:

call ChnValues.Properties.Add("wf_samples", CLong(1))
call ChnValues.Properties.Add("wf_increment", CDbl(0.1))
call ChnValues.Properties.Add("wf_xname", "time")
call ChnValues.Properties.Add("wf_xunit_string", "ms")
call ChnValues.Properties.Add("wf_start_time", CreateTime(2015,8,12,12,10,0))
call ChnValues.Properties.Add("wf_start_offset", CDBl(0.1))

Except "wf_samples" all properties are optional. Please follow the explicit data type conversion for the property values.

 

Starting with our 2015 release channels support a new function to add waveform properties, which simplify the creation of waveform channels.

0 Kudos
Message 2 of 4
(4,296 Views)

Thank you, that really solved my problem.

Is there any documentation about that (creation waveforms using xf_samples property)?

0 Kudos
Message 3 of 4
(4,255 Views)

Hi Radek,

 

DIAdem 2015 introduced the "AddWaveformProperties()" method to the Channel object in VBScript DataPlugins.  This new function is documented in the DIAdem Help system.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 4 of 4
(4,233 Views)