Jump to content

attila

Technical Forum Moderator
  • Posts

    6,649
  • Joined

  • Last visited

Posts posted by attila

  1. Hi @m72

    Thank you for the observation.
    This version expects a return in the last line or something that it can return... I wanted to have this rule for some (math, measurement...) scripts, unfortunately it is applied for all scripts in the app.
    This should work:

    // Find I2C devices
    // array to store the present adresses
    var rgadr = [];
    if(Clear()!=true)  return "I2C bus error. Check the pull-ups.";
    for(var i = 8; i < 120 && wait(); i++){
        //Write(address) return true when acknowledged
        var f = Write(i);
        if(f == true) rgadr.push("0x"+i.toString(16));
    }
    if(rgadr.length) return rgadr;
    return "No I2C device found";

     

  2. Hi @zelle

    With odd base the digital can be auto-set to lower rate than the analog and it takes more time for the digital to complete the capture. At higher base this difference can be significant and the instrument does not wait for the digital capture.
    Thank you for the observation. It will be fixed in the next version.
    (The bug was introduced when adding dual device support.)

    image.png

  3. Hi @zelle

    The inputs are saved as user selected after leaving the field or on enter. The "Digital" button does not have focus.
    If you select a trigger source and press the 'Digital' button the earlier selection does not get saved and last validated selection is loaded. After selecting a source press tab, enter or click in other place.
    This behavior will be corrected in the next version.

  4. Hi @sand

    The easier is to use Digital/StaticIO functions.
    For constant with DigitalOut use Counter 0|0 and specify (initial) value with CounterInit

    dwf.FDwfDigitalOutEnableSet(hdwf, channel, 1)
    # dwf.FDwfDigitalOutIdleSet(hdwf, channel, DwfDigitalOutIdleInit) # default value
    dwf.FDwfDigitalOutCounterInitSet(hdwf, channel, 1, 0) # 1 = initialize with high when running
    dwf.FDwfDigitalOutCounterSet(hdwf, channel, 0, 0) # low/high count zero, no toggle during run, constant

×
×
  • Create New...