10-24-2023 11:30 PM
I was wondering if anyone could help a rookie LabVIEW user. I have a Hantek 6074 scope that has a Labview VI example. This scope works fine in both the OEM software along with a really nice VI I found on You Tube ( https://www.youtube.com/watch?v=42CiDx98zlE ). When I use the provided example my voltage is way off. In the attache picture the VI staggers channel 1 through 4. Channel 0 has a zero level of 190. I can adsdjust the 0 levels tp start at 0 on the Y axis. That is not my problem. The issue is , the scalling is off. a 2 volt sqaure wave has a measument of 190 (low) to 255 (high) I assume the 0 to 255 scale has to do with the scope being an 8 bit scope? I am able to lower the voltage reading by increasing the Pchvolt array to 11. It seems 1 to 11 is the range. I can here the relays change state when I enter certain numbers. I there somthing I am missing. Sorry for the amature nomenclature. I would also love some input on any Labview training sources if anyone has a reccomendation. I will attach the VI file and drivers.
Thanks
JKesse
Solved! Go to Solution.
10-26-2023 09:58 AM
So who wrote that "Scope.vi" and where did you find it?
The code seems completely bewildering and does not follow any reasonable coding guidelines (greedy while loops, fake FOR loops, complicated processing of diagram constants, completely unnecessary sequence structure, etc.). And why do you use "continuous run" to run it???
(I am also not sure about the youtube example, seems to be written handing everything with references and property nodes, which seem weird.)
10-26-2023 01:46 PM
That code is not really LabVIEW. It's just a bunch of DLL calls that someone connected together. It looks like this is a headless scope dedicated to Automotive CAN bus work. I would just stick with the App that ships with it.
The LabVIEW Instrument Driver Network does not even recognize Hantek, so I doubt there are LabVIEW drivers for it. Instrument Driver Network (IDNet) - NI
Here is a good place to start learning LabVIEW:LabVIEW Tutorial (ni.com)
10-26-2023 08:24 PM
Thanks for responding . The scope is a regualar 4 channel usb scope. I will try and get some more experience with labview . I am trying to find a way to get 4 high voltage inputs from a generator into a labview VI. I was thinking I could use the scope with some attenuation to get the inputs. I am an industrial generator tech and I am trying to make a VI to troubleshoot in the field. Thanks again.
10-26-2023 08:27 PM
The VI example is from the Hantek website. The Youtube VI works great, actually better than the o.e.m software. I have written my own vi that works with the usb 6009 daq. The vi works great. I am trying to make a generator diagnostic tool ( I am an industrial generator tech) I thought I would be able to use 50 - 1 attenuato
rs on the analog input of the 6009. Unfortunately the 6009 does not have the standard front end impedance that normal pre-built attenuators are built for. I was hoping I could use the 4 channels of the hantek with my attenuators to get a 208 VAC reading. There is a commercial automotive scope that was made a while back using the NI usb - 6009 . They modified it so it could handle up to 500 vac. If worse comes to worse I will try and make my own attenuators ( I think the 6009 has an impeadence of 144 k ohms vs 1 m ohm. That said, I still would like to be able to get accurate readings via labview using the Hantek scope I own. I really appreciate you taking the time to answer.
10-27-2023 01:22 AM
Hi Jesse,
@Jesse47 wrote:
The VI example is from the Hantek website.
And it's a very bad example regarding LabVIEW coding style...
@Jesse47 wrote:
I was hoping I could use the 4 channels of the hantek with my attenuators to get a 208 VAC reading.
There is a commercial automotive scope that was made a while back using the NI usb - 6009 . They modified it so it could handle up to 500 vac. If worse comes to worse I will try and make my own attenuators ( I think the 6009 has an impeadence of 144 k ohms vs 1 m ohm.
As an "industrial generator tech" you surely follow all safety regulations when "playing" with voltages >=48Vac... (Just to make sure.)
@Jesse47 wrote:
I was hoping I could use the 4 channels of the hantek with my attenuators to get a 208 VAC reading.
I still would like to be able to get accurate readings via labview using the Hantek scope I own. I really appreciate you taking the time to answer.
So can you read small DC voltages correctly using your Hantek scope and that example VI?
As the example VI is rather "small" (aka "limited"): did you read the programming manual for your scope to learn how to handle additional attenuators and all their settings automatically/programmatically?
10-29-2023 11:39 AM
I appreciate you taking your time to help
Answeres to your questions
1. 'So who wrote that "Scope.vi Not me The Manufacturer wrote it.
2. where did you find it? The Hantek website . Its the downloaded SDK
3. why do you use "continuous run" to run it? Not sure why I hit continius when I ran it. When I first started using LAbview I thaught that was correct. I have since learned not to.
Do the answers to these questions provide you with information regarding my request for assintance?
10-29-2023 12:03 PM
As far as handleing attenuators I am pretty expeienced with scopes and the use of attenuators. I am not sure if you are asking if the manual has any info on programatically using them in Labview or the oem software . I know how to use them with the OEM software along with the scaling property in labview. The voltage I measured in the picture is a 2 volt square wave and maxes out to 255 . Any labview scaling vi that I add does not apply in a linier fasion. I am way to inexperienced to make a new VI . I am just looking for help to obtain a simple waveform to monitor 4 channels of a 208 vac circuit with the use of x20 or x50 attenuation. I am trying to build a labview VI to troubleshoot generators. Im trying to learn labview and thaught it would be a fun project. I am so amazed with labview and all the possiblities. I was able to make a modbus vi along with an arduino and a 6009 to control and monitor the I/O on a Generator. It can bypass and trigger inputsd to help in the troublshooting process. It can also field flash the backend and monitor the output to help troublshoot as well.At the end og the day I am just tryiing to get a high voltage reading on 4 channels. I thaught the Hantek scope would work since it has the capability to read higher voltages with ther use of a standard attenuator. Unfortunatly I cant even read 1 volt dc with the Labview VI. My USB 6009 works perfect up to 20 volts in differential mode. Unfortunatly the impeadence is 144kohms ( i think ) The standard bnc attenuators for scopes are desighned to be used on 1m ohm scopes. Im looking into m aking my own attenuators and using the usb 6009.
Thanks again for your help.
Please excuse my rookie understanding of Labview. I just started using it.
10-30-2023 10:39 AM
@Jesse47 wrote:
As far as handleing attenuators I am pretty expeienced with scopes and the use of attenuators. I am not sure if you are asking if the manual has any info on programatically using them in Labview or the oem software . I know how to use them with the OEM software along with the scaling property in labview. The voltage I measured in the picture is a 2 volt square wave and maxes out to 255 . Any labview scaling vi that I add does not apply in a linier fasion. I am way to inexperienced to make a new VI .
I have worked on integrating scopes into LabVIEW for years and one of the big issues that comes up is the quality of labview drivers and example code provided by the manufacturer. In some cases all you need to do is download a manufacture driver package and you are off an running wit every feature and function you could imagine and in other cases you have to write everting from scratch because what is provided is garbage or does not exits. I have never used a hantek scope but it sounds like their provided code is not the best and is not going to work for your application. In this case someone is going to need to write the code that works for it.
The 8bit data stream is typical for a scope. As it turns out it worked great with GPIB since that was an 8bit parallel data bus so that was they way scopes worked for years. You would get a scaling factor and then all the data would be 8 bits unsigned integers. Wen you say that that a scaling factor does not apply linearly, what are you expecting? If you are measuring a 2v square wave and you are getting back 255, your scope is probably in the +/- 2v range so you will have some 8bit quantized stepping if you zoom in on the 2v region, this is normal in the scop and in labivew. If you are going for enhanced resolution or some kind of interpolation that will be out of reach if you can not make a new vi or write the driver code that requests floats from the scope.
12-12-2023 11:58 PM
Thank you for your response. Very impressed with your knowledge in this area. I was watching a video on someone who designed a pretty nice VI break down the process. He did mention interpolation. Can you suggest a starting point for someone interested in learning LabVIEW and wants to focus on Data acquisition? I am an Industrial power generation tech so my programming knowledge is non existent. I have made some basic Vi's to automate load banks and to preform some diagnostic testing using the USB 6009 daq. I really enjoy making a custom programs and would love to be able to do more complicated tasks in labView. Again , I appreciate your previous answer.