Mathias G. Posted June 19, 2023 Share Posted June 19, 2023 (edited) Hi ! I want to set a trigger to start the acquisition in record mode, I use all 4 channels and the trigger is on the pin trigger 2 (the trigger 1 is an external clock). That's my code but it doesn't work, have I forgotten anything ? #set trigger dwf.FDwfAnalogInTriggerAutoTimeoutSet(hdwf, c_double(0)) #disable auto trigger dwf.FDwfAnalogInTriggerSourceSet(hdwf, 12) dwf.FDwfAnalogInTriggerConditionSet(hdwf, 0) dwf.FDwfAnalogInTriggerLevelSet(hdwf, c_double(1.5)) # 1.5V test_record_pattern_4bits.py Edited June 19, 2023 by Mathias G. Link to comment Share on other sites More sharing options...
0 attila Posted June 20, 2023 Share Posted June 20, 2023 Hi @Mathias G. What is the frequency of the external clock you use? Using your script I've connected the following and it seems to be working. DIO 11 to Trig1 DIO 9 to Trig2 DIO 5 to C1 Link to comment Share on other sites More sharing options...
0 Mathias G. Posted June 21, 2023 Author Share Posted June 21, 2023 (edited) 22 hours ago, attila said: Hi @Mathias G. What is the frequency of the external clock you use? Using your script I've connected the following and it seems to be working. DIO 11 to Trig1 DIO 9 to Trig2 DIO 5 to C1 Hi @attila ! Currently, I generate a clock with the pattern generator (in the code, it is the pinClock). The problem is that the program starts the acquisition without waiting the condition of trigger. I tried disconnecting the cable I use as a trigger and disabling the auto trigger and I didn't get a message telling me that the AD is waiting, and the acquisition has started. I made few modifications in the code to try and one thing is to use the channel 4 as detector because it has a periodic signal on 9 samples. As you can see, on the pictures, if I made two (or more) acquisitions I didn't have the same result. (I just try to change the analogIntriggersourceset value, from trigsrcDetectorAnalogIn to trigsrcAnalogIn but nothing change). test_record_pattern_4bits.py Edited June 21, 2023 by Mathias G. Link to comment Share on other sites More sharing options...
0 attila Posted June 21, 2023 Share Posted June 21, 2023 Hi @Mathias G. Are you using a new WaveForms version like 3.20.1 or newer? I'm getting stable trigger using your code with this. Link to comment Share on other sites More sharing options...
0 Mathias G. Posted June 21, 2023 Author Share Posted June 21, 2023 41 minutes ago, attila said: Hi @Mathias G. Are you using a new WaveForms version like 3.20.1 or newer? I'm getting stable trigger using your code with this. Thanks you @attila I don't know but I try with another code and that's work as for you ! But sorry, I have an another question : Why I have an important time of configuration, which is proportionnal with frequence of the external clock from 100 kHz. (between 2-3 seconds for 100 kHz, 20 seconds for 10 kHz, ...) Link to comment Share on other sites More sharing options...
0 attila Posted June 22, 2023 Share Posted June 22, 2023 Hi @Mathias G. How many samples do you collect ? Link to comment Share on other sites More sharing options...
0 Mathias G. Posted June 22, 2023 Author Share Posted June 22, 2023 (edited) 4 hours ago, attila said: Hi @Mathias G. How many samples do you collect ? Hi @attila ! I have these two figures that I made myself, I collected 100 samples on 4 channels. (I'm sorry for the language) Courbe tps en fonction clock externe.pdf Courbe tps en fonction période clock externe 10 - 1000 MHz.pdf Edited June 22, 2023 by Mathias G. Link to comment Share on other sites More sharing options...
0 Mathias G. Posted June 22, 2023 Author Share Posted June 22, 2023 (edited) 3 hours ago, Mathias G. said: Hi @attila ! I have these two figures, I collected 100 samples on 4 channels. (I'm sorry for the language) Courbe tps en fonction clock externe.pdf 80.55 kB · 1 download Courbe tps en fonction période clock externe 10 - 1000 MHz.pdf 24.93 kB · 1 download 4 hours ago, attila said: Hi @Mathias G. How many samples do you collect ? Hi @attila ! I don't know if I can post three another question here, so I try but if you prefere, I can create a new page. 1 - Can the ADP stop the acquisition if it exceeds 70°C ? Today, I have a bug few times, and each times the ADP is relatively warm. 2 - Can I get the frequency of the external clock that I use as source for the oscilloscope ? (It's connected to the trigger 1) 3 - I have a delay equivalent to 4 tick when I acquire more than 320 samples, why? For the first question, the ADP block (bug) at this step (precisely it's when I do the AnalogInStatusRecord function) so I have to interrupt by myself. Edited June 22, 2023 by Mathias G. Link to comment Share on other sites More sharing options...
0 Mathias G. Posted June 22, 2023 Author Share Posted June 22, 2023 1 hour ago, Mathias G. said: Hi @attila ! I don't know if I can post three another question here, so I try but if you prefere, I can create a new page. 1 - Can the ADP stop the acquisition if it exceeds 70°C ? Today, I have a bug few times, and each times the ADP is relatively warm. 2 - Can I get the frequency of the external clock that I use as source for the oscilloscope ? (It's connected to the trigger 1) 3 - I have a delay equivalent to 4 tick when I acquire more than 320 samples, why? For the third question, I found that putting an offset of 50% erases the problem, but why ? Link to comment Share on other sites More sharing options...
0 attila Posted June 23, 2023 Share Posted June 23, 2023 Hi @Mathias G. 1. The temperature measurement is for the Zynq (CPU+FPGA), the hottest part of the device, which should be fine up to 85*C The AnalogInStatusRecord function is not doing to much, it should not block. This simply calculates and returns the sample statistics based on the last two FDwfAnalogInStatus calls which communicate with the device. 2. In your script Trigger2 is set to the be sampling clock, FDwfAnalogInSamplingSourceSet trigsrcExternal2(12) change it to trigsrcExternal1(11) to be Trig1 (closer to the edge of the device). Isn't the long "time of configuration" caused by this ? the sampling frequency is not what you expected to be, trigger pulses are being used for clocking The undocumented analog-io 15/2 returns the trigger1 frequency. I've added this to use for some automated adjustment from the app, but it is not yet used. dwf.FDwfAnalogIOStatus(hdwf) dwf.FDwfAnalogIOChannelNodeStatus(hdwf, 15, 2, byref(hzTrig1)) 3. The next software version will correct the (+/-10..20) sample trigger delay for external sampling clock. Link to comment Share on other sites More sharing options...
0 Mathias G. Posted June 23, 2023 Author Share Posted June 23, 2023 (edited) 30 minutes ago, attila said: Hi @Mathias G. 1. The temperature measurement is for the Zynq (CPU+FPGA), the hottest part of the device, which should be fine up to 85*C The AnalogInStatusRecord function is not doing to much, it should not block. This simply calculates and returns the sample statistics based on the last two FDwfAnalogInStatus calls which communicate with the device. 2. In your script Trigger2 is set to the be sampling clock, FDwfAnalogInSamplingSourceSet trigsrcExternal2(12) change it to trigsrcExternal1(11) to be Trig1 (closer to the edge of the device). Isn't the long "time of configuration" caused by this ? the sampling frequency is not what you expected to be, trigger pulses are being used for clocking The undocumented analog-io 15/2 returns the trigger1 frequency. I've added this to use for some automated adjustment from the app, but it is not yet used. dwf.FDwfAnalogIOStatus(hdwf) dwf.FDwfAnalogIOChannelNodeStatus(hdwf, 15, 2, byref(hzTrig1)) 3. The next software version will correct the (+/-10..20) sample trigger delay for external sampling clock. Thanks you @attila! I gonna check the SW version, and I had already modified oscilloscope source in External 1 and the trigger on external 2. (That's my actual code) Error with AIStatusRecord happens only when I set a low number of samples (by example 32) and I have the trigger on. I tried and I gonna try many setup with different number of sample then different trigger delay and length of acquisition (both make that works sometimes and sometimes not so I can't say why). Update : Now the device update is done (I was at the 3.19.1 or .2 ... ) AnalogIn_record_test_4bits_vidor.py Edited June 23, 2023 by Mathias G. Link to comment Share on other sites More sharing options...
0 Mathias G. Posted June 23, 2023 Author Share Posted June 23, 2023 (edited) 2 hours ago, attila said: Hi @Mathias G. 1. The temperature measurement is for the Zynq (CPU+FPGA), the hottest part of the device, which should be fine up to 85*C The AnalogInStatusRecord function is not doing to much, it should not block. This simply calculates and returns the sample statistics based on the last two FDwfAnalogInStatus calls which communicate with the device. 2. In your script Trigger2 is set to the be sampling clock, FDwfAnalogInSamplingSourceSet trigsrcExternal2(12) change it to trigsrcExternal1(11) to be Trig1 (closer to the edge of the device). Isn't the long "time of configuration" caused by this ? the sampling frequency is not what you expected to be, trigger pulses are being used for clocking The undocumented analog-io 15/2 returns the trigger1 frequency. I've added this to use for some automated adjustment from the app, but it is not yet used. dwf.FDwfAnalogIOStatus(hdwf) dwf.FDwfAnalogIOChannelNodeStatus(hdwf, 15, 2, byref(hzTrig1)) 3. The next software version will correct the (+/-10..20) sample trigger delay for external sampling clock. Can I have a beta test version with problem of (+/-10..20) sample trigger delay for external sampling clock resolved or that's not possible ? Maybe, you have already test the code I posted before, because now I can't get anything to synchronize at all. (I don't remember changing any parameter other than the triggerpositionset or the number of samples, so the problem is either there or in the software, perhaps). Edited June 23, 2023 by Mathias G. Link to comment Share on other sites More sharing options...
0 attila Posted June 23, 2023 Share Posted June 23, 2023 Hi @Mathias G. Here you can find the installer: See the following example: AnalogIn_SamplingClock.py Link to comment Share on other sites More sharing options...
0 Mathias G. Posted June 23, 2023 Author Share Posted June 23, 2023 (edited) 1 hour ago, attila said: Hi @Mathias G. Here you can find the installer: See the following example: AnalogIn_SamplingClock.py Hi @attila I have try with your program, I have change the frequency to use the frequency of the external clock (I see later that you have already do it... sorry !) . When I use a low quantity of samples, I think that I have a signal synchronous. But when I take more samples (here 640) you can see, that I have different delays everytime. AnalogIn_SamplingClock_test_GM.py Edited June 23, 2023 by Mathias G. Link to comment Share on other sites More sharing options...
0 attila Posted June 23, 2023 Share Posted June 23, 2023 Hi @Mathias G. I the sample code I sent there was: dwf.FDwfAnalogInFrequencySet(hdwf, hzClock) It needs this information to compensate ADC and processing delays for correct trigger position. Link to comment Share on other sites More sharing options...
0 Mathias G. Posted June 23, 2023 Author Share Posted June 23, 2023 (edited) 2 minutes ago, attila said: Hi @Mathias G. I the sample code I sent there was: dwf.FDwfAnalogInFrequencySet(hdwf, hzClock) It needs this information to compensate ADC and processing delays for correct trigger position. Hi @attila I don't know that we need to set the frequency, I understand the problem ! Thank you !! Edited June 23, 2023 by Mathias G. attila 1 Link to comment Share on other sites More sharing options...
Question
Mathias G.
Hi !
I want to set a trigger to start the acquisition in record mode, I use all 4 channels and the trigger is on the pin trigger 2 (the trigger 1 is an external clock).
That's my code but it doesn't work, have I forgotten anything ?
#set trigger
dwf.FDwfAnalogInTriggerAutoTimeoutSet(hdwf, c_double(0)) #disable auto trigger
dwf.FDwfAnalogInTriggerSourceSet(hdwf, 12)
dwf.FDwfAnalogInTriggerConditionSet(hdwf, 0)
dwf.FDwfAnalogInTriggerLevelSet(hdwf, c_double(1.5)) # 1.5V
test_record_pattern_4bits.py
Edited by Mathias G.Link to comment
Share on other sites
15 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now