LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delay in USB Camera feed connected to Crio

Solved!
Go to solution

I have connected a USB 2.0 camera to Crio. When i connect the crio to my pc via type-C cable, the camera feed on labview is without any perceptible delay. 

 

However, when i connect the crio to pc via a 50m long ethernet cable, the camera feed is lagging A LOT. The delay is around 3-4 seconds, and the video is not even continuous, it seems as if only frames are being displayed with intervals of 3-4 seconds in between.

 

I know that the range of USB2.0 camera is around 5m, but the usb camera to crio connection cable is not even 1m long. 

 

Is it because the camera data is being sent from Crio to pc via 50m long ethernet cable? If yes, isn't the 5m length limit only for the direct connection between camera and the computer that it's connected to? (crio in this case)

 

Please help! 

0 Kudos
Message 1 of 5
(1,112 Views)

It might help to post some code.

 

If you for instance do a snap instead of a grab that could make a difference.

 

Have you tried a shorter distance? Just to make sure it is actually the distance that is the problem.

0 Kudos
Message 2 of 5
(1,106 Views)

The length of the Ethernet cable (as long as you have no hubs, switches or routers in between) makes virtually no difference at all here. What does make a difference is of course that in the USB-C case you are connecting your cRIO to the PC over a virtual network adapter that has different characteristics than the real network adapters in the cRIO and PC when you connect over a RJ-45 cable. The first is a fairly new standard which translates the network packages in the virtual adapter to USB packages and on the other side unpacks them and injects them into the network socket library. It is USB-C and USB-C also supports special transfer modes such as high speed isochronous, which such a virtual adapter almost certainly would use. Compare that to the traditional RJ-45 where you have a whole slew of drivers stacking on each other, some of them having very old legacy leftovers in them that may have been a perfect choice on a Pentium 300 MHz system with an old NE1000 or NE2000 network controller card, but are less than optimal nowadays.

 

Also depending on the cRIO model its network interface controller may be only a 10/100 Mbs connection (not very likely though as the controllers having a USB-C interface all also have an 1Gbs capable Ethernet port). Compare that to the theoretical maximum speed over USB-C of 10 (or maybe 5) Gbs

 

I can assure you that using a network cable of 2 m should not make any difference in speed in this scenario, using a different PC however MAY make a considerable difference, both in potentially slowing down the USB-C speed and improving the network speed (unless of course the cRIO network interface is a 10/100Mbs interface only). Basically the cable length itself should make no real difference as long as you stay under the maximum of 100m according to the spec. A bad network cable however could make a huge difference. Maybe you should try some network throughput metering just to make sure that your network connection is actually working according to its specification speed. Bad cables are more common than most people would like to believe.

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 5
(1,046 Views)

The Crio model is 9042, and the ethernet port speed for it is 10/100/1000 Mbs.

 

Alright, now I understand. 

 

But while connecting my pc to crio through the same ethernet port, I'm controlling a whole ROV, which has thrusters, electronic system of sensors etc. There's no delay in these systems. For example, when i press the button on labview for the underwater light, it turns on immediately without any delay. The IMU and depth sensors are also giving values without any delay.  

 

 

 

 

0 Kudos
Message 4 of 5
(1,033 Views)
Solution
Accepted by topic author sarwatsarfaraz

Well the data packet to send to the cRIO to inform it that you pressed a button is typically a few bytes. The USB camera has likely 20 to 50 images per second of 1920 * 1080 pixels with at least 3 bytes for the RGB data but possible sent as 32 bits per pixel. Do the math!

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 5
(1,026 Views)