| General > General Technical Chat |
| Review: Hantek DDS 3X25. Anyone own one? |
| << < (65/108) > >> |
| ElektroQuark:
Hola Manuel: Please, share the code. I'm interested in it. Un saludo. |
| msraya:
ok, it will go. This is a Matlab function wich takes as arguments, the amplitude of the signal, the frecuency of the signal and the rise time and the fall time and sintetize a triangular periodic waveform. The timeline of the signal is a+b+c+d. a is the pre-signal time, b is the rise time, lineal function, c is de fall time, linear function and d is the "trail" time or post-signal. In my sintesis I made arbitrairly a=d/10 . na,nb,nc,nd are the number of digital samples that form the signal. The signal generation in MATLAB is a lot more easy than for VISUAL BASIC. I hope you understand the code. This code does not work in MATLAB 64 bit over Windows 7 64bits. I right now use a Virtual Box Windows XP Machine over Windows Seven 64 bits. It works with Hantek via USB 100%. The noise with low amplitude signal is bad (environ 4mV), but if we use the maximun amplitude and use a external atenuator, noise is lower. If I have time, I will make a 32bits application in Visual C++ for MATLAB 64 bits compatibility. It will translate TCP/IP inquiries to the HANTEK DDS 32bits DLL. The better solution is than we have a Hantek 64bits DLL. But I dont know if the company will supply this. IMPORTANT: This DLL use the _stdcall calling convention. It must use a modificated mHeader file. Here explain how to create and use the mHeader file: http://www.mathworks.es/support/solutions/en/data/1-671ZZL/index.html?product=ML&solution=1-671ZZL function pulso(amplitud,frecu,tsub,tbaja) %UNTITLED pulso(amplitud,frecu,tsub,tbaja) frecu en Hz, tiempo en useg % Detailed explanation goes here loadlibrary('DDS3X25Dll.dll',@mHeader); error=calllib('DDS3X25Dll','DDSSearch'); if error==0 unloadlibrary('DDS3X25Dll'); disp('Error con dispositivo.'); return end error=calllib('DDS3X25Dll','DDSCheck',0); if error==0 unloadlibrary('DDS3X25Dll'); disp('Error con dispositivo.'); return end nPer=0; nPoints=0; pnp=libpointer('int32Ptr',nPer); pnpoin=libpointer('int32Ptr',nPoints); [error respoin resPer] =calllib('DDS3X25Dll','DDSSetFrequency',0,frecu,pnpoin,pnp); if error==0 unloadlibrary('DDS3X25Dll'); disp('Error con dispositivo.'); return end freqm=respoin*frecu; d = ((1/frecu)-tsub*1E-6-tbaja*1E-6)*10/11; a=1/10*d; na=floor(a*freqm); nb=floor(tsub*1E-6*freqm); nc=floor(tbaja*1E-6*freqm); nd=ceil(d*freqm); may(1:na)=0.0; mx=na+1:1:na+nb+1; may(na+1:na+nb+1)=((double(mx)/(double(nb)+1.0))-((double(na)+1.0)/(double(nb)+1.0)))*(double(amplitud)/3.3); [x ptr]=size(may); mx=ptr+1:1:ptr+1+nc; tmp=(1.0+(double(ptr)+1.0)/double(nc)); may(ptr+1:ptr+1+nc)=(tmp-double(mx)/double(nc))*(double(amplitud)/3.3); may(ptr+1+nc+1:respoin)=0.0; %plot(may); y=2048-2047*may; py=libpointer('uint16Ptr',y); error= calllib('DDS3X25Dll','DDSDownload',0,py,respoin); if error==0 unloadlibrary('DDS3X25Dll'); disp('Error con dispositivo.'); return end unloadlibrary('DDS3X25Dll'); end |
| saturation:
Gracias too Manuel. And all those contributing to help hack the software better. Its great when we can squeeze so much out of it, and realize its potential. --- Quote from: EdoNork on August 31, 2011, 08:50:07 am ---Hola Manuel: Please, share the code. I'm interested in it. Un saludo. --- End quote --- |
| msraya:
Ok, To share is To Live!! HI! I do not know if my code has bugs in the sintesis of the signal. By Now It work for my purposes. I am generating more and diferent pulses and it works. But the AWG does not work in single mode, only work in repetitive mode. In this way I lost resolution when my signal is more length and complicated. The generator in single mode only outputs 5ms of repetitive signal, actually nosense.. I am looking for a reputed ebay seller for get the hantek 3064A. The 3064 and 3064A oscilloscopes are much similar and new products. Manuel |
| ElektroQuark:
--- Quote from: saturation on August 31, 2011, 02:24:52 pm ---Gracias too Manuel. And all those contributing to help hack the software better. Its great when we can squeeze so much out of it, and realize its potential. --- End quote --- Yes, thank you all. (Sorry for a "thank you" only post). |
| Navigation |
| Message Index |
| Next page |
| Previous page |