LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

passing fpga refnum to multiple while loops

I am developing an application using a queued state machine in a producer consumer architecture. I have one producer and 5 consumers. In one of the consumers I am configuring and launching the FPGA and creating a refnum for use throughout the rest of the application.

 

The refnum is created just fine (as shown in a probe) but for some reason the refnum is not being passed to the other loops as a shared variable. A probe in one of the consumer loops shows it passed but is quickly reset to 0. I'm not resetting anything in the loops just attempting to use the FPGA refnum.

 

Sorry I can't post the vi due to proprietary info. What am I doing wrong here?

 

Thanks for the help.

0 Kudos
Message 1 of 7
(2,739 Views)

Sorry I forgot to mention I am using LV 8.6.1.

 

Also there are no error messages associated with this just not able to use the FPGA reference in my other loops.

 

Thanks again.

0 Kudos
Message 2 of 7
(2,737 Views)

If you are only communicating with the FPGA from one of your loops, just build the FPGA open reference outside of that loop then pass the reference in with  You can create the reference outside of your loops the pass a wire to the loops that need access to the FPGA. Using shared variables can be dangerous since data flow order of execution is not enforced. I can't think of a good reason you would want to use shared variables to send an FPGA reference.

 

-Hunter

0 Kudos
Message 3 of 7
(2,719 Views)

Hueter,

 

Thanks for the info. It definitely appears to have issues. I built my app to open the FPGA reference in one of my states. then I attempt to pass it to the loops using a shared variable. No good.

 

I will do as you suggest and open the FPGA reference outside the loops and then pass it in on a wire.

 

Thanks again.

0 Kudos
Message 4 of 7
(2,716 Views)

Alternatively you can put the FPGA open reference in your first state and pass it to the other states using a shift register. Just be sure that first state execute before the others so you don't get a trash data reference.

0 Kudos
Message 5 of 7
(2,695 Views)

Hueter,

 

Thats what I had done originally, Initialization state opened the FPGA reference. It worked for that loop. Passing the reference to the other 4 loops didn't work for some reason.

 

I'm using your suggestion of opening the FPGA reference prior to doing anything else outside all loops, then pass the reference and it appears to be working this morning.

 

I don't quite understand it but I need to keep moving forward for now.

 

Thanks for your help.

0 Kudos
Message 6 of 7
(2,689 Views)

I always use a FPGA handler with appropriate API VIs to access the reference from multiple VIs in my code. Works fine and by using API VIs for Open/Get/Close you can easily find the "producer and consumer" of the reference in your project.

21009i826DDEF18E92A772

Cheers,

Swen

0 Kudos
Message 7 of 7
(2,658 Views)