Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

TDS 2012 some driver Vi´s work but Acquire Waveform produces an empty waveform graph

I ll be talking about using a RS232 Serial Connection here.

 

Here is what works:

 

I have a large program that allows me to set and measure values on the oscilloscope.
 So far I have managed to set parameters such as vertical and horizontal scale and position (by sending string commands) and am also able to send basic commands that then return values for i.e. the frequency of the signal on channel 1.

 

The problem is this:

 

What I wanted to do is to get the waveform from the scope. I tried just using the example from the TDS 2000 series driver but it doesnt appear to work.

 

Specifically it appears that for the Continous Waveform.vi produces an empty waveform. When I probe the waveform wire in the loop I can see that there are two values t (time) and x. While x changes the value sometimes, t is ALWAYS 0 and this is what probably makes the waveform graph look empty (even with autoscale I can´ t see anything). SEE ATTACHED PIC.

 

Can somebody pleas help me to get the full Waveform displayed? I need to finish this project as soon as possible!

 

PS: I remember using the very same example last year for a TPS 2014 and back then it worked fine.

 

My Setup:

 

  • Win8 - LabView 2012 SP1 - MAX 5.5 - VISA 5.4.1 - TDS 2000 Driver package
  • Tektronix TDS 2012 Oscilloscope connected to the PC with an FTDI USB to RS232 adapter
  • The TDS 2000 driver package requires VISA 3.x , am I right to assume that 5.4 is downward compatible? (other vi´s to set parameters work)
  • I use a 10x probe ont he scope to get a square wave on CH1
  • SERIAL PORT settings in WIN8 device manager & NI MAX & in the LV vi itself:
  • Baudrate(9600), DataBits(8),Parity(None),Stop bits(1), Flow control( hardware - RTS/CTS)

NOTE:


In MAX VISA test panel I can querry the scope and that works too. However the Buffers are both set to 0 there, is that oke?

Also, should I use hardflagging for this vi or just "none"?

0 Kudos
Message 1 of 10
(5,470 Views)

A buffer of 0 sounds really dangerous to me.  I tend to set that to the maximum.

 

It looks like you are just getting 1 samples out.  This could be related to the buffer, but hard to say for sure.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 10
(5,463 Views)

I was also wondering wether the settings I have in MAX are being overwritten by the vi itesf. Because the VISA read/write in the Driver Vi´s usally have a 256 integer to the # of Bytes input wired - is that the Buffer?

 

Along the same lines: If I set the Flow Control in MAX to hardware flagging but in the Vi itself to "none" which one is it gonna take?

0 Kudos
Message 3 of 10
(5,457 Views)
Whatever settings you have in the VI will override MAX settings. If your flow control settings in the VI do not match the instrument, you will get an error.

Check the settings for the acquisition. I seldom trust the auto-set. Explicitly set the horizontal, vertical, and trigger.
0 Kudos
Message 4 of 10
(5,453 Views)

What do u mean by the settings int he Vi have to match the instrument? Whatever values for Baudrate etc. I set in the vi is controlling the settings in the scope. After I have run the vi the scope ll have the settings I sent to it in the vi.

 

Can anyone tell me where I should look for the cause of my problem? Since I can querry the scope, set some values and even get measured values from it I dont think its the SERIAL PORT itself. Am I right?

 


Also, do I have to take anything into consideration when I use the hardflagging flow control (like special setup in the vi´s?)

 

0 Kudos
Message 5 of 10
(5,445 Views)
The settings in the VI control the settings on the pc, not the instrument. As I said, of you had a mismatch, you would get an error. As I also said, you need to check how they acquisition is set. You know nothing because you are using auto-set and have no real idea what that is unless you manually view the scope.
0 Kudos
Message 6 of 10
(5,441 Views)

I only went to look at the example because my main program, that does all that (initialize, set horiz, vertical scale and position) but when it goes into the Acquire Waveform it returns an empty Waveform - just like the example.

 

As I said I can also get the scope to give me actual values for measurements it did (i.e. it gives me the frequency which I can work with and display on the Front panel).

 

So I was thinking there is a problem with the flow control (or something related) as commands that make the scope output short strings seem to work, but when it comes to longer strings such as a waveform and a screenshot things go wrong - without an error message (in fact all the VIs error wires show OK).

 

I am looking for an explanation as to why short outputs seem to work and long ones apparently fail. If I posted a a screenshot of I/O trace would you be able to help?

 

EDIT (attached a the trace - in the picture the last line is missing, all it says is VISA close "COM1")

 

 

0 Kudos
Message 7 of 10
(5,435 Views)
The actual waveform returned is all dependent on how you have configured the scope to acquire. I keep saying this and keep saying that the acquisition setup is completely unknown since you are sending the auto setup command to the scope. For all that you know, the acquisition setup is for one point only. As I said, use the functions to explicitly configure the acquisition type, vertical, horizontal, triggering, etc. You could also remove the auto setup call, and after manually configuring the scope, initiate a capture and do a fetch.
0 Kudos
Message 8 of 10
(5,429 Views)
Another thing to check is whether the Enable Termination Character is set to False before doing the read. This is necessary for reading things like the response from IDN? but when you read a binary waveform, can cause a premature end to a read. The driver SHOULD be doing this but it's a good idea to double check.
0 Kudos
Message 9 of 10
(5,424 Views)

I now use a minimalized version of my program where I set everything myself and do a "single acq" to "freeze" the screen. Then I use the low level FetchWaveform.vi that comes with the driver and is ALSO used in the example we talked about earlier.

 

I put some probes into this FetchWaveform.vi (see picture). It appears that the acquisition is for 1 point only but I dont really know how to change it (add a loop somewhere?).

 

If anyone has used VISA before I believe you are able to help me just from looking at the picture!

 

NOTE: the left side of the pic is cut off but that is only a concatenate string system that produces the string you can anyways see on probe 7)

 

EDIT: While the Y coordinate (probe 14) is specified as an 1D array it appears to only have 1 entry.

0 Kudos
Message 10 of 10
(5,411 Views)