DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I find the specific channel name and modify channel name in automatically in VBS?

How can I find the specific channel name and modify channel name in automatically in VBS? (DIAdem 9.1)
 
I would like to change channel name = "speed01" ... "speed10"  to  channel name = "velocity01"..."velocity10.
 
 
martino
0 Kudos
Message 1 of 4
(4,772 Views)
Hello Martino,

this script will help:

Option Explicit

Dim i
Dim n

For i=1 To 10
  If i < 10 then
    n = CNo("speed0" & i)
  Else
    n = CNo("speed" & i)
  End If

  If n > 0 Then
    If i < 10 then
      ChnName(n) = "velocitiy0" & i
    Else
      ChnName(n) = "velocitiy" & i
    End If
  End If
Next



Matthias
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
Message 2 of 4
(4,762 Views)
Hello Matthias,
 
Thansk for your kind help.
It was very helpful me.
 
If the channel name is random, how to make a loop in VBS ?
For example, ChnName = AC , ChnName = PS and ChnName=DS ...etc
to change ChnName = Acceleration, ChnName=Pressure and ChnName=Displacement ... etc
 
Thanks
 
Martino,
 
0 Kudos
Message 3 of 4
(4,748 Views)
Hello Martino,

assuming you have a fixed list of name pairs this script will help:

Option Explicit

Dim i
Dim n
Dim SourceNames
Dim DestNames

SourceNames = Array("AC", "PS", "DS" )
DestNames   = Array("Acceleration", "Pressure", "Displacement" )

For i=0 To UBound(SourceNames)
  n = CNo(SourceNames(i))

  If n > 0 Then
    ChnName(n) = DestNames(i)
  End If
Next


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