From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
02-08-2018 04:49 AM
I'm actually working on Image processing and things.
I have written a labVIEW code that pass image from LabVIEW to Python via TCP/IP socket communication, but the time overhead is very high for a big files.
So,I searched through the NI forums and found Memory Mapped Files are the best way to do Inter Process Communication(IPC) from here : https://forums.ni.com/t5/Developer-Center-Resources/Inter-Application-Communication/ta-p/3523015 .
and I also found a LV code for Memory Mapped File here: https://forums.ni.com/t5/LabVIEW/memory-mapped-file-access-problem/m-p/1213533 . But,it's not working. Create new Memory Mapped File always returns NULL. I also attached the code below
Any help?.
Thanks in advance.
Solved! Go to Solution.
02-08-2018 05:56 PM
The example works on my computer. However this library is specifically only 32 bit programmed and would require some work to make it work in 64 bit LabVIEW.
As to TCP/IP being slow when communicating through localhost, I'm not sure you will see huge improvements through memory mapping. Because when operating between localhost endpoints the Winsock library actually uses internally memory mapping too. But of course it needs to do some synchronizing between the two sides so that the read side doesn't try to read while the write side is updating the memory.
And you will have to do something like that too somehow. So while memory mapping may seem like the golden egg for fast sharing of contents between processes, some of the performance will be eaten away by the necessary synchronization through mutexes or similar in order to guarantee consistent memory states on both sides.
02-09-2018 02:54 AM - edited 02-09-2018 02:54 AM
This is my 64 bit safe version of the above library. I chose to implement the thing a little differently with VIs wrapping the individual Call Library Nodes properly.
It is not really what I would call a production ripe implementations with things like the handles and the mapped pointers all being simple 64 bit integers. While they can be connected to each other, doing so will surely result in VERY BAD THINGS happening. So tread lightly when using this version, wear your safety belts and safety googles and think carefully before you hit the run button with any program you used these functions in.
The proper way to implement this would be as LabVIEW classes, wrapping the memory map handle and the actual memory pointer into individual classes, so they CAN"T be wired together accidentally.
09-01-2020 03:40 AM
I Want to do the labview and unity software communication through map files. I used WIN Memory Map.llb. This is working fine for the 1D array of Unsigned 8 bit integer. But i want to use the 3 different data types in the same project. So in WIN MMAP,lvlib write, i tried to change the data type.It is showing an error.
Could you please help for the same?