LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[cRIO - FPGA] Parallel loops with the same subVI do not run

Hello,

 

I developed the following LabVIEW code for decoding digital signals from two dual channel on NI 9402 module.

 

image.png

 

But, when I create a subVI for more readable code (see below), the loops don't want to run them.

 

Main FPGA VIMain FPGA VI

 

sub-VIsub-VI

 

Can someone guide me to a solution?

0 Kudos
Message 1 of 6
(1,328 Views)

Hi Eyevolf,

 


@Eyevolf wrote:

But, when I create a subVI for more readable code (see below), the loops don't want to run them.


What exactly means "don't want to run them"?

Is your FPGA VI broken?

Is the subVI set to reentrant? (Should be on default.)

 

Mind to attach your project as ZIP?

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(1,308 Views)

Hello GerdW,

 

No, main FPGA VI isn't broken, and Yes, the subVI is set reentrant (preallocated clone).

 

Main FPGA VI can run, but the loops seems to be freezed (no incrementation of "Numerique" and "Numérique 2" and no data).

 

These VI are in the attached file.

 

Thanks.

0 Kudos
Message 3 of 6
(1,295 Views)

Hi Eyevolf,

 

does it work as expected when you create two copies of that subVI, with each copy accessing those DIO pins directly (without using an IO name constant)?

 

Btw. when dealing with RT/FPGA code it really helps to attach the whole project including the lvproj file!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(1,289 Views)

You are calling your subvi with the Unknown state on the first iteration. Inside your subvi you have a loop that only exits if the state is Decode. I've not looked at all of the code, but the only other state that you can get to is Idle, which also does not exit the loop. Idle then can only go to Idle or Unknown. You have an infinite loop.

0 Kudos
Message 5 of 6
(1,281 Views)

Indeed, a state is missing and the loop runs indefinitely...

 

Thanks !

0 Kudos
Message 6 of 6
(1,222 Views)