LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why is my code so dog slow?

Brand new to labview.

 

I want to hook my picoscope oscilloscope up to my labtop and measure from currents and voltages. I attached my code. It's just the example code for the picoscope with my measurements tossed in on the lower left corner.

 

But it runs like a dog. 

 

Is there some way to optimize this or do I just need to order a supercomputer.

 

Thanks

0 Kudos
Message 1 of 11
(1,595 Views)

Can you open your VI then choose "Save for Previous Version" and choose, say, LabVIEW 2021?  Many veteran LabVIEW users don't upgrade every year (nor do I ...).

 

0 Kudos
Message 2 of 11
(1,591 Views)

I gave it my best shot

0 Kudos
Message 3 of 11
(1,584 Views)

A lot of us won't have this PicoScope so we'll need some help understanding which part specifically is slow and what you consider slow. Some immediate things I would probably check are:

 

1. You can monitor the iteration terminals of each while loop to see how often each is executing. I would be interested to see if the outer most while loop is executing more often than you expect. Changing settings and creating large buffers for scopes can take a while so if that is happening between every measurement then it will definitely slow things down.

2. What is your sampling rate and how many samples are you waiting for? If you have to wait for the scope to finish acquiring all of it's data, it doesn't matter how good of a computer you have.

Matt J | National Instruments | CLA
0 Kudos
Message 4 of 11
(1,574 Views)

We cannot really analyze your code much because we don't have any of your drivers. Which part is the example code that came with the instrument? (There is nothing interesting in the lower left corner!)

 

Do you know which part is slow? For example, what is the typical value of the orange wire going into that innermost stalling loop? Why do you have a pyramid of stacked loops instead of a clean state machine?

 

All these express VIs and dynamic data don't really help either. How many points are in each graph?

 

0 Kudos
Message 5 of 11
(1,569 Views)

Can you open your VI then choose "Save for Previous Version" and choose, say, LabVIEW 2021?  Many veteran LabVIEW users don't upgrade every year (nor do I ...).

 

Are you using the software that Pico provides to link with LabVIEW?

 

Bob Schor

 

0 Kudos
Message 6 of 11
(1,562 Views)

Sorry, lower right corner, it was a long day and I got my left and right mixed up.

 

I attached the original example file so you can see the difference. It ran fine, but after I added my stuff it really bogged down

0 Kudos
Message 7 of 11
(1,555 Views)

>1. You can monitor the iteration terminals of each while loop to see how often each is executing.

 

How do I do that?

0 Kudos
Message 8 of 11
(1,520 Views)

@ELentz wrote:

>1. You can monitor the iteration terminals of each while loop to see how often each is executing.

 

How do I do that?


 

Connect an indicator to it!

0 Kudos
Message 9 of 11
(1,516 Views)

I've used a picoscope and slow/fast is depending of lot of things:

- The numbers of samples you are querying ==> until they are all available the dll is waiting and your VI is in a waiting state as well

- The timebase for the acquisition 

 

In fact like every acquisition instrument you are depending of the data avaibility. Try with less samples and a smaller timebase, it should update quicker ( but then if you have a signal processing to do you will have less time to operate before the next batch of data is coming).

0 Kudos
Message 10 of 11
(1,467 Views)