LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA (Instrument Control, Data acquisition)

Hello,

 

I'm working on a project where I need to read data from an STM32 (Nucleo-h743zi2 board) using LabVIEW's VISA through USB OTG_FS, configured as a Virtual Comport (VCP). The STM32 is sending data at a high speed of 2MBps to the VCP. However, I'm experiencing data loss in LabVIEW. I'm uncertain about the maximum speed at which I can configure LabVIEW's VISA for reliable data reception. Please suggest any good way to extract data using VISA for my application without data loss. 

 

Thank you for your assistance.

0 Kudos
Message 1 of 4
(699 Views)

With this data rate, you are definitely going to need to use a Producer/Consumer setup.  One loop should be dedicated to reading from the port and use a queue to send the data to another loop for processing.

 

Could you give more details on the messaging protocol the STM32 is using?  There might be something we can use there to help the process.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 4
(658 Views)

On top of what Crossrulz said about using a Producer/Consumer architecture.

 

Most serial communication issues can be solved by watching this video: VIWeek 2020/Proper way to communicate over serial

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 4
(626 Views)

2 MBit should be fine as long as your physical hardware supports it. VCP devices don't really have a "baud rate" since there isn't ever actually data transmitted via the UART protocol. (USB to Serial devices do have that, but not all VCP's are USB to Serial devices).

 

I use actual 1 MBit USB to serial devices all the time and it's not an issue. You'll just need to properly architect your system, and do things like make sure your buffers are big enough (VISA Configure Buffer) and that you open the com port once before you use it, then do all your reading, then close it once at the end.

 

And definitely watch the linked video, it's critical to getting high speed serial right.

0 Kudos
Message 4 of 4
(621 Views)