LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with amount of Loops

Hello everyone,

 

I'm using Labview 2011 to decode an IRIG-B signal. I took the example written for FPGA from this link http://zone.ni.com/devzone/cda/epd/p/id/3396 and adapted it, given that I won't use a FPGA, but an acquisition board. On the "bitdefiner.vi" I added a timeout - so it would skip this vi if it took too long - and changed it and all the conversion vi's to reentrant operation since I wanted to execute multiple decoders at once. Furthermore, provided that I don't have the acquisition board yet, I created a VI - for test purposes - that would generate the IRIG signal and would pass the data do the "bitdefiner.vi" using functional global variables.

This worked well for 2-3 parallel while loops (setup like the "loop.jpg" image), however when this number increased, a strange "phenomenon" began to occur. With 8 loops, starting each one at different periods of time, the "bitdefiner.vi" is not able to access the functional global, or so it seems, because it simply does not respond to the timeout, for an example, even tough the timeout is set to 15ms, the diff indicator (again on bitdefiner.vi) shows 54ms; only after 5 decoders are running the program stabilizes and starts decoding correctly.

What would explain that and is there a way to work around this?

 

Thank you in advance for any support.

Download All
0 Kudos
Message 1 of 5
(2,199 Views)

Hi Edmi0!

 

Could you attach your VI's?

I guess it will make easier to us to solve your problem!

 

Regards,

Barbara Pracek
Engenharia de Aplicações
National Instruments Brasil

0 Kudos
Message 2 of 5
(2,105 Views)

If I see code like this, I am very suspicious about the code overall. What would happen if you only would keep the "equal zero" and delete the rest?

 

 

(For a large collection of similar constructs, have a look here. Actually, your code looks very familiar) 😉

 

It all seems way too convoluted. Why do you need an inner loop and local variables at all?

I am sure there is a logical explanation for what you are seeing, so please attach some real code as requested above.

 

 

 

0 Kudos
Message 3 of 5
(2,091 Views)

Thanks for the reply, guys!

 

However, I managed to solve the problem in the last couple of days. It was related to greedy loops.

 

And altenbach

there's no logical explanation for this "beauty". I ended up adapting pre-existing code and, as you saw, didn't do a thorough job, just changed what was necessary.

But thank you for pointing it out. It definitelly needed to be changed

0 Kudos
Message 4 of 5
(2,080 Views)

The idea of this code is to get a rising edge of a signal (generated one point at a time - polling style) and count the miliseconds until its falling edge.

To be honest, I'm not quite happy about it, but never took the time to improve it. Guess it is time now... any idead would be welcome Smiley Happy

0 Kudos
Message 5 of 5
(2,064 Views)