10-24-2006 04:18 PM
10-25-2006 02:31 PM
Hi jcbalding,
This is one of those things you never could come up with yourself, but once you have the function to copy from DataPlugin to DataPlugin, you stop thinking about entirely. Here's the function:
Sub CreateWaveform(ChannelObj, X_start, X_delta, X_name, X_unit)
ChannelObj.Properties.Add "wf_start_offset", X_start
ChannelObj.Properties.Add "wf_increment", X_delta
ChannelObj.Properties.Add "wf_xname", X_name
ChannelObj.Properties.Add "wf_xunit_string", X_unit
ChannelObj.Properties.Add "wf_samples", CLng(1)
ChannelObj.Properties.Add "wf_time_pref", "relative"
ChannelObj.Properties.Add "wf_start_time", CreateTime(0,1,1,0,0,0,0,0,0)
End Sub ' CreateWaveform()
Note that DIAdem studiously avoids reading the "wf_start_time" property and always uses "relative" for the "wf_time_pref" property regardless of what value you assign above. LabVIEW, however, will accept the actual values you assign to these two properties. Note also that the "wf_start_time" property needs to be assigned either a DataPlugin time object (shown above) or a standard VBScript variant of subtype date/time. The "wf_samples" property should be filled with the length of the waveform if you know it, but it causes no problems to leave it set to 1 (shown above) regardless of the actual length. DIAdem will ignore this value, though LabVIEW users will thank you if you fill it correctly.
Regards,
Brad Turpin
DIAdem Product Support Engineer
National Instruments