Search the Community

Showing results for tags 'analog'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News
    • New Users Introduction
    • Announcements
  • Digilent Technical Forums
    • FPGA
    • Digilent Microcontroller Boards
    • Non-Digilent Microcontrollers
    • Add-on Boards
    • Scopes & Instruments
    • LabVIEW
    • FRC
    • Other
  • General Discussion
    • Project Vault
    • Learn
    • Suggestions & Feedback
    • Buy, Sell, Trade
    • Sales Questions
    • Off Topic
    • Educators
    • Technical Based Off-Topic Discussions

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 30 results

  1. Hello, I have seen a lot of contradictory information online regarding the sampling frequency of the Analog Discovery 2 ADC channel. Is it possible to sample at around 30 MHz for 20s and store the data in a csv for example with a time stamp? Second Is it possible to run several processes on the board simultaneously such as: 1) 2x analog read and data storage 2) motor control 3) Waveform generator assumming I have enough cores on my computer to run there respective programs.
  2. When using the scope from the Waveforms IDE, I can't get a visual of Channel 2. (Channel 1 works fine) I've tried using multiple USB ports and other computers. When I run calibration for the oscilloscope I get the following error message: "Check the connections!! The measured voltage on Oscilloscope Channel 2 is between: 30.269009276 V and 30.275477712 V. But it should be around: 0 V. It might be that the Arbitrary Waveform Generator 1 Offset is not calibrated correctly." I don't think the waveform is the issue, it reads as expected on channel 1. I could use some help.
  3. Hello and thanks for taking the time to read my question. I'm hoping to use the ADC functionality of the chipkituC32 but I have some questions. As I understand it, when I write the command Input = analogRead(A3) I should get an interger number 1023 /3.3 = x . However when I have no input into the A3 port, I get the constant number 788. How do I do the correct conversion? When I was sending in a DC voltage of 2 V I was getting alternating numbers between 600 and 1023 which make no sense. Also, I cannot find in the datasheet, what is the frequency to read in a signal? I found somewhere online that it was only 10kHz. That seems incredibly low. IS the read frequency for digital signals higher? If I have a separate ADC and send a digital signal could I speed this up? Thanks again
  4. Hello, I am working on a project that involves using the digilent analog discovery 2 to act as a an input and output for a VI in LabVIEW. I have downloaded the Adept and Waveforms software to communicate with the discovery 2 and LabVIEW. In this VI, I am getting an error number 1097, which has to do with the call library function. The error is in an attached photo. I have tried the suggested fixes online but have not found one to work for me. The error does seem to occur at the sub-VIs I downloaded from National Instruments, built to work for the discovery 2 in LabVIEW. When I open the call library function of the sub-VI that seems to raise the error, I see the attached images. Does anyone know if the set values are correct or if I need to change something? I am hoping that the error may be fixed by changing one of the parameters or options listed. The following links shed light on the 1097 error in LabVIEW: "Error 1097 Occurred at Call Library Function Node" https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000PAckSAG&l=en-US "Error 1097 While Calling DLL with Correct Calling Convention" https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P9bHSAS&l=en-US Thank you!
  5. Hi there folks, great to meet you. Recently the company i work bought an Analog Discovery 2 to work with, and all I can say is - This is a great instrument, although I am using very small amount of its power. I have noticed something that lost me 2 days of work to discover that the problem is not my communication but in the way that the data is read by the AD2. The setup is like this - I have two boards communicating over I2C to each other and I am monitoring the messages in the Protocol part of the Waveforms. When i am sending large packets with more than 5 bytes of data there are some errors appearing on the tool but the messages actually are all right. My guess is that the discretization frequency is too small so it is getting errors in messages (i have seen this too when I have used the logic analyzer part of the software, although the I2C speed is 100kHz, when the scan frequency is smaller than 400kHz the protocol is not decoded in the right way.) There is no way(as far as I have tried) to adjust the frequency in Protocol mode. I am uploading pictures, hope it gets clear. Another thing is that the buffer that it stores the information from the protocol is quite large and the tool(waveforms) starts to work slowly, maybe it will be good to be able to adjust the size and flush the buffer more frequently. I will be glad to here from you is there a way to fix this issues. Thanks in advance.
  6. Hello, I'am writting my own software to setup an Analog Discovery 2 device and conduct some mesurements in C# using SDK library and wraper. I can connect with the device, disconnect and even retrieve some information such as serial no. I would like to have some sort of protection in case if device is rapidly unplugged from computer. In this particular circumstances in Waveforms software an error will occur. I have tried some sort of checking with use of enumerators but enumerators works poperly when device is connected. When device is disconnected last status is remaining and no error messages are visible. What I hve to do to solve this problem? Connecting with device: public bool AD2_Connect(ref int AErrorCode, ref int ANoOfAD2Devices) { bool AIsConnected = false; string AVersion = null; string ADeviceName = null; string ADeviceSn = null; // detect number of all connected supported devices dwf.FDwfEnum(dwf.enumfilterAll, ref ANoOfAD2Devices); // open automatically the first available device if (dwf.FDwfDeviceOpen(-1, ref hdwf)==0) { AIsConnected = false; } else { dwf.FDwfGetVersion(out AVersion); //get veriosn dwf.FDwfEnumDeviceName(0, out ADeviceName); //get device name dwf.FDwfEnumSN(0, out ADeviceSn); //get serial no AIsConnected = true; //set flag } dwf.FDwfGetLastError(ref AErrorCode); //get last error code string AErrorMsg = null; dwf.FDwfGetLastErrorMsg(out AErrorMsg); //get last error message return AIsConnected; //return flag } Then I need to check if device is still connected. My version of chceckig if device is disconnected or connected, but it doesn't work. int AIsUsed = -1; int ADevicesNo = -1; dwf.FDwfEnum(dwf.enumfilterAll, ref ADevicesNo); dwf.FDwfEnumDeviceIsOpened(0, ref AIsUsed);
  7. Hello I am a user of Analog Discovery2 and I believe it is missing one very important (for me at leas) function. I basically want to monitor and register the communication between two devices which use UART to do so. The Protocol panel looks great but I am able to register only one of the devices at the same time. Logic panel is very unfeasible in my case because I want to register many lines of the communication (like 5 min). Is there any way I can achieve that? Maybe there is a custom script which would help in my case?
  8. Is the analog shield's DAC range from -5V to 5V? My purpose is to use the shield for driving the x/y mirrors of a laser galvo. And is there information about the update frequency of the write function? Thanks in advance!
  9. I am trying to write a custom application using the SDK in python that will synchronize a number of pulses (with a variety of frequencies and pulse widths) on both the analog and digital pins, to synchronize several pieces of equipment in my lab. I would like to start a pulse on DIO-0 and let it run for several minutes, and then click a button which starts pulses on the two AWGs which are synchronized with the ongoing digital pulse. I think the best (or most straightforward?) way to do this is to enable or configure the analog pins on the button click, and then trigger the AnalogOut AWGs on the rising edge of the next digital pulse. The AnalogOut should pulse for a specified length of time (1-5seconds), then turn off while the digital pin keeps pulsing. The TriggerHoldOff command would be great so I can trigger the AWG on the next DIO pulse (but not all subsequent pulses), but it looks like it only exists for AnalogIn -- any other ideas on how do this? Also, is there a way to count the number of digital pulses which were sent before the AnalogOut was triggered?
  10. Hello all. New to WaveForms, so excuse me if this is too easy. I'd like to capture an analog channel, and two digital ones - where information is encoded into the width of the pulses. Sure enough, I can do this. But of the digital, one is PWM, which I'd like to manipulate into the corresponding stream of percentages (or 8-bit values, does not matter); the other one encodes the duration of something - therefore I'd like to measure their positive duration, as in a timer/counter... Can this be done in WaveForms with the AD2?
  11. I'm currently trying to synchronize analog pulses on both AWGs with digital pulses, and simultaneously run both analog scopes and the digital scope. I am trying to trigger all outputs and all scope acquisitions to happen simultaneously with a single PC-Trigger source using the SDK. First question: Why isn't there an AnalogInTriggerSlopeSet function? (You can set the TriggerSlope to rising edge for AnalogOut, DigitalOut, and DigitalIn). Without an AnalogInTriggerSlopeSet function, how do you set the AnalogInTrigger to respond to the same signal as the other three? Second Question: What prompts the change in Analog/DigitalInStatus from 'prefill' to 'armed' or 'done'? In the Acquisition code in the SDK, it looks like the status changes when the buffer fills? In my code below, why isn't it progressing to 2=Done to break out of the loop? It looks like it is getting stuck waiting for the trigger (which already happened). #digital pulse control setup self.dwf.FDwfDigitalOutEnableSet(hdwf, c_int(0), c_int(1)) # enable dIO pin 0 self.dwf.FDwfDigitalOutDividerSet(hdwf, c_int(0), c_int(int(hzSys.value/(100*self.qRate)))) # divider=internal clock/ (100counts*frequency) self.dwf.FDwfDigitalOutCounterSet(hdwf, c_int(0), c_int(100-self.qDuty), c_int(self.qDuty)) # set counts low, counts high from duty cycle print "configured digital output" # analog pulse control setup self.dwf.FDwfAnalogOutNodeEnableSet(hdwf, c_int(0), AnalogOutNodeCarrier, c_int(True)) self.dwf.FDwfAnalogOutNodeEnableSet(hdwf, c_int(1), AnalogOutNodeCarrier, c_int(True)) # for second channel set master the first channel, slave channel is controlled by the master self.dwf.FDwfAnalogOutMasterSet(hdwf, c_int(1), c_int(0)); self.dwf.FDwfAnalogOutNodeFunctionSet(hdwf, c_int(-1), AnalogOutNodeCarrier, funcSquare) self.dwf.FDwfAnalogOutNodeFrequencySet(hdwf, c_int(-1), AnalogOutNodeCarrier, c_double(self.xRate)) self.dwf.FDwfAnalogOutNodeAmplitudeSet(hdwf, c_int(-1), AnalogOutNodeCarrier, c_double(0.5)) self.dwf.FDwfAnalogOutOffsetSet(hdwf, c_int(-1), c_double(0.5)) self.dwf.FDwfAnalogOutNodeSymmetrySet(hdwf, c_int(-1), AnalogOutNodeCarrier, c_double(symm)) #pulse width self.dwf.FDwfAnalogOutNodePhaseSet(hdwf, c_int(1), AnalogOutNodeCarrier, c_double(self.x2Phase)) #phase shift for second channel self.dwf.FDwfAnalogOutRunSet(hdwf, c_int(-1), c_double(self.xDuration)) #set run duration on all channels self.dwf.FDwfAnalogOutIdleSet(hdwf,c_int(-1), c_int(0)) print "configured analog output" #configure digital input scope self.dwf.FDwfDigitalInDividerSet(hdwf, c_int(int(hzSys.value/(100*self.xRate)))) #same sample rate as xray self.dwf.FDwfDigitalInSampleFormatSet(hdwf, c_int(16)) # 16bit per sample format cSamples = 1000 # set number of sample to acquire rgwSamples = (c_uint16*cSamples)() self.dwf.FDwfDigitalInBufferSizeSet(hdwf, c_int(cSamples)) print "configured digital input" #configure analog input scope self.dwf.FDwfAnalogInFrequencySet(hdwf, c_double(int(hzSys.value/(100*self.xRate)))) self.dwf.FDwfAnalogInBufferSizeSet(hdwf, c_int(1000)) self.dwf.FDwfAnalogInChannelEnableSet(hdwf, c_int(0), c_bool(True)) self.dwf.FDwfAnalogInChannelRangeSet(hdwf, c_int(0), c_double(5)) self.dwf.FDwfAnalogInChannelEnableSet(hdwf, c_int(1), c_bool(True)) self.dwf.FDwfAnalogInChannelRangeSet(hdwf, c_int(1), c_double(5)) rg1 = (c_double*1000)() #rg = pointer to allocated buffer to copy the acquisition data rg2 = (c_double*1000)() #rg = pointer to allocated buffer to copy the acquisition data print "configured analog input" #set up PC trigger to start pulse output AND acquisition self.dwf.FDwfAnalogOutTriggerSourceSet(hdwf, c_int(0), trigsrcPC) self.dwf.FDwfDigitalOutTriggerSourceSet(hdwf, trigsrcPC) self.dwf.FDwfAnalogOutTriggerSlopeSet(hdwf, c_int(0), c_int(0)) # set channel 1 to trigger on rising edge self.dwf.FDwfDigitalOutTriggerSlopeSet(hdwf, c_int(0)) self.dwf.FDwfDigitalInTriggerSourceSet(hdwf, trigsrcPC) self.dwf.FDwfDigitalInTriggerSlopeSet(hdwf, c_int(0)) #rising edge self.dwf.FDwfAnalogInTriggerSourceSet(hdwf, trigsrcPC) # self.dwf.FDwfAnalogInTriggerSlopeSet(hdwf,) #this command doesn't exist for analogin! print "set up triggers" #configure everything to wait for trigger self.dwf.FDwfAnalogOutConfigure(hdwf, c_int(0), c_bool(True)) # start master, slave will follow self.dwf.FDwfDigitalOutConfigure(hdwf, c_int(1)) self.dwf.FDwfDigitalInConfigure(hdwf, c_bool(0), c_bool(1)) self.dwf.FDwfAnalogInConfigure(hdwf, c_int(1), c_int(1)) # starts both analog in pins (hdwf, bool-reconfigure, bool-start) print "initialized pins" #send the trigger self.dwf.FDwfDeviceTriggerPC(hdwf) print "PC trigger pulse sent" #plot the things sts = c_int() while True: #data acquisition status should == 5 - filling buffer self.dwf.FDwfDigitalInStatus(hdwf, c_int(1), byref(sts)) sts1 = sts.value self.dwf.FDwfAnalogInStatus(hdwf, c_int(1), byref(sts)) print ("analog status = " + str(sts.value)) print ("digital status = " +str(sts1)) if sts.value == DwfStateDone.value : #status ==2 = done print "acquisition complete" break When I run this, this is my printout:
  12. Hi, so I am trying to complete a project for one of my classes and I decided to us the script part of the analog discovery; however, there is not enough comments on the code to explain what it is specifically doing. I found an example code that is titled "Wavegenpiano". I would like to know if someone can explain what that code is doing., ie, what each part of the code is doing. I would like to use that code associated with a buzzer to output a song. TL;DR How can I use the script part of the analog discovery to have a buzzer output out a sound?
  13. """ DWF Python Example Author: Digilent, Inc. Revision: 2015/02/05 Requires: Python 2.7 Start synchronized the AWG outputs of multiple Analog Discovery devices. Connect the Trigger-1 pin of each device together. """ from ctypes import * import time import sys if sys.platform.startswith("win"): dwf = cdll.dwf elif sys.platform.startswith("darwin"): dwf = cdll.LoadLibrary("libdwf.dylib") else: dwf = cdll.LoadLibrary("libdwf.so") #print DWF version version = create_string_buffer(16) dwf.FDwfGetVersion(version) print "DWF Version: "+version.value cDevice = c_int() dwf.FDwfEnum(c_int(2), byref(cDevice)) # 2 = enumfilterDiscovery print "Found "+str(cDevice.value)+" devices" cChannel = 2 cOutput = cDevice.value*cChannel hdwf = c_int() #open device for iDevice in range (0, cDevice.value): dwf.FDwfDeviceOpen(c_int(iDevice), byref(hdwf)) if hdwf.value == 0: print "failed to open" quit() for iChannel in range (0, cChannel): print "Configure "+str(iDevice+1)+"/"+str(iChannel+1) # enable channel dwf.FDwfAnalogOutNodeEnableSet(hdwf, c_int(iChannel), c_int(0), c_int(True)) # 0 = AnalogOutNodeCarrier # configure dwf.FDwfAnalogOutNodeFunctionSet(hdwf, c_int(iChannel), c_int(0), c_int(1)) # 1 = funcSine dwf.FDwfAnalogOutNodeFrequencySet(hdwf, c_int(iChannel), c_int(0), c_double(1000.0)) dwf.FDwfAnalogOutNodeAmplitudeSet(hdwf, c_int(iChannel), c_int(0), c_double(1.0)) # set trigger source to external trigger 1 dwf.FDwfAnalogOutTriggerSourceSet(hdwf, c_int(iChannel), c_byte(11)); # 11 = trigsrcExternal1 #set different phase iOutput = iDevice*cChannel+iChannel dwf.FDwfAnalogOutNodePhaseSet(hdwf, c_int(iChannel), c_int(0), c_double(360.0*iOutput/cOutput)) # start the channel, this will wait for the trigger dwf.FDwfAnalogOutConfigure(hdwf, c_int(iChannel), c_bool(True)) # configure Trigger-1 pin to output the triggerPC signal for the last device dwf.FDwfDeviceTriggerSet(hdwf, c_int(0), c_byte(1)) # 1 = trigsrcPC # after open, before the first run wait a bit for the offsets to stabilize time.sleep(5) print "Pulse trigger to start generation..." dwf.FDwfDeviceTriggerPC(hdwf); time.sleep(60) print "done." dwf.FDwfDeviceCloseAll()
  14. After going through a range of the SDK examples, I'm running into some strange behavior that I'm hoping someone can help explain. The result I'm trying to achieve is sending out a low duty cycle pulse (Digital or Analog but something similar to a TTL) that triggers the repeated acquisition on the Analog Discovery. I can achieve this result using the GUI but would like to insert this process into a python script so I can process and save the data. When I route W1 into CH1 in the following example what I see is expected. However, when I try to route the digital out into CH1 things look extremely wonky. Again, I'd like to see a waveform that would be considered a PWM waveform that has a duty cycle of ~99% low and I'd like to be able to control that duty cycle with a reasonable degree of precision and accuracy. Any help would be appreciated and hope the solution is easy as I've been staring at this entirely too long. Am I just trying to put too many points into the digital out? Another potential solution that I'm not entirely sure how to implement, is loading a custom waveform from a file and running that through the waveform generator. Is there an example for that that would also fit with the DAQ needs? Cheers, Brian AnalogIn_Acquisition_5.py
  15. Hello, For a project in one of my courses my adviser asked me to find a way to control the sample rate and record length in the Analog Discovery in order to understand how to use the FFT module. Thank you, cjobi247
  16. Hello, is it possible to sample an external analog signal using the XADC? Or do I need the AMS101 Eval-Card for that? I'm using the Sony XC-HR50 analog Camera (datasheet: https://pro.sony.com/bbsc/ssr/product-XCHR50/ ), which has a CCD Sensor. I am very new to Zedboard and trying do save the picture of the camera. Thank you, kind regards The Video Output is shown below:
  17. I'm trying to take accurate readings using the "Logger" module in Waveforms 2015. When I power up a simple DC circuit with +5V, and use a DMM I get readings of ~4.44 volts. However when I run the data logger module, all of the readings are <100 mV. Shouldn't the logger be reading ~4.44 volts, or is there some configuration I am missing Thanks in advance!
  18. Hello, I'm a newbie using the Analog Discovery (Legacy), and attempting to run through a few experiments. When using the Power Source or "Supplies" tool in Waveforms 2015, all the directions and manuals show a dropdown menu where you can adjust the voltage (0-5V). The manual from Digilent's own website SPECIFICALLY regarding the Analog Discovery Legacy shows this as an option as well. I can't find any such option however in my program, it just isn't there. I should mention that I am powering the AD itself via USB from my laptop, but I don't think that is the issue as according to the status I am outputting ~5V via USB just fine, and the manual also shows the dropdown while being powered by USB. I also don't know what the little green bar underneath is supposed to represent, as it moves up only partially seemingly to random places when I turn on the "Master" enable, in case that it something to be concerned about. Any help is appreciated. Thanks!! P.S. Sorry for the re-post I realized I put this question outside the "Waveforms" Forum.
  19. Hello folks, I'm a newbie using the Analog Discovery (Legacy), and attempting to run through a few experiments. When using the power source tool via Waveforms 2015, all the directions and manuals show a dropdown menu where you can adjust the voltage (0-5V). The manual from Digilent's own website SPECIFICALLY regarding the Analog Discovery Legacy shows this as an option as well. I can't find any such option however in my program. I should mention that I am powering the AD itself via USB from my laptop, but I don't think that is the issue as according to the status I am outputting ~5V via USB just fine. I also don't know what the little green bar underneath is supposed to represent, as it moves up only partially seemingly to random places when I turn on the "Master" enable. Any help is appreciated. Thanks!
  20. I have been working with the Digilent analog shield for quite some time now, and initially, using its functions was an easy task and calling analog.read and analog.write in my main loop presented no trouble. Fast forward to today, every time I have called analog.write(the only analog shield function i need) in my main loop code, it seems to fail. The code function is called in a large menu setup and the code isn't the cleanest, but I have put in print statements both before and after the code is called. Both statements are printed in the Serial monitor, ensuring that the arduino is certainly reading the analog.write code, but whenever i test a channel, the output does not change from what was initially written out in the code's setup function. if someone could describe what is happening, that would be grand. please help.
  21. With the Analog shield mounted on an Arduino Leonardo, I'm seeing a zero error at each of the analog inputs with a zero voltage input or the Arduino's Ground connected to the analog pin. Using the signed read in non-differential mode, the A0 input reads -65 counts, A1 input reads -75, A2 input reads 85 and A3 reads -65. Is there any adjustment that I can make to the board to reduce this zero error? This zero error persists even when I switch from powering the board through the USB to a wall wart power supply. Thanks
  22. All: I'd like to get your thoughts on the following question: In https://reference.digilentinc.com/_media/cmod_a7/cmod_a7_rm.pdf, page 9. The Analog input circuit describes using a voltage divider to step a 0 to 3.3 range to 0 to 1 as required by the analog inputs. What I am also noting (and have measured) is that the input has a 3.3K impedance. I've been trying to get a TMP36GZ temperature monitor to work with this input and now suspect based on this temperature sensor's spec that the 3.3K draws too much current for this high impedance device. Has anyone else had any experience with limitation on the these analog inputs due to their lower impedance? Peter
  23. Hi all, because I was running out of memory on my Arduino UNO using the analogShield I changed to the Arduino Mega2560. As it turned out, the Arduino Mega2560 is not officially supported with the library from the digilent resource center. However, there is a modified lib on github which supports the Mega2560 almost flawlessly. Here is the Link: https://github.com/wespo/analogShield The only modification I had to do was to bend away pin 11,12,13 of the digilent analogshield. This way the 6pin SPCI port is used for SPI communication. (The mega2560 doesn't use SPI on pin 11,12,13) Ben
  24. Are Analog Shield and Network Shields are compatible with the chipKIT Max32 at the same time? If so are there any special considerations? Thanks you for any help you can provide.
  25. Hello, I have an Analog Discovery and I recently installed WaveForms version 3.3.5 (I actually found it a bit ambiguous how to install WaveForms. I attached an image below of the files I downloaded from Digilent. All I did was click and drag the framework into the corresponding directory and likewise for the application. Then I ran the driver installer). I am running Mac OS X El Capitan 10.11.5 on my Mac laptop. When I look under the USB device tree in System Information I can see "Digilent USB Device" but when I open up WaveForms it alerts "No device detected". Would anyone know how to solve my issue by chance? Any help is very much appreciated.