07-30-2021 08:47 AM
Last image was right after restart of MyRio and I deleted deployed RTstartup from the unit and it freed up the memory to around 130 MB.
I am not sure that if it's the right way to free up memory.
I found this these informative threads see if you can implement any of it in your case.
https://forums.ni.com/t5/LabVIEW/IMAQ-image-network-stream/td-p/3157000
https://forums.ni.com/t5/LabVIEW/Transfer-Image-Array-from-RT-to-Host-PC/td-p/992239
07-30-2021 01:42 PM
I can't promise, but if I can, I'll try to Network-Stream some images from myRIO to my PC over the weekend (I'm pretty committed to a "work" project thatm, fortunately, has nothing to do with LabVIEW Vision). My suspicion is that "it's all in the buffering" (you've got to get all those Pixels down the TCP/IP "pipe" from the Camera through the myRIO to the Host).
Bob Schor
07-31-2021 06:52 AM - edited 07-31-2021 07:29 AM
Hi,
In my last post I forgot to mention that deleted rtstartup was from a different RT application.
I added a property node with video mode that sets resolution and image type (JPEG, YUY2) of the image before writer loop starts. Memory is building up the same but at different rates. So for example image with resolution 640x480 YUY2 with writer wait time set to 100ms fills up the memory from 130MB to around 210 MB in 2 minutes and then rio disconnects. Memory is building up at steady rate as seen in my previous image. CPU load hovers around 50%.
EDIT: Also I was trying a different camera that uses USB 2.0 that has max resolution at 480p 30 fps. Results are the same but what bugs me is that maybe my camera is set wrong. I changed only resolution and image type to RGB U32. And probably that i should remove taken picture after it is sent so it´s not using memory in the unit? For some reason theres 1s delay when image changes to another one in indicator even when wait is set to 100ms.
07-31-2021 08:45 AM
gif of what it looks like: https://media.giphy.com/media/pZW7gwCvgWC9qoq3u7/giphy.gif
07-31-2021 08:47 AM
Hmm. Your mention in the last post of using a different USB camera made the little bell in my head "go off".
Why are you acquiring images with the myRIO? Why not acquire them directly with the Host PC? That is very easily accomplished, and avoids trying to send images over Network Streams (which might be a challenge). I don't recall you sharing much of your code with us, so there might be a "synchronization" step that I have overlooked, but I would think that could be more easily handled, for example, by having the myRIO send a Message to the Host to say "Start the Camera!". Now, you might argue that there is a delay before the Message reaches the Host and the Camera starts recording, but you can measure this delay, and once you know it, you can have the myRIO send the "Start" message and then "delay" starting the Event that the Camera is recording.
Bob Schor
07-31-2021 09:04 AM
Hi,
Im working on a project that is using myrio. In the project i want to have some data about myrio. So I need to connect camera to Myrio and send trough stream to HOST PC. While sending I´m looking at distributed system manager and network usage on PC. So goal of this task is what MyRio can handle while streaming image with network streams. Output shoud have some data about what resolution is taken, network utilization, cpu and memory utilization of Myrio. Then I´ll compare those or that was the plan.
While I´m at it I´ll be doing something simmilar with RT and FPGA using DMA FIFO. What could work well If I´m not bothering you guys too much. I´m sorry about that If I am. But It keeps bugging me that I can´t figure this out on my own.
07-31-2021 09:28 AM
Hello, Jenda.
I see you've been a member of the Forums for a few months, so I'm guessing (and apologize if I'm very wrong) that you are a relatively new (< 1 year) user of LabVIEW.
Your curiosity about the details of LabVIEW Real-Time and communication with a myRIO, the intricacies of LabVIEW Vision, and the combination of the two (Vision in a LabVIEW-RT environment) is admirable. However, you have picked two "relatively advanced" aspects of LabVIEW to tackle simultaneously.
I recommend that you start by learning LabVIEW RT without LabVIEW Vision (i.e. get Network Streams mastered), and in a completely separate project, learn LabVIEW Vision (i.e. with a WebCam attached to your PC). I was already fairly proficient in LabVIEW when a colleague asked for my help with a LabVIEW Vision project of his -- boy, what a different way of thinking about data acquisition and processing! Here's a hint (and a surprising lesson that I learned) -- think of "buffers" (where Images are stored) as being located in the PC, rather than in the Camera.
Bob Schor
07-31-2021 11:01 AM
Yes its as you said. I´m relatively new to RT and I thought that after doing RT and FPGA courses I knew enough to do this. But boy am I wrong. I like Labview and its relatively different application making from other ones. Sad part is that I´m expected to show some results on monday so I´m pretty much lost on what to do next.
07-31-2021 11:12 AM
HI Jenda,
Did you try using Image to array function as was mentioned in one of those links? Eventually changing the data type for NS Stream to (Maybe 2D DBL, or of the data type of converted array).
Link talked about outputs from IMAQ VI is actually a reference to the image captured. Which can be converted on RT into an array and on PC side, convert that array back to image.
07-31-2021 12:55 PM
Yes I tried it. It works in a simmiliar way as before. Runs and sends around 1 frame per second and is filling up the memory.
After memory fills up it instead of crashing displays error -1074360320
Im sending it with ColorImageToArray and on host receiving it with other end. Type is 2D array of U32.