Author Topic: Hantek 6022BE 20MHz USB DSO  (Read 722747 times)

0 Members and 1 Guest are viewing this topic.

Offline Gyro

  • Super Contributor
  • ***
  • Posts: 7269
  • Country: gb
Re: Hantek 6022BE 20MHz USB DSO
« Reply #950 on: December 17, 2016, 09:17:43 pm »
Welcome to the forum.

The danger can come if you force a high current into the probe ground clip. For instance if you're silly enough to be using a PC power supply to drive a circuit. If you were to accidentally clip the ground lead to the 5V rail you would suddenly get a large number of amps flowing through the ground line of the USB cable (and of course everything in the chain). What happens then is a matter of what fails first. High voltage isn't necessarlly the problem in this case, high current is. It's the same problem with any grounded test equipment, but self-contained scopes will probably fare better than a PC USB port.

You might want to look at USB isolation, as in the Owon VDS1022I (I for isolation). It's my personal favorite USB scope but you need to make up your own mind - even whether you want a USB vs standalone scope. This thread may help you, from the USB scope choice perspective anyway:

https://www.eevblog.com/forum/testgear/owon-vds1022i-quick-teardown-(versus-the-hantek-6022be)/
« Last Edit: December 17, 2016, 09:20:05 pm by Gyro »
Regards, Chris

"Victor Meldrew, the Crimson Avenger!"
 

Offline daybyter

  • Frequent Contributor
  • **
  • Posts: 397
  • Country: de
Re: Hantek 6022BE 20MHz USB DSO
« Reply #951 on: December 18, 2016, 12:41:57 am »
Low voltage is good. But if you want to measure the voltage drop over a resistor in your circuit and the resistor is not directly conncted to ground, you might run into a problem. So if your resistor has a 5V potential at one end and a 3V potential at the other, you connected 3V to USB ground, if you attach the ground clip there.
 

Offline mtx4

  • Newbie
  • Posts: 2
  • Country: it
Re: Hantek 6022BE 20MHz USB DSO
« Reply #952 on: December 18, 2016, 12:39:16 pm »
Oh, thank you so much!
So it's really dangerous out of the box. I don't think so.
Anyway, thanks, probably I'll look for something else.
 

Offline Gyro

  • Super Contributor
  • ***
  • Posts: 7269
  • Country: gb
Re: Hantek 6022BE 20MHz USB DSO
« Reply #953 on: December 18, 2016, 01:10:57 pm »
Glad it helped.

Quote
So it's really dangerous out of the box.

Well not dangerous as such, it's the same precaution that you need to take with any grounded test equipment (you can get magic smoke if you get it wrong) so you always need to remember and take care. It's just that the ground path on a non-isolated USB scope* is a bit more risky as it goes via the computer's USB port.

* Also applies to USB logic analysers etc.
Regards, Chris

"Victor Meldrew, the Crimson Avenger!"
 

Offline TomC

  • Frequent Contributor
  • **
  • Posts: 641
  • Country: us
Re: Hantek 6022BE 20MHz USB DSO
« Reply #954 on: December 18, 2016, 06:49:21 pm »
Hi
I'm new on this forum and I discovered this discussion.
I'm planning to buy this scope, I know its pro and cons, but I don't understand something.
I know it is connected to usb ground, so to my pc ground, but what does it mean?
What can I actually do without break anything, and what have I to do to blown something?
I have only a desktop and I should use the scope for some basic low frequency circuits at low voltage, so where is the danger ?

As long as the probe's ground lead is connected to the circuit's power ground (should be the same ground as your PC) you should be OK! Connecting the probe's ground lead to something else can potentially blow something. This is true for any scope unless you have ground isolation, and that's not always enough depending on the voltages involved.
 

Offline roderick

  • Contributor
  • Posts: 29
  • Country: us
    • Small Projects
Re: Hantek 6022BE 20MHz USB DSO
« Reply #955 on: December 23, 2016, 07:25:27 am »
I'm not sure whether this is the right place to post, or it should be in a separate thread, but I'm working on an alternative software for the 6022BE called BasicScope.  It's open source, and you can find it at http://pididu.com/wordpress/basicscope/ .

Sorry, it's only for Windows, as that's all that the SDK supports. :(

I would dearly love your feedback.
 

Offline daybyter

  • Frequent Contributor
  • **
  • Posts: 397
  • Country: de
Re: Hantek 6022BE 20MHz USB DSO
« Reply #956 on: December 23, 2016, 11:20:52 pm »
Are you also a Linux user? I wonder if it makes sense to port the Win SDK somehow to Linux. I managed to receive some data in a C++ app with libusb. But I guess even if the sdk part would work, porting the Win UI is not feasable?
 

Offline roderick

  • Contributor
  • Posts: 29
  • Country: us
    • Small Projects
Re: Hantek 6022BE 20MHz USB DSO
« Reply #957 on: December 24, 2016, 01:57:33 am »
Are you also a Linux user? I wonder if it makes sense to port the Win SDK somehow to Linux. I managed to receive some data in a C++ app with libusb. But I guess even if the sdk part would work, porting the Win UI is not feasable?
A native Linux app for the 6022BE would be the holy grail, and would win its creator huge accolades.

I think you nailed the precise issues with getting there, though.  Pieces of the solution exist, but are waiting for someone to put them together:

  • There is  no Hantek 6022BE driver for Linux.  That's where you come in.  If you could develop your libusb code to the point where you can provide a library with the same functions as HTMarch.lib, that would be a huge encouragement for the next person to step in.  The interfaces don't need to exactly match the Hantek ones, but it would be a big plus if a programmer could just include HTMarch.h as-is.  As with any data-transfer driver, performance would be important.  From my experience working with the Hantek library, I can say that some features could be omitted.  For example, I wouldn't care if there was no trigger processing at all in dsoReadHardData(), and all I got was a buffer that might cor might not contain a trigger event.  I also have no use for their sin(x)/x interpolation.  If you want to tackle this driver, I'd suggest looking first at my enhanced HTMarch documentation at http://pididu.com/wordpress/basicscope/
  • The second Hantek library HTDisplayDll, is what draws the waveforms on the screen.  RichardK already reverse-engineered that into source that uses only drawing primitives, so that could easily be ported into OpenGL or some similar graphics package, and actually verified on Windows.  Once it worked, it should easily transfer to Linux.  That should be a relatively easy job for someone familiar with such a graphics package.
  • As you stated, the Windows UI doesn't map automaticaly to Linux.  That's the largest job, in my opinion, and beyond what I could reasonably do, but if there was someone familar with writing such apps, it would be a job easily broken up into small tasks.  I started from scratch on Windows (but kept looking at RichardK's source for guidance as to how the Hantek library worked).  My first program did nothing but grab a buffer of samples from the scope at a fixed voltage and sweep setting, and my second program did nothing more than display the samples graphically.  But I already knew the Windows UI, so it was easy to make use of the elements that were readily available.  What we need is that guy for Linux.  Someone who is good with Android could do it.
 

Offline daybyter

  • Frequent Contributor
  • **
  • Posts: 397
  • Country: de
Re: Hantek 6022BE 20MHz USB DSO
« Reply #958 on: December 24, 2016, 03:15:38 am »
What I did was just creating an qt app in qtcreator. I have no real experience with Linux ui in general, since I am a Java guy most of my time. Then I ported the python code to c++, so I can send the firmware to the scope. I must admit, that I don't understand some of the usblib parameters, but it seems to work somehow, since I get data from the scope. At the moment I just display some more or less random looking line, since I don't have any smoothing or interpolation code.

I also don't have a lib. It is all in one app.

To be honest, I am not sure of it makes sense to replicate this hantek sdk. Did you check the alternative firmware? Even with it's reduced bandwidth, it looks more promising to me. if we could establish a stable stream over usb, so no data are lost, the triggering would become a lot more reliable.

It has been a while that I looked at the code. Have to search the virtual machine in which I wrote the code.

Btw: thanks for your blog post on the 6022be. It was very helpful and I still benefit from your ideas on the transistor circuit.
 

Offline Fabio1963

  • Contributor
  • Posts: 9
  • Country: it
Re: Hantek 6022BE 20MHz USB DSO
« Reply #959 on: December 26, 2016, 07:47:14 pm »
Goog morning
I bought an Hantek 6022BE and I've played with its SDK.
I developed a little oscilloscope using VB.NET. If anyone is interested this is the dropbox link: https://www.dropbox.com/sh/qieod71ucovd6we/AADJvoBmMZNcR0kFB8ysS7vSa?dl=0
Any suggestion is welcome
Fabio
 

Offline roderick

  • Contributor
  • Posts: 29
  • Country: us
    • Small Projects
Re: Hantek 6022BE 20MHz USB DSO
« Reply #960 on: December 29, 2016, 02:31:24 am »
Goog morning
I bought an Hantek 6022BE and I've played with its SDK.
I developed a little oscilloscope using VB.NET. If anyone is interested this is the dropbox link: https://www.dropbox.com/sh/qieod71ucovd6we/AADJvoBmMZNcR0kFB8ysS7vSa?dl=0
Any suggestion is welcome
Fabio
Yes!  Very interested in yours.  Just downloaded your installer.
 
The following users thanked this post: soubitos

Offline roderick

  • Contributor
  • Posts: 29
  • Country: us
    • Small Projects
Re: Hantek 6022BE 20MHz USB DSO
« Reply #961 on: December 29, 2016, 04:40:35 am »
...
Any suggestion is welcome
Fabio
I like your program.  As soon as it opened up, it looked like a professional job.  BasicScope has a toy-like appearance.

The installer adds to the professional feel.  I see that you installed HTMarch.dll, but manage to do your own display drawing.  Would your installer also install the Hantek drivers?  Just wondering.  I already had them installed, so it was not an issue.

I like the overview window at the top that shows exactly what part of the waveform is being viewed.  My temptation was to drag the red box around, and it took a few seconds to realize that the scroll bar underneath controlled the red box.

The voltage labels on the left are very convenient.  I notice that the labels reflect the maximum voltage of the two channels, and that you scale the smaller channel down to match the labels.  This would make it hard to see, if (say) I had one channel at the input of an amplifier, and the other channel at the output.  An old style scope would allow 20 mV/div on one channel, and 5V/div on the other channel.  But how to do the labels in this case?  Maybe label on the right side of the display for channel 2, and left side for channel 1?  Could be confusing, I'm not sure of that.

The ability to save data to a text file is a wonderful feature.  That makes it possible for a post-processing program to take the data and analyze it.  BasicScope does not (yet) save into a human-readable format - it only saves binary.

PC Scope seems to need a 1024x768 or so display.  This is fine on my present display, but if someone wanted to use it on a netbook, it might be an issue.  On the other hand, I like that the display is big and readable.  I tried changing the display resolution while the program was running, and that sometimes resulted in a large window, with only a portion used to display PC Scope.

I had trouble at higher sample rates.  With the 32 mS or greater acquisition time, the trigger was rock-steady.  But at 16 mS and 8 mS, sometimes the trigger would miss, both in single and auto trigger mode.  At 21 uS acquisition time (2 uS/div), I was not able to trigger at all, trying to monitor the on-board waveform generator of the scope.  In all cases, the trigger level was set at 464 mV.

I see that you preserve the trigger level when the voltage range is switched.  That is exactly the way I want it.  However, I do notice that if I set the trigger to (say) 9 volts on one display, then change the scale to 4 volts max, the trigger is now off-screen, and I have no way to drag it back down, other than to switch to 20 volts max, drag the trigger down, then switch to 4 volts max.

The vertical green line is the trigger point in time, yes?

There was one quirk I noticed - not really harmful.  If I am running in single mode, and press Start, a trace displays.  Then I switch to Auto mode, and press Start again.  The button to the right of Start says "WAIT..." and so does the title bar.  If I press the WAIT button, the scope stops.  After that, the button is labeled Stop, as would be natural.

Overall, very nice.
« Last Edit: December 29, 2016, 05:24:47 pm by roderick »
 

Offline daybyter

  • Frequent Contributor
  • **
  • Posts: 397
  • Country: de
Re: Hantek 6022BE 20MHz USB DSO
« Reply #962 on: December 29, 2016, 02:26:18 pm »
A screenshot would be cool. So us poor linux users also get an impression. :-)
 

Offline Fabio1963

  • Contributor
  • Posts: 9
  • Country: it
Re: Hantek 6022BE 20MHz USB DSO
« Reply #963 on: December 29, 2016, 05:20:05 pm »
Thank you very much for your positive comments. I prepared a newer version in the same directory. This version eliminates some bugs specially in measures.
Fabio
 

Offline Fabio1963

  • Contributor
  • Posts: 9
  • Country: it
Re: Hantek 6022BE 20MHz USB DSO
« Reply #964 on: December 29, 2016, 05:43:42 pm »
See attached figure
Fabio
 

Offline roderick

  • Contributor
  • Posts: 29
  • Country: us
    • Small Projects
Re: Hantek 6022BE 20MHz USB DSO
« Reply #965 on: December 29, 2016, 06:07:52 pm »
A screenshot would be cool. So us poor linux users also get an impression. :-)
I've added a screenshot of PCSCOPE to my previous post.  That's not as good as actually being able to run the software, but gives an idea of its capabilities.

BasicScope looks very toy-like in comparison, but I think it does have some powerful features, such as continuous mouse-wheel zoom on the running waveform, and consistent triggering.  Here's an example: http://pididu.com/wordpress/basicscope/zoom-in-and-recapture-for-more-detail/

 

Offline daybyter

  • Frequent Contributor
  • **
  • Posts: 397
  • Country: de
Re: Hantek 6022BE 20MHz USB DSO
« Reply #966 on: December 29, 2016, 09:39:55 pm »
Wow! Both apps look great!  :clap: 

Want such an app for linux!   :-BROKE
 

Offline daybyter

  • Frequent Contributor
  • **
  • Posts: 397
  • Country: de
Re: Hantek 6022BE 20MHz USB DSO
« Reply #967 on: December 30, 2016, 12:14:07 am »
FYI: the latest QT versions come with a demo, that is _almost_ a scope application:

http://doc.qt.io/qt-5/qtcharts-qmloscilloscope-example.html

It's just not so easy to actually run it. At least, I couldn't find debian packages for the latest QT versions yet. And you need at least version 5.6 to get the charts module.
 

Offline Fabio1963

  • Contributor
  • Posts: 9
  • Country: it
Re: Hantek 6022BE 20MHz USB DSO
« Reply #968 on: January 01, 2017, 09:27:15 am »
With the help of Roderick in the pcscope testing, I reach a more stable version (1.4.0.0). If anyone is interested can find it at https://www.dropbox.com/sh/qieod71ucovd6we/AADJvoBmMZNcR0kFB8ysS7vSa?dl=0
Fabio
 

Offline Tech_JA

  • Newbie
  • Posts: 3
  • Country: pt
Re: Hantek 6022BE 20MHz USB DSO
« Reply #969 on: January 01, 2017, 01:12:12 pm »
Thanks  :-+
 

Offline Fabio1963

  • Contributor
  • Posts: 9
  • Country: it
Re: Hantek 6022BE 20MHz USB DSO
« Reply #970 on: January 03, 2017, 06:03:49 pm »
Good morning
just to complete the functions of PCscope I've included a little spectrum analyzer in the same directory. Any suggestions is welcome
Fabio
 

Offline Chriss0422

  • Contributor
  • Posts: 8
  • Country: fr
Re: Hantek 6022BE 20MHz USB DSO
« Reply #971 on: January 03, 2017, 06:05:28 pm »
Hello Fabio1963,

Thanks a lot for this software.
Do you think it will be possible to manage also the Hantek 6022BL device?
According to RichardK, the DLL HTMarch.dll is exactly the same. Only the ID of the device is different.
You can see his answer here : https://www.eevblog.com/forum/testgear/hantek-6022be-20mhz-usb-dso/msg480167/#msg480167

Regards.
 

Offline roderick

  • Contributor
  • Posts: 29
  • Country: us
    • Small Projects
Re: Hantek 6022BE 20MHz USB DSO
« Reply #972 on: January 03, 2017, 09:54:22 pm »
Hello Fabio1963,

Thanks a lot for this software.
Do you think it will be possible to manage also the Hantek 6022BL device?
...
RichardK's Open6022 does indeed work with the 6022BL.  Here is a snippet from his code that replaces what was previously a successful dsoOpenDevice() call.  It should be simple to add to PC Scope.

I'm also willing to add support to BasicScope (http://pididu.com/wordpress/BasicScope/) if someone will help me test it.  I don't have a 6022BL.

- Roderick.
Code: [Select]
bool TScope::OpenDevice()
{
 //Attempt to open device
 if(dsoOpenDevice(DeviceIndex))
 {
     //Get Device Type
short DeviceType = GetDeviceType(DeviceIndex);

//If this is a 6022BL device
if(DeviceType == 0)
{
//Set Device to Oscilloscope (instead of logic analyzer)
dsoChooseDevice_(DeviceIndex, 1);
}

//Set flag
DeviceOpen = true;
return true;
 }
 

Offline Chriss0422

  • Contributor
  • Posts: 8
  • Country: fr
Re: Hantek 6022BE 20MHz USB DSO
« Reply #973 on: January 03, 2017, 10:45:14 pm »
Hello Roderick,

I can test for you if you want. Let me know when you have a software that can normally manage 6022 BL device.
 

Offline Fabio1963

  • Contributor
  • Posts: 9
  • Country: it
Re: Hantek 6022BE 20MHz USB DSO
« Reply #974 on: January 04, 2017, 11:57:34 am »
Hello Fabio1963,

Thanks a lot for this software.
Do you think it will be possible to manage also the Hantek 6022BL device?
Good morning Chriss,
unfortunatly I don't have a 6022BL, so I really don't know.
Let me read something and in next days I will try.
Bye Fabio
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf