LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Communication Protocol between PC and FPGA

Solved!
Go to solution

Hi dear Expert,

 

I want to synchronise communication between a Vi on my PC and a VI located in the FPGA of myRio 1900. In fact I want to read data from a file on the PC, write the data from the file to  DMA FIFO 1. On the FPGA, I want to read the DMA FIFO 1 and save the data in Memory. This is required because the processing algorythm need all the data. After saving the all the data to memory, I want to Read them back, process them and write them back to the memory. Once the processing is done, I want to read the processed data from the memory and write them to DMA FIFO 2. At the end of last operation on the FPGA, I want to inform the VI on the PC so that it can start reading the processed data and storing them and the cycle re-begins.

 

I have illustrated it as follow

 

FabFet_0-1638196648681.png

 

I am a new programmer and I would be glad to take advice about how to design a better communication protocol and if my design is acceptable, what will be the best way to implement it. Thank you in advance

0 Kudos
Message 1 of 7
(2,421 Views)
Solution
Accepted by topic author FabFet

Hi FabFet,

 


@FabFet wrote:

I am a new programmer and I would be glad to take advice about how to design a better communication protocol and if my design is acceptable, what will be the best way to implement it.


LabVIEW RT+FPGA comes with lots of example VIs and example projects. In those example projects it is explained how to transfer data between host computer, RT target and FPGA inside RT target.

 

Have you studied those examples?

Which problems do you encounter?

Where are you stuck?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 7
(2,382 Views)
Solution
Accepted by topic author FabFet

Do you understand what a FIFO is? Based on the information in this post and your other post that you're trying to solve a problem that doesn't exist. There will only be data on the FIFO when you put it there. When you take the data off of the FIFO and then loop back you will get the next data point when it becomes available. As GerdW said you should check out the examples and then come back here with specific questions that you might have.

Message 3 of 7
(2,368 Views)
Solution
Accepted by topic author FabFet

It sounds like you do not understand that there are three processors involved in transferring data from FPGA to a PC.  One processor is in the PC.  The second processor is a "Real-Time Target", a stand-alone "computer" running a Real-Time Operating System (usually NI Real-Time Linux), and an FPGA Chip that is part of the Real-Time Target.  The PC typically communicates with the RT Target using TCP/IP (though LabVIEW can make this almost "invisible", particularly during Software Development).  The RT Target and its embedded FPGA Chip have protocols for sending Data back and forth between them, including a FIFO mechanism for moving large quantities between Target memory and the (relatively-limited) FPGA "memory".

 

Bob Schor

Message 4 of 7
(2,358 Views)

Hi GerdW,

 

Thank you a lot for your reply. In the past few days I looked at some NI examples and watched some YouTube videos. After that I was able to implement communication between a VI on the PC and a VI on the FPGA of NI myRio 1900 using FIFO DMA.

 

Note: the FPGA Target is in "simulation" mode and I will later move the VI from the PC to the Realtime Target when I run the FPGA in "normal" mode

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

Hi John,

 

Thank you for the clarification. It took me some time to understand the way a FIFO works. Now that I have tested data transfer between PC and FPGA (Simulation Mode), I have noticed I do not really any synchronization mechanism to make it work. 

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

Hi Bob,

 

Thank a lot for your more than detailed response. That really completes my knowledge and clears the doubts I had.

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