Chdx + ChnNovHandle - only working on the third call?

Hi,
I'm trying to reduce the amount of values of a digital channel, recorded with a high sampling rate. Values are either 0 or 20.
1. I am setting all Values, where nothing happens, chdx(i,4) = NoValue.  (This part is working - at least it looks like so / even though some Members would probably suggest to use "IsNull")
2. Then delete the rows with ChnNovHandle.
Problem:
I have to call "ChnNovHandle" multiple times to make it work ! Why ? (Two times, sometimes three...)
First time nothing happens? Or can't I see it, do I need another page refresh than "call ChnCharacterAll "
Sometimes I do have the impression as if I had to wait some longer to make "ChnNovHandle" work.
When changing to chd(i,4) = NoValue instead of "chdx" calculating takes much longer but  "ChnNovHandle"  works on the first go.
Can someone show me the point I am missing?
Laenge=CL("Zeitkanal DIO")
'Call MsgBoxDisp ("Länge Zeitkanal : "&Laenge)        ' zur Überprüfung
call Schleife
call Schleife ' 3mal aufrufen, da beim ersten Mal "ChnNovHandle" nicht funktioniert  ?????!!!!!!!!
call Schleife ' 3mal aufrufen, da beim ersten Mal "ChnNovHandle" nicht funktioniert  ?????!!!!!!!!
Sub Schleife '--------------------------------------------------------------------------------------------
Check1 = True
Check2 = True
Check3 = True
Check4 = True
i=1
For i=1 to Laenge
    if chdx(i, 5) = chdx(i+1, 5) and (chdx(i, 5) = chdx(i-1, 5) or chdx(i-1, 5) = 9.9E+34) then          ' 9.9E+34 = NoValue
    check1 = True
    else
    check1 = False
    End if
    if (check1 = True) and (check2 = True) and (check3 = True) and (check4 = True) Then
    chdx(i, 4) = NOVALUE                             ' Es reicht hier den Steuerkanal auf "Novalue" zu setzen - Ausgehend davon dann die ganze Zeile löschen !
    else
    End IF
next
call ChnNovHandle(4, "5-8", "Delete", "X", 1)
call ChnCharacterAll                                   ' aktualisieren der Kanal-Eigenschaften?
Laenge=CL("Zeitkanal DIO")
Call MsgBoxDisp ("Fertig : "&Laenge)        ' zur Überprüfung
End Sub 'Schleife --------------------------------------------------------------------------------------------
Thanks,
Frank
Windows XP, Diadem 8.1.1292
Attachment: Full Skrip and sample Data
Attachments:
Frank_DIO_kuerzen_C.zip ‏347 KB

Hi Frank,
Sorry, I missed the "DIAdem 8.1" reference that you had in the footer of your email.  I had all kinds of functions in there that were added in DIadem 9.x or DIAdem 10.x.  I believe I now have them all rooted out and that the following will run in DIAdem 8.1:
OPTION EXPLICIT
Dim i, DeltaThresh, TimeCh, DigChs, DeltaCh1, DeltaCh2, Length, NewTimeCh, NewDataCh
DeltaThresh = 10
TimeCh = "Zeitkanal DIO"
DigChs = Array("", "DO1", "DO2", "DI1", "DI2")
L4 = CNo(TimeCh)
Call FormulaCalc("Ch('Delta1'):= Ch(L4)")
DeltaCh1 = CNo("Delta1")
Call FormulaCalc("Ch('Delta2'):= Ch(L4)")
DeltaCh2 = CNo("Delta2")
Length = ChnLength(TimeCh)
FOR i = 1 TO UBound(DigChs)
  Call ChnDeltaCalc(DigChs(i), DeltaCh1)
  Call ChnAreaInsert0(DeltaCh1, 1, 1)
  ChDX(1, DeltaCh1) = ChDX(2, DeltaCh1)
  Call ChnDeltaCalc(DeltaCh1, DeltaCh2)
  ChnLength(DeltaCh2) = Length
  ChDX(Length, DeltaCh2) = ChDX(Length, DeltaCh2)
  L1 = DeltaCh1
  L2 = DeltaCh2
  L3 = CNo(DigChs(i))
  R1 = DeltaThresh
  Call FormulaCalc("Ch('NewTime'):= Ch(L4)")
  Call FormulaCalc("Ch('NewData'):= Ch(L3) + NoValue*((abs(Ch(L1))<R1) AND (abs(Ch(L2))<R1))")
  NewTimeCh = CNo("NewTime") : ChnName(NewTimeCh) = ChnName(TimeCh) & " " & ChnName(DigChs(i)) & " Events"
  NewDataCh = CNo("NewData") : ChnName(NewDataCh) = ChnName(DigChs(i)) & " Events"
  ChDX(1, NewDataCh) = ChD(1, DigChs(i))
  ChD(Length, NewDataCh) = ChD(Length, DigChs(i))
  Call ChnNoVHandle(NewTimeCh, NewDataCh, "Delete", "XY", 1, 0)
NEXT ' i
Call ChnDel(DeltaCh2)
Call ChnDel(DeltaCh1)
Let me know if I missed one, I don't have DIAdem 8.1 here handy to test with,
Brad Turpin
DIAdem Product Support Engineer
National Instruments

Similar Messages

  • JFileChooser:  setFileName on the UI only works at the first call

    The file name on a JFileChooser extension with two customized file filters is set by the code below when it is called. When the filter is changed by the user, the file name disappears.
    BasicFileChooserUI ui = (BasicFileChooserUI)this.getUI();
    ui.setFileName(NameSuggestion);
    An attempt to restore the name with a listener is not working:
    public void propertyChange(PropertyChangeEvent e) {
    if (e.getPropertyName().equals("fileFilterChanged")) {
    BasicFileChooserUI ui = (BasicFileChooserUI)this.getUI();
    ui.setFileName(NameSuggestion);
    Is it really not working or the name is being erased after the set?
    Thanks.

    Please?

  • Hello all,  I bought an iPhone 5 in the US and brought it back to Brasil. Now I'm trying to use Siri, but once I press the "home" button "voice control" appears and it only works for me to call my contacts. The manual guide tells me to go to Settings Gene

    Hello all,
    I bought an iPhone 5 in the US and brought it back to Brasil. Now I'm trying to use Siri, but once I press the "home" button "voice control" appears and it only works for me to call my contacts. The manual guide tells me to go to Settings>General>Siri. At the General menu "Siri" doesn't appear. What should I do to set Siri up if it doesn't appear at settings>general?
    Thank you,
    Melanie.

    Go to Settings>General>Restrictions and make sure Siri is set to On.

  • I would like to run a stock analysis program called Toolkit 6 on my Macbook Pro, but it only works on the Windows platform.  Is there software that allows me to run Windows applications on the Mac?

    I would like to run a stock analysis program called Toolkit 6 on my Macbook Pro, but it only works on the Windows platform.  Is there software that allows me to run Windows applications on the Mac?

    Yes it's MS Windows! You will need a license of MS Windows (preferable Windows 7) and from there you can decide on the strategy for running Windows on your iMac. You can use Boot Camp (you already have this) or you use virtualization software such as Parallels or Fusion. For your situation I'd recommend virtualization software. However for only one program I'd do some due diligence to see if there is a OS X version. You can start with the App store or simply use Google to search.
    Kappy has provided a good article on running Windows on a Mac and the various options. Here is the link:
    Kappy's explanation
    Roger

  • My ringer only works for the phone ringer. It is silent on all other functions. Anyone experience this before? All settings are correct.

    My ringer only works on the phone. All other functions are silent and the ringer increase button does not add volume.

    Had this happen today and 2X past as you discribed. A reboot (turn phone off and on) restored all sounds for me. The first time I can't associate w/ a cause but the second and third were just after listening to a podcast using the apple podcast app - the only app available for that. That's my story and for now I'm sticking to it.

  • Why does Do Not Disturb only work when the iPhone is locked?

    I've been wanting for awhile now a way to easily turn off all notification alerts and incoming calls while keeping cellular data and wi-fi on so I can use my phone in peace without gimping my wireless connections, and even though iOS 6 as a whole seems awesome to me, I'm disappointed Do Not Disturb only works when the iPhone is locked.

    Was just wondering if other people felt the same way I do and start a discussion about it so maybe that with more people talking about it, Apple would pay attention to it more. People complaining about how calls and alerts were lighting up their screen at night seems to be some inspiration to why Apple added Do Not Disturb in the first place. Didn't know I was doing anything in violation of the Terms of Use so sorry about that.

  • With my i phone 4 , the Push notifications doesn't work for apps like (fb viber , whatsapp etc ) it only works for the official apps like message  even when im using the phone, has  this probleme with the iOs 6.0.1 and also with the iOs 6.1

    With my i phone 4 , the Push notifications doesn't work for apps like (fb viber , whatsapp etc ) it only works for the official apps like message  even when im using the phone, has  this probleme with the iOs 6.0.1 and also with the iOs 6.1

    This isn't an issue. Notice the screen prior to the one that shows usage has an iCloud section and a Manage Storage button. For this button to activate ios needs to download a few kb from icloud. Switching back to this screen forces ios to download those few kb.

  • I don't know what's wrong with my camara it's all black and the front only works not the back

    I don't know what's wrong with my camara it's all black and the front only works not the back

    Try This...
    Close All Open Apps... Sign Out of your Account... Perform a Reset... Try again...
    Reset  ( No Data will be Lost )
    Press and Hold the Sleep/Wake Button and the Home Button at the Same Time...
    Wait for the Apple logo to Appear...
    Usually takes about 15 - 20 Seconds... ( But can take Longer...)
    Release the Buttons...

  • Flash Player only works for the account that downloaded it

    I downloaded flash player and did not specify any special preferences, however, it doesn't work for the 2 other accounts on the computer.  It only runs for the Administrator account from which i downloaded it. I'm running XP professional. Can someone tell me how to fix this?

    hi, i had already deleted cookies, temp internet files, etc;
    i only have the IE pop up blocker and blocking level set at Medium;
    it's the latest version of FP 10.0.45.2.
    I installed this version a couple of weeks ago and it worked ok for all accounts (the other 2 accounts are not admin) for a week. Then, it stopped working for all accounts, i reinstalled it (some trial and error involved), then when it finally reinstalled, only works for the one account. i just tried to reinstall from one of the other accounts and error mssg said  "failed to register"
    Date: Sun, 6 Jun 2010 11:20:59 -0600
    From: [email protected]
    To: [email protected]
    Subject: Flash Player only works for the account that downloaded it
    Hi ol, I would go to Tools, click on Internet Options and clear the Temp files. Delete Cookies, Delete Files, including the off line content. I would do this using all accounts. Also check the history files while you are there and delete those also unless you have done so recently.
    What version of Flash Player do you have Installed?
    Do you use any adblock or pop up blocker software?
    Thanks,
    eidnolb
    >

  • I purchased a new vehicle with a USP port but my nano model A199 will not work, only works with the aux plug which will not allow me to view the songs on the vehicle touchscreen. Is there a download I can get to put into this nano?

    I purchased a new vehicle and the older ipod nano I have will not work through the USP  port, only works through the aux plug. Is there a download i can get toput into the nano that will then allow me to use the USP port instead of the aux port?

    Check with your dealer and see if there is a special cable available for connecting your iPod. It should have a dock connector on one end and USB and miniplug on the other.

  • Including image in SharePoint survey answer and hiding elements only work on the first page

    Hi All,
    I would like to add some text/remove some text etc on a sharepoint survey page.
       Which i have done using jquery/jscript.
    But unfortunately it only works on the first page.
    Any ideas how i can get it to work on all the pages?
    See a sample here on how you can add the scripts:
        http://sharepointkings.blogspot.com.au/2011/05/include-image-in-sharepoint-survey.html
    Cheers

    Hi Patrick, does the first page use the same ASPX file as the other pages? If not, you will need to add your jquery/jscript to the other page as well.
    Dimitri Ayrapetov (MCSE: SharePoint)

  • The CustomDatumExample.java only works if the Employee object has 2 attributes.

    The CustomDatumExample.java only works
    if the Employee object has 2 attributes -
    (EmpName and EmpNo). If I try to add
    another attribute to the Employee object I get java.lang.ArrayIndexOutOfBoundsException: 2 on the getAttr3 method.
    Anyone know why? Thanks.
    Employee object
    CREATE TYPE employee AS OBJECT
    (empname VARCHAR2(50), empno INTEGER,
    attr3 VARCHAR2(50));
    Custom object class
    public class Employee implements CustomDatum, CustomDatumFactory
    public static final String SQLNAME = "EMPLOYEE";
    public static final int SQLTYPECODE = OracleTypes.STRUCT;
    MutableStruct _struct;
    static int[] _sqlType =
    12, 4
    static CustomDatumFactory[] _factory = new CustomDatumFactory[3];
    static final Employee _EmployeeFactory = new Employee();
    public static CustomDatumFactory getFactory()
    return _EmployeeFactory;
    /* constructor */
    public Employee()
    struct = new MutableStruct(new Object[3], sqlType, _factory);
    /* CustomDatum interface */
    public Datum toDatum(OracleConnection c) throws SQLException
    return struct.toDatum(c, SQL_NAME);
    /* CustomDatumFactory interface */
    public CustomDatum create(Datum d, int sqlType) throws SQLException
    if (d == null) return null;
    Employee o = new Employee();
    o._struct = new MutableStruct((STRUCT) d, sqlType, factory);
    return o;
    /* accessor methods */
    public String getEmpname() throws SQLException
    { return (String) _struct.getAttribute(0); }
    public void setEmpname(String empname) throws SQLException
    { _struct.setAttribute(0, empname); }
    public Integer getEmpno() throws SQLException
    { return (Integer) _struct.getAttribute(1); }
    public void setEmpno(Integer empno) throws SQLException
    { _struct.setAttribute(1, empno); }
    public String getAttr3() throws SQLException
    { return (String) _struct.getAttribute(2); }
    public void setAttr3(String attr3) throws SQLException
    { _struct.setAttribute(2, attr3); }
    }

    You also need to add an appropriate element to the _sqlType array.
    In practice, it is easiest to have JPublisher regenerate the CustomDatum class when you have changed your object type definition:
    jpub -user=scott/tiger -sql=EMPLOYEE:Employee

  • I have a touchscreen laptop running Windows 8.1. Is it possible to use the touchscreen with Firefox? I've installed Firefox but it only works with the mouse etc

    have a touchscreen laptop running Windows 8.1. Is it possible to use the touchscreen with Firefox? I've installed Firefox but it only works with the mouse etc

    Hello Sirving575, sorry but the metro version of firefox has been cancelled, see : https://blog.mozilla.org/futurereleases/2014/03/14/metro/
    thank you

  • 'On open' only works in the same folder?

    I'm running an 'On open' script but it only works when the folder to be processed that placed onto the AS is in the same folder.
    Is there a workaround?

    I'm not familiar with ImageMagick, but there are a couple of issues with your script.
    1) The on open handler takes the files dropped on the application as it's arguments, but you are using the Finder's currently selected items.
    2) File paths that might contain spaces should be quoted, or your shell script will break when it tries to do something with the space delimited items.
    If you are just trying to create a text string that contains all of the (selected or dropped) items, something like the following should work (I just used a dialog to show what the shell script would be - you should test before using mogrify on original files):
    Finder selection:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #FFDDFF;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    set upath to ""
    tell application "Finder" to repeat with f in (get selection)
    set chosenfile to quoted form of POSIX path of (f as text)
    set upath to upath & chosenfile & space
    end repeat
    display dialog "do shell script " & "/opt/local/bin/mogrify -format jpg " & upath & "*.psd"
    beep 2
    </pre>
    on open handler:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #FFDDFF;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    on open TheItems
    set upath to ""
    repeat with f in TheItems
    set chosenfile to quoted form of POSIX path of (f as text)
    set upath to upath & chosenfile & space
    end repeat
    display dialog "do shell script " & "/opt/local/bin/mogrify -format jpg " & upath & "*.psd"
    beep 2
    end open
    </pre>

  • Adjustment brush is only working on the outer edge of all of my photos, why?

    I've just downloaded LR 4, watched tutorials but my adjustment brush only works on the outer edge of my photos.  The brush changes to an arrow when I move towards the center of the photo.  Why?

    Thank you so much.
    I took this and wrapped it all in an if statement.
    Since Liability_Continued was my master page, the script ended up looking similar to this:
    if (xfa.datasets.data.job.data.state.value == "NY"){
    var oMaster = xfa.resolveNodes("Liability_Continued");
    for (var i=0; i<oMaster.length; i++)  {
         oMaster.item(i).footer.liabilityFooterBig.presence = "visible";
         oMaster.item(i).footer.liabilityFooter.presence = "invisible";

Maybe you are looking for

  • PDF form text fields' options change when opened in READER on a MAC.

    I created a PDF form using Adobe X PRO. All fields are UNCHECKED for Property/Options/ "scroll long text". I save and distribute the form as a "reader extended pdf/enable additional features" so it can be saved and returned using READER. When a Mac u

  • Video Card Compatibility

    Hi, I am trying to add a new MSI video card to my Envy H8-1414 desktop. This is the card: http://us.msi.com/product/vga/N660_Gaming_2GD5OC.html#overview When I add the card with the OEM PSU, I get 6 long beeps. I added a 550 W PSU and the beeps go aw

  • CAN ANYBODY PLEASE HELP ME???

    Okay, I'm in this AP Computer Science class where I don't understand ANYTHING and my mom won't take me out of it because she thinks "it will help me in the future"(even though I'm going to be a doctor). So can somebody please help me write a program

  • Qos DSCP value 46 gone, after enabling Remote Desktop Services on Windows 2012 R2 Standard

    Hi, After installing a clean Windows Server 2012 R2 with all Windows updates I have setup Policy-Based QoS for tagging defined traffic, in the test case all traffic to one specific ip address. Whireshark logging displays the correct configured (46) d

  • Multi-PDF to PSD

    I have been searching for an hour and can not find an anwer to this. My understanding is ther was an automated task that would open and save a multi-page pdf into photoshop documents. This is not an option in CS3. Did they move it or rename it? What