DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

name of channel

Solved!
Go to solution

Hello,

 

I've not gone near DIAdem for a while, and now am sat here confused over something which is probably pretty simple.

 

In part of my script, I want it to go through all my channels, and greate a separate group with the name of the original channel... then I will go through and do some more advanced analysis in each group. The part which is causing problems is creating the groups in the first place.

 

I have something like this:

 

dim x

 

for x=2 to GroupChnCount(1)

    Call GroupDefaultSet(1)
    nameofgroup=ChnNameGet(x)
    Call GroupCreate(nameofgroup,x)                
next

 

Yet all I get is "Variable is undefined: 'ChnNameGet'

 

What am I doing wrong??????

 

Thanks!

0 Kudos
Message 1 of 18
(5,636 Views)

Hi xxxtomxxx,

 

Mainly you just had the order of the commands incorrect:

 

Dim x

FOR x = 2 to GroupChnCount(1)

  Call GroupCreate(ChnName(x))

  Call GroupDefaultSet(GroupCount)

' Run analysis that creates channels in this new Group

NEXT ' x

 

Brad Turpin
Ddem Product Support Engineer
National Instruments

Message 2 of 18
(5,627 Views)
Solution
Accepted by topic author xxxtomxxx

Hello Tom!

 

The error message is correct! There is no ChnNameGet command in DIAdem. You can use ChnName( CNoXGet(1, x)) to get what you want.

 

Matthias

Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
Message 3 of 18
(5,626 Views)

Hello Brad!

 

Does ChnName(x) works in all circumstances? I was told to use CNoXGet(...).

 

Matthias

Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 4 of 18
(5,616 Views)

Hi Matthias,

 

I'm flattered that you asked me a question 🙂

 

I used CNoXGet() very frequently in DIAdem versions prior to 11.0, but less so now that we have the Data.Root object.  With ChnName() and most "normal" DIAdem functions that take Channel references (string) as parameters, you can provide either a variant of subtype integer filled with the global Channel number or a variant of subtype string filled with the Channel reference.  The Channel reference usually contains the full Group/Channel path ("[1]/Revs"), but DIAdem will still also accept the older Channel only ("Revs") referencing.  When using either the global channel number (integer) or the Channel only (string) approach, you run the risk of not referencing the channel you really meant.  So if given the choice between that and using CNoXGet(GroupIndex, ChannelIndex), the CNoXGet() function is much more reliable and also particularly convenient for looping through all the channels of a particular Group.

 

Now in DIAdem 11.1, though, all the main DIAdem functions accept a Channel object variable in the parameter that used to accept the channel reference, so creating and using Group and Channel object variables has become the norm for me, like this:

 

Set Channel = Data.Root.ChannelGroups(1).Channels("Revs")

Call ChnSmooth(Channel, Channel, 50, "symmetric")

 

Brad Turpin

DIAdem Product Support Engineer
National Instruments

 

0 Kudos
Message 5 of 18
(5,590 Views)

Hey Brad,

I have a Problem aswell, i have attached the data below which includes the data to be evaluated and the vbscript. In the script how do I Count the number of sensors without manually giving in the number of sensors. The T and P infront of the sensors are the temperature and pressure readings. and  what do i do if for example one channel in missing

 

 

0 Kudos
Message 6 of 18
(3,337 Views)

Hi Ali,

 

Would you try to post your data file again?  All I see is your VBScript.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 7 of 18
(3,328 Views)

Hey Brad,

Sorry for that. I have uploaded the file, in this case I have to enter the number of 'sensors' manually, is there any way to automate this?

and in this case there are 5 files, each containing the pressure,temperature readings. The 5 files represent the temperature and pressure readings of the same sensors at different times, in some cases the sensor stops working and hence does not have a reading and therefore no corresponding channel for temperature and pressure, in this case if a channel for a sensor is missing in that particular file, how do I skip to the next Iteration so that it continues on for the other sensors and there corresponding pressure and temperature readings.

 

*The 'Gesamtdaten' at the end is 'adding' all the sensors so that I one Total data.

 

 

Thanks

0 Kudos
Message 8 of 18
(3,308 Views)

Hi Ali,

 

You sent me a zipped up TDX file.  Assuming this is the data part of the TDM/TDX file pair, I'm still missing the TDM header file, and there's no way I can load the binary values in the TDX file until I have the matching TDM file.

 

Sorry I didn't look at this sooner,

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 9 of 18
(3,155 Views)
0 Kudos
Message 10 of 18
(3,148 Views)