Jump to content

Hobs

Members
  • Posts

    7
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Hobs's Achievements

Newbie

Newbie (1/4)

0

Reputation

  1. Hobs

    triggerIn

    I just understood. I had already seen this example but I didn't understand. There has to be a white space between (hdwf) and dwf.FDwfDigitalIOStatus. I feel stupid. It works fine. Beginner's mistake. Sorry for the inconvenience.
  2. Hobs

    triggerIn

    Good morning, sir. I would like to use python to tell me if the DIO.0 input is high or low. I am sending a 3V signal to the DIO.0 input. With the waveform program it works perfectly. I can read the value of the input correctly depending on what I input as a signal. But with python it is impossible to read this value. I have taken scripts on the forum to try to understand but nothing works, the input read remains at zero. Can you help me ? I just want python to print value high state when there is 3V low state when there is 0V. Thank you in advance # import constants path.append(constants_path) import dwfconstants as constants hdwf = c_int() hzDI = c_double() #sts = c_byte() cSamples = 1000 dwf.FDwfDigitalInInternalClockInfo(hdwf, hzDI) dwf.FDwfDigitalInTriggerSourceSet(hdwf, constants.trigsrcDetectorDigitalIn) #dwf.FDwfDigitalInTriggerSet(hdwf, 0, 0, 0, '&HFFFF') dwf.FDwfDigitalInTriggerAutoTimeoutSet(hdwf, 10) dwf.FDwfDigitalInDividerSet(hdwf, c_int(1000)) dwf.FDwfDigitalInSampleFormatSet(hdwf, 8) dwf.FDwfDigitalInBufferSizeSet(hdwf, cSamples) dwf.FDwfDigitalInTriggerPositionSet(hdwf, cSamples - 10) # begin acquisition dwf.FDwfDigitalInConfigure(hdwf, c_bool(0), c_bool(1)) print ("waiting to finish") i = 0 while i < 10: sts = ctypes.c_byte() dwf.FDwfDigitalInStatus(hdwf, c_int(0), byref(sts)) print ("STS VAL: " + str(sts.value)) if (sts.value == stsDone.value): break time.sleep(1) i=i+1 print ("Acquisition finished") time.sleep(1) dwf.FDwfDigitalOutReset(hdwf) dwf.FDwfDeviceCloseAll() rgpy=[0.0]*len(rgwSamples) for i in range(0,len(rgpy)): rgpy[i]=rgwSamples[i] plt.plot(rgpy) plt.show()
  3. Hobs

    triggerIn

    Okay, thank you very much, I'll look into it. I will keep you informed if I succeed.
  4. Hobs

    triggerIn

    I'm sorry to ask you to do this, but I would like to use the DIO to trigger a script. I can easily use the pattern to emit a 3V signal and trigger a relay but I can't correctly read a high state on an input. I would like to apply (with a GBF) 3V DC to a digital input of my choice to read this input. If the input (e.g. pin 0) is zero then 0V is indicated if the input is 3V print high. This product ADP3450 is very advantageous for us but I need to master it. I would like to make an automatic laser relock script. To keep one of our lasers locked at the right frequency. I would like to thank you very much in advance for your feedback and advice.
  5. Hobs

    triggerIn

    Hello I thank you very much for this very useful information for me. Indeed it works well. I also have a second more theoretical question. I would like to use the adp3450 in XY mode with python. The four analog channels on the Y axis and one or two analog outputs (wavegen out) for the X axis. Is it possible to get the theoretical value of the wavegen output via the usb? Or I have to sacrifice an analog input to do the X. I would have only 3 Y and not 4 Y. I thank you in advance
  6. Hello Attila I'm sorry to contact you this way but I can't send you any messages directly. I am looking for someone who can help me to use the trigger of an adp340. I wrote in project vault but my message disappeared. Maybe it was not in the right box. Is it possible to contact you ?
  7. Hello I work in a research laboratory and I am a beginner in programming. I have an ADP3450 that I would like to program in python with pyQt5. In my digilent5 code I would like to use channel 1 of my ADP3450 to trigger at 1Volt for example. I know I have to use the following functions "#dwf.FDwfAnalogInTriggerAutoTimeoutSet(hdwf, ctypes.c_double(0)); dwf.FDwfAnalogInTriggerSourceSet(hdwf, None); dwf.FDwfAnalogInTriggerChannelSet(hdwf, ctypes.c_int(2)) ; dwf.FDwfAnalogInTriggerTypeSet(hdwf, constants.trigtypeEdge); dwf.FDwfAnalogInTriggerLevelSet(hdwf, ctypes.c_double(1)); dwf.FDwfAnalogInTriggerConditionSet(hdwf, constants.trigcondRisingPositive)" but I can't use them correctly. My ADP3450 does not trig. Could you help me. I work on linux (armbian) but on windows it's the same it doesn't work better. Could you please help me. I thank you all very much in advance. digilent5.py
×
×
  • Create New...