05-26-2025 10:43 PM
Hello LabVIEW community,
I am wondering if anyone has any tips on data acquisition using USB C SPI from an FPGA. The FPGA that I am using is a DE 10 Lite.
- The data transfer rate is 5 kHz
- Data format - 160 bit Hexadecimal
More info on interface:
I am using this data for a phasor measurement unit interface. This interface converts the data from hexadecimal to decimal to display on the charts. The interface must take the data into a 5 second buffer in order to write the data to a file in the event of a fault. In the event of the fault the buffer will be triggered to write 5 seconds of data before the event and 5 seconds after the event. I have completed the programming to convert the data into a usable format however I am now at the stage of building the data acquisition section of the interface. Any advice on building the FPGA data acquisition module and building thr buffering system would be greatly appreciated. I have attached a table for the data format and a copy of my code. Let me know if you need more information.
PMU values |
Data type |
Alarm |
Time (MDH) |
Time |
Time (20 usec / count) |
V |
f (°) |
F (Hz) |
RoCoF (Hz/s) |
CS |
|||||
bits |
4 |
6 |
14 |
12 |
16 |
24 |
24 |
24 |
24 |
12 |
|||||
Data type |
us |
us |
us |
us |
us |
us |
s |
us |
us |
|
|||||
Comment |
2 or 3 toggles |
|
Mth(4)Day (5) Hr 5 |
2x6bit |
|
|
|
top 5 bits Hz |
|
|
|||||
Max Value |
|
|
12 (M), 31 (D),24(H) |
60, 60 = 1Hr |
50000 = 1sec |
287.5V |
360 |
64 Hz |
128 |
|
|||||
Max PU |
|
|
|
|
|
1.25 = X"FFFFFF" |
|
1.28 |
|
|
|||||
Min Value |
|
|
|
|
|
0 |
0 |
0 |
-128 |
|
|||||
Type Value |
1 |
|
|
15 30 |
|
1pu = 230V |
90 deg |
50 Hz |
0 Hz/s |
|
|||||
Type Data (hex) |
1 |
|
|
0F1E |
|
CC CCCD |
40 0000 |
C80000 |
0 0000 |
|
|||||
Res |
|
|
|
1 sec |
20 us |
17uV |
21 udeg |
3.8 uHz |
244 uHz/s |
|
|||||
GPS data |
Data Type |
Alarms (spare) |
Date |
Time |
Latitude |
Longitude |
CS |
||||||||
bits |
4 |
4 |
24 |
32 |
40 |
44 |
12 |
||||||||
Typ Value |
4 or 5, toggles |
|
19-Oct-22 |
2:14pm 10.45 sec |
Location Adelaide |
|
|
||||||||
Hex value |
|
|
191022 |
14141045 |
34.92850 (S) |
138.6007 (E) |
|
Regards
05-26-2025 11:23 PM
Are you looking for general advice on the topic, or is this in any way related to LabVIEW or NI?
05-26-2025 11:44 PM
Hi Santhosh,
Thanks for your reply. I am looking for advice on what blocks to implement into my labVIEW code in order for me to be able receive the transmitted data from the FPGA. I am wondering if anyone has had a similar experience in interfacing this FPGA with labVIEW.
https://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=234&No=1021
Thanks
05-27-2025 12:01 AM
You can communicate with FPGA or MCU dev boards over USB-SERIAL converters, which typically come with the dev board. As an embedded developer, you must formulate a simple, efficient data format that allows LabVIEW and the firmware to handshake and exchange data.
Depending on the level of flexibility/configurability, your implementation of LabVIEW (using VISA) and firmware would vastly vary.
This is great for getting started if you're new to Serial communication.
https://labviewwiki.org/wiki/VIWeek_2020/Proper_way_to_communicate_over_serial
05-27-2025 07:39 AM
This is less of an FPGA question and more of an instrument driver question.
See also https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x3XpCAI&l=en-US