DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Reaktion auf steigende Flanke

Verstehe...
In diesem Fall fällt mir keine andere Lösung ein, als die Analyse mit einem Script zu erledigen.
So zum Beispiel:

'-------------------------------------------------------------------------------
'-- VBS script file
'-- Created on 18.07.2007 08:32:37
'-- Author: National Instruments, Ingo Schumacher
'-- Comment: mathematic channel filter:
'--          remaining values : cDat < 1000 on rising slope while cTrig = 1
'-------------------------------------------------------------------------------
Option Explicit  'Forces the explicit declaration of all the variables in a script.
dim cTr  : cTr  = 2 ' trigger channel
dim cDat : cDat = 3 ' data channel
dim cRes : cRes = cNo(chnalloc(cn(cDat)&"_filtered",cl(cDat))(0)) ' result channel
dim trStart, trStop, SigStart, SigStop
dim trig, i

'initialise result channel
for i = 1 to cl(cDat)
  chdx(i,cRes) = NoValue
next
cl(cRes) = cl(cDat)

TrStart = 1
SigStart = 1
do
  ' find area wher cTrig = 1
  TrStart = chnfind("ch("&cTr&")>0",TrStart)
  if TrStart > 0 then 'Starttrigger found?
    TrStop = chnfind("ch("&cTr&")<=0",TrStart) : if TrStop = 0 then TrStop = cl(cTr)
 
    trig = chnfind("ch("&cDat&")<0.01",SigStart) 'Find Signal Start (Signal is almost 0)
    if trig < TrStop then ' test if there is a valid signal in cDat
      SigStart = trig
      SigStop = chnfind("ch("&cDat&")>1000",SigStart) : if SigStop = 0 then SigStop = cl(cDat)
      datablcopy cDat, TrStart, SigStop-TrStart, cRes, TrStart
      SigStart = SigStop ' Prepare for next search
    end if
    TrStart = TrStop ' Prepare for next search
  end if
loop while TrStart > 0 and TrStop < cl(cTr)


Ingo Schumacher
Systems Engineering Manager CEERNational Instruments Germany
0 Kudos
Message 11 of 11
(1,152 Views)