From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to use shared memory on linux RT host directly

Solved!
Go to solution

I have a labview application that uses FPGA to read analog signals on all six input channels of a sbRIO-9607 board. The FPGA program passes the data through a DMA FIFO to a host program which calls a custom C function through a shared .so library. I am currently using the C function to write the data to CSV files and store them on an external hard disk drive. I need to replace this with a shared memory mechanism so that I can write the data (preferably in CSV files) to some location on the main memory from where another custom C program running on the Linux RT can fetch it. I read about tmpfs storage and hence tried to write directly to /dev/shm. But this caused the RT target to be disconnected from my host computer and stopped the program almost as soon as it started. I could not find any reliable instructions online for setting up a shared memory location on the Linux RT which would work for my case. Any inputs on how to approach this would be much appreciated.

0 Kudos
Message 1 of 6
(2,468 Views)
Solution
Accepted by topic author anandsa

I know one of our systems engineers did something like this for DCAF. I think the repo below was the underlying library he created for the LabVIEW to C communication. There looks to be an example program so hopefully that helps.

 

https://github.com/NISystemsEngineering/LinuxRT-IPC

Matt J | National Instruments | CLA
0 Kudos
Message 2 of 6
(2,441 Views)

Thank you for the reply. This looks pretty close to what I'm trying to do. But I'm having some trouble with a subVI. Labview reports 'Get Errno Value for Calling Thread.vi' as missing. I was not able to locate this as a Labview add-on either. Do you have any idea what might be wrong here?

0 Kudos
Message 3 of 6
(2,434 Views)

Did you install all of the VI packages from the release?

 

https://github.com/NISystemsEngineering/LinuxRT-IPC/releases

 

I would guess this VI is in the linux rt errno package but if it's not let me know and I can ask the person who was primarily working on this.

Matt J | National Instruments | CLA
0 Kudos
Message 4 of 6
(2,426 Views)

I had not done this before. It seems to work now. Thanks a lot.

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

Hey anandsa,

 

Matt let me know that you were running into some issues with the Linux RT IPC library. I'm the original dev for that library, so if you have any issues then feel free to let us know using the Issues tab on the library's Github page (https://github.com/NISystemsEngineering/LinuxRT-IPC/issues). If you add an issue there, we'll get notified.

 

I also want to add that this library is also published on the Tools Network, which means you can actually download it (and its dependencies) directly via VI Package Manager. No need to manually install from the repo's releases tab.

 

Untitled.png

Ryan P.
CLA
0 Kudos
Message 6 of 6
(2,385 Views)