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: 

IMAQ image network stream

I would like to stream IMAQ images through network streams to a host PC (From a RT target).  This seems easy but I have a question.

 

I directly connect my IMAQ image reference to the network stream writer on my RT controller.  Images appear to transfer without issue to the reader on my host PC.  According to all of the examples I could find, I should be converting the image to a byte array or some other non-reference type before connecting it to the stream writer.

 

Why does the writer work then?  I'm using LV2014 so is this a recent capability?

 

Thanks,

 

XL600

0 Kudos
Message 1 of 7
(3,845 Views)

@xl600 wrote:

I would like to stream IMAQ images through network streams to a host PC (From a RT target).  This seems easy but I have a question.

 

I directly connect my IMAQ image reference to the network stream writer on my RT controller.  Images appear to transfer without issue to the reader on my host PC.  According to all of the examples I could find, I should be converting the image to a byte array or some other non-reference type before connecting it to the stream writer.

 

Why does the writer work then?  I'm using LV2014 so is this a recent capability?

 

Thanks,

 

XL600


I'm astounded, but may I missed something.  What I think you said is you sent the IMAQ Image (which is a reference) via Network Streams to a Host.  That's certainly "legal", but if you now try to "view" those images on the Host, do you see a picture?  [A "Yes" answer is what would astound me.]

 

As I understand it, an IMAQ Image is something like a pointer into the IMAQ Driver living on the Remote Target.  I've successfully passed Images within a Host system via a Queue, and could use those "Images" to view something, but that was (I thought) because it went back to the Driver to get the actual image itself.

 

Can you tell anything about the size of the packets that are coming across?  Are they "large" (as though they represented the pixels of the image) or small (as though they were a reference)?

 

Bob Schor

0 Kudos
Message 2 of 7
(3,814 Views)

It's true that the IMAQ image datatype is a reference to the image buffer, but my guess is that the Network Streams API is smart enough to recognize this and implicitly dereference the buffer inside the writer.  I haven't tried it, but shared variables probably do the same thing.  This makes sense, since there's no good reason to send just a reference across the network to a reader that doesn't have access to the referenced data.

0 Kudos
Message 3 of 7
(3,809 Views)

The IMAQ images are 4MB each and yes, I am seeing images appear on the host.  Hence my confusion since it's not mentioned that the network stream writer is smart enough to dereference and the reader smart enough to create a local reference.  I'm hoping they are that smart so that I don't have to create extra copies of images just to put into the stream functions (Which probably create their own send buffer).

0 Kudos
Message 4 of 7
(3,805 Views)

BTW: As for packet size, sending 4MB U8 monochome images at 10Hz consumes about 380Mbps.  There's no way that's just the reference data.

0 Kudos
Message 5 of 7
(3,799 Views)

Good to know!  I wonder where the Image Cache is located ...

 

Bob Schor

0 Kudos
Message 6 of 7
(3,760 Views)

Here's the example I was working on.... The graph shows the host PC's 1Gbps network while the VI shown below is running on my RT chassis.  The frames are received as long as the IMAQ data types match exactly (Hence the connection of the output of IMAQ array to image directly to the type input of the create network stream vi).  What's going on under the covers to make this work, I can't really say...

 

IMAQ_Direct_Image_Network_Stream_Example1.png

0 Kudos
Message 7 of 7
(3,716 Views)