DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

ChnAttrTxt

Hallo,

 

I'm trying to export custom channel properties with DIAdem 10.2 as strings. As far as I see, ChnAttrTxt1 and ChnAttrTxt2 are supposed to do the job. IN The exported DAT files, ChnAttrTxt1 however maps to channel property 300 which - according to the DAT file specification - is not a free text custom property. ChnAttrTxt2 is mapped to channel property 301 - which in my application is already in use.

I don't see any option to access channel property 302 which is also supposed to be a custom string property.

 

Can somebody enlighten me on how to set channel property 302 for DAT file export in DIAdem 10.2 ?

 

Thanks,

 

Steffen

0 Kudos
Message 1 of 5
(3,744 Views)

Hi Steffen,

 

The DIAdem global variable ChnAttrTxt1(1) certainly does programmatically read and write the free text channel property that corresponds to the DAT file channel code 300.  It is absolutely a string property you can use to store any string you want.  I tested this in DIAdem 11.1 and it worked great.  Note that this variable is an array variable, so you need to provide the correct channel number (1) in the array variable's argument so that your desired string property values is assigned to the correct channel.

 

#BEGINCHANNELHEADER
200,Channel
210,IMPLICIT
220,0
240,0
241,0
260,Numeric
261,1
262,0
263,0
265,0
300,hello!
#ENDCHANNELHEADER

 

Note that modern versions of DIAdem hide these old DAT file channel attribute properties by default, though you can change the global setting to see them again.  Also, I assume there is a reason you need to export to DAT file, right?  If not, you should really consider switching to using a TDM file-- then you can create as many string properties as you want and actually name them yourself.

 

Ask if you have additional questions,

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 2 of 5
(3,728 Views)

Hi Brad,

 

thank you for your answer.

Yes, there is a reason for using old-fashioned DAT-files. It is a mandatory requirement 😉

 

I can access properties 300 and 301 with the ChnAttrTxt1(i) and ChnAttrTxt2(i), but they are already in use for other information. So I would like to access property 302, which should also be a free text property, but I can't figure out how to access property 302 from a VBS script.

 

Steffen

0 Kudos
Message 3 of 5
(3,723 Views)

Hi Steffen,

 

I'm afraid you're simply running up against the limitations of the DAT file format.  There are only 2 channel text properties supported by the DAT file format.  It is true that there are 3 base model channel string properties that appear in the Data Portal in older DIAdem versions.  You can even address the third of these properties with the following commands:

 

 

Call ChnPropValSet(1, "RegisterTxt3", "Boo")

MsgBox ChnPropValGet(1, "RegisterTxt3")

 

 

But although this "RegisterTxt3" property is now set in DIAdem and will be written to TDM or TDMS and read back from TDM or TDMS, it will neither be written to DAT file, nor will it be read from DAT file (I tried manually editing the *.DAT header file-- no luck).

 

There are only 2 channel text property array variables,

 

ChnAttrTxt1(1)

ChnAttrTxt2(1) 

 

There is no corresponding "ChnAttrTxt3()" variable because this property is not supported by the DAT file format.  The only remaining channel string properties supported in the DAT format are the channel unit and channel comment properties, which you can address with the following variables:

 

ChnDim(1)

ChnComment(1)

 

Brad Turpin

DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 4 of 5
(3,706 Views)

Hi Brad,

 

thanks for checking again.

 

I will have to accept that it is a DAT-file limitation, so I'll find another way to export my additional channl information. 

 

Steffen 

0 Kudos
Message 5 of 5
(3,694 Views)