LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I program a Keysight Oscilloscope?

Hi, I am new to LabView and I need some help.

 

I have to program an oscilloscope (a Keysight InfiniiVision DSOX2004A), it should do the following:

-Set the trigger for Channel 1 (Ch1) to 1V. When the Ch1 is triggered (t=0 s), move to t=55e-6 s and save Ch3 data (Ascii format) to a file, and wait for 500 ms.

And I need to do this for every Channel. (Set the Ch3 trigger to 1V, save Ch1 data, set Ch2 trigger, save Ch4 data, set Ch4 trigger, save Ch2 data).

 

To be honest, I don't even know where to start. Currently I can communicate with the oscilloscope using the usb-usb cable (I was unable to communicate using the GPIB-usb cable), and I have the "Agilent 2000 3000 X-Series" drivers installed, but I don't know what do I have to do with all the .vi files.

Currently, the only thing I know is that there is a .vi file that is called "Configure trigger (Edge).vi" that sets the trigger to a desired value to a specific Channel (it sets the trigger, but the oscilloscpe doesn't actually trigger when it should).

 

Any help would be much appreciated.

Many thanks 

0 Kudos
Message 1 of 12
(10,144 Views)

Hello,

 

since you mentioned that you can communicate with the Osci, I assume you have the appropriate NI-VISA installed according to your LabVIEW version.

 

The first things I would ask you is:

  • What is your LabVIEW version?
  • Could you please upload the VI you have problem with?

It would also be good if you could tell us where you have these VIs from (Website for example), for some  checks.

Greetings and Regards,
James
0 Kudos
Message 2 of 12
(10,103 Views)

Yes I have NI-VISA1700full (and also Keithley VISA as a secondary VISA, but disabled). I run LabView 2017 in a Windows 10, 64-bit laptop.

 

I don't have problems with a particular .vi. My problem is that i thought that the drivers of a device would be a single .vi, that mimics the hardware of the oscilloscope. However, in this case the driver is a bunch of .vi files that make very specific functionalities, and I don't know how to combine them to make my purpose.

The only thing that I know how to do, is to configure the trigger (running the "Configure trigger (Edge).vi"). However, I don't know how to push the "Single" button in the device, from Labview (in order to actually trigger the oscilloscope). I also don't know how to, once triggered (at t=0), move to time t=X s and then save the data to a file... and so on.

 

The driver of the oscilloscope is the "Agilent 2000 3000 X-Series", which you can find here: http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=9E84674573AF6AB8E0440021287E6A...

 

 

0 Kudos
Message 3 of 12
(10,095 Views)

OK, lets not go getting everyone confused by bringing Kiethley into the discussion about a Keysight instrument.  Fair?

 

You have the right driver for the device.  If you installed it correctly you even have examples in the example finder.  you COULD just open the driver project (the *.lvproj file) and explore the examples there.  

 

There is no "Soft Front Panel" for that instrument (A shame really) so you would need to write that yourself.  It is a lot easier to figure out what you need to do and just code that.  After all, if you need an operator chosing from everything that scope can do- well- the instrument has a bunch of knobs for him to use right there and the PC is pointless


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 12
(10,090 Views)

>> OK, lets not go getting everyone confused by bringing Kiethley into the discussion about a Keysight instrument.  Fair?

Ok, I tried to change the topic title.

 

I opened the examples, some of them doesn't work as expected (the waveform doesn't show correctly in the plot, for example, or the device acquires the default setup before and after running an example...), anyway, if I open the block diagram, I do not understand anything!

I thought that, for example for setting the trigger, one just need to send some commands (referenced in the Programmer's Guide of the device) to the oscilloscope, but the block diagram is just intelligible to me!

 

If do it step by step, my next step is to trigger the oscilloscope (I already know how to set the trigger, by running the "Configure Trigger (Edge).vi"). I do it manually by pressing the "Single" button in the front panel of the device.

Any ideas how can I press the "Single" button that is in the hardware, from the computer?

0 Kudos
Message 5 of 12
(10,081 Views)

That vi is called "Force Trigger" it does exactly what the button on the front of the scope does

Capture.png


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 12
(10,077 Views)

Yes but I don't want to simulate the "Force trigger" button. I want to simulate the "Single" button. The first one forces the signal to be captured, even if trigger conditions are not met. However, the "single" button lets the oscilloscope display signals continuously until the trigger condition is met (in my particular case, that Channel 1 rises up to 1V). When the trigger condition is met, then it stops and display the captured signal.

0 Kudos
Message 7 of 12
(10,061 Views)

Yes but I don't want to simulate the "Force trigger" button. I want to simulate the "Single" button. The first one forces the signal to be captured, even if trigger conditions are not met. However, the "single" button lets the oscilloscope display signals continuously until the trigger condition is met (in my particular case, that Channel 1 rises up to 1V). When the trigger condition is met, then it stops and display the captured signal.


My understanding of "Configure Trigger (Edge).VI" and any trigger in general (excluding "Force Trigger" because the documentation explicitly says how it works) is that the acquisiton (or whatever) starts when the trigger condition is met.

 

One thing you can try, is to continously acquire your waveforms e.g. with Read Waveforms.VI and compare the data with some value. When the condition you want is met (it has reached 1 V), stop the task.

0 Kudos
Message 8 of 12
(10,041 Views)

I would suggest taking a read through the programmers guide for Keysight.  I communicate with many Keysight/Agilent/Hp devices, but not oscilloscopes from that company.  They usually have very good example codes and descriptions of the commands in their manuals.  I would also suggest you post the code that you are trying to run so that the community can see where there may be a problem.

 

It seems you understand the triggering system.  Just to reiterate your last comment on the 'single' button...the single button only allows the scope to repspond to a single event.  You seem to be able to do this by hand properly when physically manipulating the scope.  There is likely some hidden things going on when you use the example code, and believe me it's not easy to spot when you are learning LabVIEW.  

 

I will hazard a guess and say that you might be configuring the trigger system, but not making it active.  The single button on the device itself is activating the trigger system.  

 

Another possibility is that if you use something like an 'initialize' vi, they typically by default will perform a reset of the device.  If this is happening, settings that you thought were configured may have been set back just as if you pressed the auto-set button which is usually on scopes (I can't stand the auto-setup buttons.  I hit them by accident too many times!).

 

A third possiblity is that the commands you think you are sending to the device are not actually making it to the device.

 

Try a screen capture or post your vi so that we can help you out.  Good luck!

Message 9 of 12
(10,022 Views)

You need to set the trigger in Single mode then you need to tell the scope the "run" command, which is often the text run. This will put the scope in a running state ready to acquire data. Once it gets a trigger, it will stop automatically once one waveform is acquired.

 

You could set up a "Service Request" from the scope to let you know when the trigger is complete, but, that may be a little advanced at this stage.

 

mcduff

0 Kudos
Message 10 of 12
(10,020 Views)