LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to do arbitration in LabVIEW FPGA

Solved!
Go to solution

Hi vicky,

 

how we decide that which one is receiving request first out of five devices.

You read your 6 digital inputs as fast as the FPGA or the module allows, I often also read the full port (group of 8, 16 or 32 bits). Whenever one of those bits is toggled (hint: XOR function!) you know there is a "request" and you can handle this request by setting some other digital outputs…

 

Can we have to use case statements for all this in FPGA VI

Yes, sure.

 

or some other way ??

You can use many other functions and structures in a FPGA VI, even FIFOs (aka queues)…

Best regards,
GerdW


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

yes by using XOR gate we will find there is request but how we determine which request we receive first.

0 Kudos
Message 12 of 21
(2,324 Views)

Hi vicky,

 

by default the FPGA executes loops at 40MHz - or 25ns between iterations. Do you really expect more than one request in this short interval?

 

I assume there will be only one request per 25ns interval so you know which request occured in which iteration of your receiver loop…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 13 of 21
(2,317 Views)

@vicky2889 wrote:

yes by using XOR gate we will find there is request but how we determine which request we receive first.


Set a flag, enqueuer an element, execute a case, output a value, store the timestamp, trigger an SRQ... Thousand ways to do it.

 

Recommending one of them is not easy, as what makes the right choice it's highly circumstantial. E.g. it depends... On an FPGA everything usually needs to fit like a glove. Each choice made needs to fit other parts.

 

I am pretty sure arbitration is not required to solve the problem.

0 Kudos
Message 14 of 21
(2,314 Views)

yes you are right. but then also how we determine which device request we receive first.

 

Can you please give me a small example by taking two or three inputs and then how we determine which one we receive first?

 

 

0 Kudos
Message 15 of 21
(2,311 Views)

Can you please give some example by taking two or three input and then how we determine which one we receive first ? 

like by taking case statement

0 Kudos
Message 16 of 21
(2,315 Views)

Hi vicky,

 

using standard LabVIEW it looks like this:

check.png

In the FPGA you may do the ArraySearch "manually" using your own routine…

 

how we determine which device request we receive first.

That "first" request is the one, where the boolean value changed in an earlier iteration then the "second" one…

You need to take into account the loop iterations between the comparison of your digital inputs!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 17 of 21
(2,311 Views)

Or detect going up:

change detect.png

0 Kudos
Message 18 of 21
(2,306 Views)

can you please tell where i can find the highlighted part in the picture attached

 

 

0 Kudos
Message 19 of 21
(2,297 Views)

Hi vicky,

 

both our suggestions are actually snippets! You can download those images and drag&drop them into the block diagram of a VI to get their contents…

 

You are looking for a feedback node. You really should take the beginner courses!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 20 of 21
(2,281 Views)