Jump to content

attila

Technical Forum Moderator
  • Posts

    6,956
  • Joined

  • Last visited

Posts posted by attila

  1. Hi @peter_a

    Please try a different cable, because such sudden errors are usually caused by contact problem, for example, loose connection, the plug is not fully inserted, slight difference is the socket dimensions, worn contacts in a way such the cable works with some devices but not with others...
    If it still doesn't work properly, 
    for warranty and replacement contact the support.digilent @ ni.com specifying the Date of Purchase, Seller and Purchase Order/ Web order Number. 

  2. Hi @TanTAH

    The Network Analyzer can use the AWG channels to generate sine wave sweep, but you can also select the 'external' option and use external stimulus signal or custom signal sweep from the same device Wavegen interface. For white noise you probably want to use the Spectrum interface or Scope/FFT view.

  3. Hi @Xavier

    Run the following script once to convert C2 from relative to absolute magnitude:
    (For the next software version I'll try to make the relative option dynamic)

    var c1 = Network.Channel1.magnitude; // in selected Unit
    var c2 = Network.Channel2.magnitude;
    var a = Network.Wavegen.Amplitude.value/sqrt(2); // for VRMS
    var n = c1.length;
    for(var i = 0; i < n; i++) c2[i] = c2[i]*c1[i]/a;
    Network.Channel2.magnitude = c2;

    image.png

  4. Hi @hrkzkb

    Your code seems to be good, TX and RX should be returned in rx[0] and rx[1]. and additional UARTs when enabled in rx[2,3]
    For printable text use Receives (string list) and for raw values use ReceiveArrays (2d numeric array)

    image.png

    image.png

    Protocol.UART.Receiver();
    if(1){
        while(wait(0.1)) {
            var rx = Protocol.UART.Receives(); // text
            var d = new Date();
            if (rx[0].length()) print("TX:"+d.toISOString()+":"+rx[0]);
            if (rx[1].length()) print("RX:"+d.toISOString()+":"+rx[1]);
        }
    }else{
        while(wait(0.1)) {
            var rx = Protocol.UART.ReceiveArrays(); // numeric
            var d = new Date();
            if (rx[0].length()) print("TX:"+d.toISOString()+":"+rx[0]);
            if (rx[1].length()) print("RX:"+d.toISOString()+":"+rx[1]);
        }
    }

     

  5. Hi @Maxpfeiff

    ...
    
    dwf.FDwfDeviceOpen(iDevice, byref(hdwf))
    
    if hdwf.value == 0:
        dwf.FDwfGetLastErrorMsg(szerr)
        print(str(szerr.value))
        dwf.FDwfDeviceCloseAll()
        sys.exit(0)
    
    rghdwf.append(hdwf.value)
    
    dwf.FDwfDeviceAutoConfigureSet(hdwf, 0)  # the instruments will only be configured when FDwf###Configure is called
    
    dwf.FDwfAnalogIOChannelNodeSet(hdwf, 0, 0, c_double(1))  # enable positive supply
    dwf.FDwfAnalogIOChannelNodeSet(hdwf, 0, 1, c_double(5.0))  # set voltage to 5 V
    dwf.FDwfAnalogIOChannelNodeSet(hdwf, 1, 0, c_double(1))  # enable negative supply
    dwf.FDwfAnalogIOChannelNodeSet(hdwf, 1, 1, c_double(-5.0))  # set voltage to -5 V
    dwf.FDwfAnalogIOEnableSet(hdwf, 1)  # master enable
    dwf.FDwfAnalogIOConfigure(hdwf)  # apply
    
    ...

     

  6. 8bit format stores 8 DIOs or DINs, 16bit -> 16, 32bit -> 32, 64bit -> all 48 channels
    With FDwfDigitalInInputOrderSet 0 the samples bits represent: 8bit DIN[7:0], 16bit DIN[15:0], 32bit DIO[31:24]DIN[23:0], 64bit DIO[39:24]DIN[23:0]
    with 1: 8bit DIO[31:24], 16bit DIO[39:24], 32bit DIN[15:0]DIO[39:24], 64bit DIN[23:0]DIO[39:24]

×
×
  • Create New...