LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA how to manage events between more than two loops, with one emitter and two or three receivers

Hi. I need to trigger an event from one loop and handle it in two other loops.

 

I firstly used a 1 item target scope FIFO but it seems that it's efficient only from 1 loop to 1 loop.

When several receivers loops, the event is not detected by all of them everytime. few loops sometimes ignore it.

 

I have the feeling this is related to the fact that the moment of the "FIFO write" from the emitter loop triggers outside the "FIFO read" timeout execution from receiver loops.

 

 

 Do you know what I can do? 🙂 thanks in advance

Pierre FCentum TNS, Grenoble
Certified LabVIEW Associated Developer
0 Kudos
Message 1 of 6
(1,421 Views)

It depends almost entirely on the details.

 

Is this a trigger, or more like a status? Is it a one shot, or more like a queue?

 

Sometimes a simple local does the trick. A Boolean can be set in one loop, and read in n loops. An integer can also be nice, one loop can increase it, and the other loops can compare their internal count to the goal.

 

Memory can also work nicely. One loop fills values it at a pointer, the other loops read the value own pointer, up until the latest update. Care should be taken to make the memory large enough so the read can keep up with the writes. 

0 Kudos
Message 2 of 6
(1,405 Views)

I presume you're not using Single-cycle timed loops?

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

wiebe@CARYA  a écrit :

It depends almost entirely on the details.

 

Is this a trigger, or more like a status? Is it a one shot, or more like a queue?

 

Sometimes a simple local does the trick. A Boolean can be set in one loop, and read in n loops. An integer can also be nice, one loop can increase it, and the other loops can compare their internal count to the goal.

 

Memory can also work nicely. One loop fills values it at a pointer, the other loops read the value own pointer, up until the latest update. Care should be taken to make the memory large enough so the read can keep up with the writes. 


-This is a trigger for the detection of an electrical arc during the test. one shot

-the triggering loop is doing the measurements

-the receiver loops are managing the supplies

 

when the measuring loop detects an electrical arc, it passes the event to the receiver loops that put the supplies down depending on the type of arc occured during the event. (this value is passed within the FIFO)

 

all the loops are 100khz (physical limitation due to NI modules)

I tried to pass data with register items, but I faced values losses, since the value stays only during 1 loop

Pierre FCentum TNS, Grenoble
Certified LabVIEW Associated Developer
0 Kudos
Message 4 of 6
(1,382 Views)

@Intaris  a écrit :

I presume you're not using Single-cycle timed loops?


no, only normal loop, with a 100khz rate generated by a "wait ticks" function

Pierre FCentum TNS, Grenoble
Certified LabVIEW Associated Developer
0 Kudos
Message 5 of 6
(1,381 Views)

The 'event' could be an integer value.

 

Conceptually, like this:

Trigger Event.png

 

This is an U64, so you won't run out of values anytime soon.

 

For the value, you have options.

 

A scalar value, read by local. There are risks, the value can be changed before reading, so you can trigger multiple events, and only get to use the last value.

 

You can put the values in a memory block, say 256 values large. Then set the value to the address "integer AND 255". Read the values from the loops counter AND 255.

 

These are just some ideas. All kind of combinations are possible. One FIFO for two readers won't work though.

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