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.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Add channel property as DataTypeFloat64

Hi, I would like to ask about how can I create a Diadem property as a DataTypeFloat64.

 

I tried something like, following example, but It not works:

Dim prop
Set prop = Data.Root.ChannelGroups("Measurement").Properties
Call prop.Add("__w001_AverageVoltage", 0,DataTypeFloat64)

2019-03-12_14-09-44.png

THX for help.

0 Kudos
Message 1 of 4
(2,374 Views)
Call Data.Root.ChannelGroups("Measurement").Properties.Add("__w001_AverageVoltage", 0, DataTypeFloat64)
0 Kudos
Message 2 of 4
(2,349 Views)

Hi steelbull,

Your script code works fine with my DIAdem (tested in version 2018, 2017 and 2015). I’m pretty sure the problem is not the property setting itself. To find the error I need more script content.

Greetings

Walter

0 Kudos
Message 3 of 4
(2,343 Views)

Current DIAdem versions seems to be O.K. with your code.

 

Option Explicit

Dim prop
Set prop = Data.Root.ChannelGroups(1).Properties
Call prop.Add("__w001_AverageVoltage", Cdbl(0),DataTypeFloat64)

will convert your integer to double which the error seems to complain about.

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