07-18-2014 03:04 AM
Hello everybody,
my code inside the sctl aquires a digital sensor signal and also the current position.
The time between falling edges is measured and written into the fifo.
If the code recognize a trigger sequenze from the digital sensor signal,I write the current position,Voltage and also current into the fifo.
I read the FIFO elements on a RT system, most of the time the read date is perfect.
But sometimes there are a lot of zeros elements and i dont know where are the zeros come from.
I never write the value zero.
So does anybody have an idea where the zeros come from and why?
Normal
6701 |
2393 |
100000000 |
5000 |
24 |
1556 |
2512 |
2512 |
2153 |
1675 |
3111 |
2273 |
10289 |
With the zeros:
6702 |
2872 |
100000000 |
5000 |
24 |
1556 |
2512 |
2512 |
2632 |
1674 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
3111 |
1795 |
9332 |
07-18-2014 09:09 AM
I can't see your entire application, but my first suspicion is your host code reading from the FIFO on RT. Do you have a timeout wired into the FIFO Read function? Is it possible that the host side read is emptying the FIFO buffer and returning zeros on the iterations when the FIFO Read times out?
To filter these types of zeroes, you should check for warnings and errors coming out of the FIFO Read and discard bad values.
-spex
07-18-2014 09:22 AM
Hello,
there are no errors or timeout. Because if i delete the "synchronisation part" and just write the signal into the fifo.
I never get that problems with the zeros. Even if the System runs a whole day.
So thats why i guess there is something wrong with the fpga code.
Maybe there is another methode or idea to synchronize the position with the trigger sequenze of the digital signal.
Thanks in forward 🙂
07-22-2014 09:47 AM
Hey B.Buerkert,
have you already used the NI Example finder to find usefull code to implement in your application? I would try to use the examples for orientation. Good examples for your application would be the "Hardware Trigger Detection.lvlproj" and the "Streaming Data (DMA).lvlproj". Theses examples will show you the proper synthax you should use to realize your plan.
Best Regards.
Daniel