From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tektronix Oscilloscope Interface

I have written a LabView program in which I select two oscilloscopes connected on two USB ports of the same computer and want to acquire data right after the trigger.

When the VI is run, only one scope comes in "waiting for trigger" state and acquires the data after the trigger. 

As the trigger occurs, the second scope shows ready state and acquires the data in next trigger.

I want to get the data by both scopes on a single trigger.

Thanks in anticipation.

 

0 Kudos
Message 1 of 12
(2,685 Views)

Well, step 1 is show us the code.

But it sounds like you have a dataflow dependency between the two calls, and so the second call only starts after the first call finishes.

To correct this, ensure that neither of the two tasks have a dependency on the other.


GCentral
Message 2 of 12
(2,668 Views)

Ok Thank you for your response.

I have attached the image of the Bolck diagram.

Thank you in Anticipation.

0 Kudos
Message 3 of 12
(2,592 Views)

You have a Flat Sequence Structure with three (visible) frames:

  1. Setup the two acquisitions. This looks more or less OK, and they can run at the same time
  2. Acquire the first result and then close the first connection
  3. Acquire the second result and then close the second connection.

The nature of a FSS is to prevent sequential frames from occuring at the same time.

Based on the code you show in the png, there's no way these can occur at the same time!

 

You could choose to merge the second and third frames (right click on the border and choose "Merge Frames" is I think the term) and then it will probably do what you want.

 

Also, why not place the TF Current, CS Current, VF Current and Rogowski Coil Current indicators directly at their measurements? What is the purpose of the Local Variables?


GCentral
0 Kudos
Message 4 of 12
(2,585 Views)

As a possible follow-up, I'd suggest creating a Cluster with the necessary controls to specify a single channel, making it a typedef, and then using that to configure your channels.

 

You could then use a For loop and an array of that cluster to have 4 channels on the front panel more easily configurable.

 

This is an example I wrote for you with the Agilent driver that ships with LabVIEW. You could do the same with your Tektronix system:

Here, not a typedef  - you should use a typedef!Here, not a typedef - you should use a typedef!

Note that I didn't create a typedef for the "Configuration" .ctl I used here, but you should for yours!

 

To be clear, the contents of your cluster would be the Ch Number, Vertical Coupling, Probe Attenuation, Vertical Range + Offset, and Bandwidth settings. You could then output just the Channel Number as an indexing tunnel, and get the array you need for the Multiple Waveforms measurement without having to use a Build Array node.


GCentral
0 Kudos
Message 5 of 12
(2,583 Views)

Thank you very much for making the front panel beautiful for me. Definitely I will follow your instructions after I troubleshoot the issue asked in my posted question.

Best Regards.

0 Kudos
Message 6 of 12
(2,577 Views)

Dear Sir,

I have made the changes i.e., merging frames and removing local variables.

But the problem persists.

I state the problem again as follows:

When i run VI, both scopes are configured automatically and first scope comes in state of waiting for trigger and the second one not.

As the trigger comes, first scopes gets triggered and gets data. As the first scopes completes work, the second scope gets ready and waits for trigger.

I need both to get the data at the first trigger.

Thanks.

0 Kudos
Message 7 of 12
(2,573 Views)

Hmm...

From what I can see in your latest picture (2scopesd.png, 60KB) there isn't anything that would cause them to wait for one-another now.

 

Can you open the VI with "Multiple Waveforms", 45000 and the array of channels (Read, or something probably) and then do the following:

  1. Use Ctrl+i or go to File > VI Properties
  2. Use the dropdown box to navigate to the "Execution" tab
  3. Check the left hand side for the "Reentrancy" setting? Perhaps attaching a screenshot of this page would be good.

It may be that the Read VI only allows a single call site at a time. In that case, I'll try taking a closer look at some documentation or downloading the driver, but you might (might) be able to change it from "Non-reentrant" to "Preallocated reentrant" and see if that makes a difference. Know that if it is set to non-reentrant, you should be careful changing it because the programmer who created it might be relying on that property...

 

Of course, it may already not be non-reentrant, in which case, I'm not sure what the problem is!


GCentral
0 Kudos
Message 8 of 12
(2,546 Views)

Good Morning,

I attache the screenshot here. By default, it was at "Non-Reentrant Execution". I changed it to "Pre-Allocated Clone Reentrant Execution" and run the program again but the same response. 

 

0 Kudos
Message 9 of 12
(2,525 Views)

So following your latest comment I downloaded the driver and checked the code inside.

 

All of the contained VIs in "Read (Multiple Waveforms).vi" are non-reentrant.

In some cases, this isn't a huge problem (because the VIs will be fairly fast) but in at least one and perhaps two cases, this is causing you a problem.

 

  • Wait for Trigger.vi - this almost certainly must be reentrant if you want to be able to get them to trigger on the same edge
  • Fetch Waveform.vi - It doesn't look like this should take too long, and it only happens after the acquisition, so probably it doesn't have to be reentrant. However, if changing just the "Wait for Trigger" VI isn't enough, I'd try this one too.

I just want to also check that when you have the two instruments set up, they're not sharing any part of the communication circuit? So long as they're connected separately, changing both of

  • Wait for Trigger.vi
  • Read (Multiple Waveforms).vi

should be enough to get you what you want. I'd probably also try setting "Initiate.vi" to preallocated to reduce the chance of missing an edge by a narrow margin, but I expect it isn't strictly necessary.

 

Good luck 🙂


GCentral
0 Kudos
Message 10 of 12
(2,515 Views)