Jump to content

Walid

Members
  • Posts

    12
  • Joined

  • Last visited

Posts posted by Walid

  1. Hi,

    I have an application where I would like to use the waveform generator in DC mode to software set a DC level within 1msec or less, but when I time it using Waveforms the response is very steppy and takes 100msec (see below). When using the power supply setpoint the response is much faster, but I require -5 to 5V range. Is there anyway to speed up this response, and what would be the time from the software command to set the DC value to the set point?

    Thanks,

    Walid

    image.png.9363e8563d22ae12a79539f356726e32.png

  2. I have an Analog Discovery 3 that I am trying to use with some software I wrote using the Analog Discovery 2, and have downloaded the latest SDK. The program is running analog input CH1 and CH2 continuously triggering on an arbitrary waveform from W1. Everything works fine with the AD2, but when switching to the AD3, data is only read once and then AnalogInStatus always returns 1 (it should return 2 when data is ready).

    nRet = FDwfAnalogInStatus(hdwf, 1, sts) 'with AD3, returns 3 first, then 2 and data can be read, then always stuck in 1 state 

    The only way I have been able to get the AD3 to continuously read is to reset the AnalogOutputConfigure on every iteration in order to get it to work, as shown below, but this creates a very loud "click" on each iteration and is definitely not the correct approach:

    nRet = FDwfAnalogOutConfigure(hdwf, -1, 3) 'restart analog output on CH1

    which is very strange as I have set the AnalogOutput trigger to none so I expect it to be running continuously and allowing CH1 to trigger on it.

    Is there any reason the behavior would be different with the AD3 than the AD2 with respect to the AnalogOutput running continuously? 

    I can add detailed example code if needed.

    Thanks,

    Walid         

  3. Hi,

    I just started working with the Analog Discovery 3 and noticed when changing gain ranges from 500mV/div to 1V/div (going from 5Vpk-pk to 50Vpk-pk) there is a rather loud "click" from what sounds like a mechanical switch (perhaps a reed relay?). I'm just wondering if this is normal behavior as it is silent when gain range changing on the AD2, and also if there is any lifetime issues with such a loud mechanical switch?

    Thanks,

    Walid 

  4. Hi,

    I've read that the actual sample rate for the AD2 is always 100 MSPS, but when a frequency of say 100 KSPS is used (1000X slower than the base rate), the FPGA averages the points to generate a point every 10 microseconds (when using the average filter). This would give 1000 points that could be averaged for each data point output by the FPGA, and with a 14-bit ADC, this oversampling and averaging should increase the resolution by N bits where 4^N=# averages (in this case 1000 would give nearly a 5 bit increase in resolution and almost 19 bits resolution). However the resolution specification is .32mV (for high gain) which corresponds to ~5.5V full scale/14 bits, and my measurements have confirmed the quantization noise is ~.32mV suggesting no improvement in resolution from oversampling. Is this a limitation of the FPGA programming/precision and can it be improved to make this already great device have more effective number of bits for lower scan frequencies? Are there any improvements in the AD3 with regards to bit depth at lower scan rates?

    Thanks,

    Walid

  5. Thanks Fausto. I finally figured out how to trigger using an external digital trigger option and SetTrigger. I needed to set the option ExtTrigger for AInScan via the following command:

     

                Options = MccDaq.ScanOptions.Background Or MccDaq.ScanOptions.ExtTrigger

    and then initiate the scan via AInScan:

      ULStat = DaqBoard.AInScan(LowChan, HighChan, Count, Rate, Range, MemHandle, Options)

    And as you state, it correctly triggers on the edge of the connected external trigger.

    However, I'm still curious how TracerDAQ can trigger on an analog channel independent of the external trigger being connected (it definitely works!). Is there an undocumented method that TracerDAQ uses to allow for triggering on an analog channel?

  6. Hi,

    I have been struggling with this for quite a while and really need to get to a resolution. Using a USB-1608FS board, I am simply trying to reproduce programmatically what I've been able to do easily withTracerDAQ: initiate an ADC scan with AInScan() based on a rising edge trigger (from either the analog channel from the signal itself or the external digital trigger). As per the documentation, there are 2 trigger setup commands, ATrig() and SetTrigger() that somehow together should be able to accomplish this. 

    From the manual:

    ATrig()
    Waits for a specified analog input channel to go above or below a specified value. ATrig continuously reads
    the specified channel and compares its value to trigValue. Depending on whether trigType is set to
    TrigAbove or TrigBelow, it waits for the first A/D sample that is above or below trigValue. The first sample
    that meets the trigger criteria is returned to dataValue.

    SetTrigger()
    Selects the trigger source and sets up its parameters. This trigger is used to initiate analog to digital
    conversions using the following Universal Library for .NET methods:
    AInScan(), if the ExTrigger option is selected.

    I've used the following in VB.Net and indeed it only triggers when the trigger is above 0, but not on the rising edge, so the signal is randomly moving around (I check the status in a timer in the standard way after AInScan). Note that there are no options for TrigPosEdge with ATrig, only TrigAbove or TrigBelow:

    Dim dataval As Short
    Dim threshold As Short = 32767
    ULStat = DaqBoard.ATrig(0, MccDaq.TriggerType.TrigAbove, threshold, Range, dataval)

    ULStat = DaqBoard.AInScan(LowChan, HighChan, Count, Rate, Range, MemHandle, Options)

    All attempts to use SetTrigger(), such as

    ULStat = DaqBoard.SetTrigger(MccDaq.TriggerType.TrigPosEdge, threshold, threshold)

    were also not having any impact on the trigger, and I've tried multiple combinations to no avail. If anyone could provide a simple example on how to do this most basic analog input, I would very much appreciate it (there are no examples in the example files provided).

     

    Thanks,

    Walid

  7. Hi,

    I am trying to understand how to programmatically setup the triggers on the USB-1608FS board so that I can:

    1. Read data on the rising edge with trigger level set to 0, similar to the screen shot in TracerDAQ shown below (and showing the trigger options) which gives a stable sine wave starting at 0 for a sine wave input.

    2. Read data on the external trigger input from a digital signal (I'm assuming this should be more stable than 1)

    I know this can be done with this board and my signals are good because it works fine with TracerDaq. I'm using VB.net, there are no examples provided that do this (the trigger examples only work for a "signal above" level and therefore do not correctly trigger on the rising edge which is what I'm getting as well no matter what I set the trigger condition to), and the user's manual is a little confusing regarding how to use ATrig and SetTrigger in conjunction with AInScan (it suggests it only works with an external trigger, but I know it can work with a channel trigger). I've tried multiple combinations and only get triggers above 0 instead of rising edge triggers (and thus the sine wave just slides around the start trigger depending on when the signal was found to be above 0 rather than a positive edge). I know that the AInScan is armed and waiting for a trigger above 0 because it doesn't return a scan unless that is the case. Also pretriggering via ATrig apparently is not an option for this board.

    The code snippet for setting up triggering that loops is:

               ULStat = DaqBoard.StopBackground(MccDaq.FunctionType.AiFunction) 'stop background scan for each trigger event
               Dim TrigVal As UShort = 32767
               Count = 2000    ' total number of data points to collect
                    ' per channel sampling rate ((samples per second) per channel)
                    Rate = 10000 / ((HighChan - LowChan) + 1)
                   

                    'Set up trigger

                    ULStat = DaqBoard.ATrig(0, MccDaq.TriggerType.TrigAbove, TrigVal, Range, DataValue)
                    ULStat = DaqBoard.SetTrigger(MccDaq.TriggerType.TrigPosEdge, TrigVal, TrigVal)
                    Options = MccDaq.ScanOptions.Background

                   'Expect AInScan to now wait for trigger rising edge above 0 but instead get trigger at any value above 0

                    ULStat = DaqBoard.AInScan(LowChan, HighChan, Count, Rate, Range, MemHandle, Options)
                    If ULStat.Value <> MccDaq.ErrorInfo.ErrorCode.NoErrors Then Stop
     

    and I read it below with a timer (ADData always gives a shifted sine wave instead of one triggering on the rising edge):

         If Status = MccDaq.MccBoard.Running And UserTerm = 0 Then
                lblShowStat.Text = "Running"
                tmrCheckStatus.Start()

            ElseIf Status = MccDaq.MccBoard.Idle Or UserTerm = 1 Then
                lblShowStat.Text = "Idle"
                ULStat = DaqBoard.GetStatus(Status, CurCount, CurIndex, MccDaq.FunctionType.AiFunction)

                If ULStat.Value <> MccDaq.ErrorInfo.ErrorCode.NoErrors Then Stop

                lblShowCount.Text = CurCount.ToString("D")
                lblShowIndex.Text = CurIndex.ToString("D")
                If SwitchScan.Value = False Then
                    tmrCheckStatus.Stop()
                End If
                If MemHandle = 0 Then Stop

                If ADResolution > 16 Then
                    ULStat = MccDaq.MccService.WinBufToArray32(MemHandle, ADData32, FirstPoint, NumPoints)
                    If ULStat.Value <> MccDaq.ErrorInfo.ErrorCode.NoErrors Then Stop

                    For i = 0 To HighChan
                        lblADData(i).Text = ADData32(i).ToString("D")
                    Next i
                Else
                    ULStat = MccDaq.MccService.WinBufToArray(MemHandle, ADData, FirstPoint, NumPoints)
                    If ULStat.Value <> MccDaq.ErrorInfo.ErrorCode.NoErrors Then Stop

                End If

    Any advice would be greatly appreciated--a very simple flowchart with the procedure for setting up the board for proper rising edge channel 0 triggering would suffice, and then how to do it with a digital external trigger signal with this board as well.

    Thanks,

    Walid

     

    image.png.39ed0280e380d4355786dfdb9c6cc365.png

×
×
  • Create New...