07-09-2022 01:16 PM
Wire the "Error out" of the "TCP C lose Connection" to a Clear Error. This should be done both in the "Wait For Connection" and "Stop" states.
07-09-2022 01:25 PM - edited 07-09-2022 01:27 PM
I created it as you said, this error occurs on both sides.this error usually occurs when data is not transmitted correctly.
07-09-2022 01:46 PM
What are the size of your images. This looks like one side of the receive is not receiving/processing the data quickly enough. To start, try increasing the delay in your client. You had it at 5 ms which I believe is way t o fast. I changed that to 50. Try something very slow like 1000 and see if that improves things. If you have large images as rolfk stated, you probably need some type of compression. TCP also includes a fair amount of overhead. Most video streaming is done using UDP which has much less overhead however it is not guaranteed delivery. Packets can get dropped and then you need some higher level protocol that can handled missing or out of order data packets.
07-09-2022 02:19 PM - edited 07-09-2022 02:56 PM
I don't think the problem is related to latency.
The problem is in the way of sending the video here.
Pictures are 640x480 resolution
I think there is a problem when converting the video to string and sending the byte length.
07-09-2022 04:44 PM
For what it is worth, you never created the Network Stream Writer (you never run the "Connect" state).
Bob Schor
P.S. -- I've not actually tried sending Frames by Network Streams. I'm reasonably sure this can be done, as IMAQdx is available in LabVIEW RT on cRIOs, and I assume the RIO gets the Image from the Camera and sends it via Network Streams to the Host (but, as I just said, I've not tried it, myself).
07-09-2022 06:39 PM
No, there is no problem doing that. The Flatten to String takes the input and converts it to a string and since it has knowledge of the structure of the input, it correctly includes meta data such as the length or strings and arrays in the data stream. As long as you use Unflatten from String with the correct type input the string will be correctly decoded. I don't have your setup so obviously I can't test it. I am confident in the data stream given that this is something I do all of the time.
07-10-2022 04:41 AM
@Bob_Schor wrote:
For what it is worth, you never created the Network Stream Writer (you never run the "Connect" state).
There is no problem on the same computer, but communication cannot be established on two different computers.
@Bob_Schor wrote:P.S. -- I've not actually tried sending Frames by Network Streams. I'm reasonably sure this can be done, as IMAQdx is available in LabVIEW RT on cRIOs, and I assume the RIO gets the Image from the Camera and sends it via Network Streams to the Host (but, as I just said, I've not tried it, myself).
I think the main problem is not whether the video can be transferred or not, because when trying to send normal data, a connection cannot be established between the two computers.
I'm running a different TCI/IP instance and connecting fine.
I don't know where the problem originates.
07-10-2022 07:23 AM
Arguing over two different methods seems to lead to confusion.
-First of all, can you tell me where is the problem in the method I published here and here?
Note: It is the fastest method I have tried so far and at least I can transmit the video.
- Since Network Stream is already on the basis of TCP/IP, I think it would be better if we could continue over TCP/IP example, because there will be no result that affects the video transmission speed.
Network stream, I think, creates a problem in data transfer with an ethernet cable between two computers.
07-10-2022 12:48 PM
@Mark_Yedinak wrote:
No, there is no problem doing that. The Flatten to String takes the input and converts it to a string and since it has knowledge of the structure of the input, it correctly includes meta data such as the length or strings and arrays in the data stream. As long as you use Unflatten from String with the correct type input the string will be correctly decoded. I don't have your setup so obviously I can't test it. I am confident in the data stream given that this is something I do all of the time.
After making changes to the example you created, the connection is now established, but it gives an error as follows.
Problem occurs in unflatten from string.
07-10-2022 03:53 PM
@constructionworker wrote:
@Mark_Yedinak wrote:
No, there is no problem doing that. The Flatten to String takes the input and converts it to a string and since it has knowledge of the structure of the input, it correctly includes meta data such as the length or strings and arrays in the data stream. As long as you use Unflatten from String with the correct type input the string will be correctly decoded. I don't have your setup so obviously I can't test it. I am confident in the data stream given that this is something I do all of the time.
After making changes to the example you created, the connection is now established, but it gives an error as follows.
Problem occurs in unflatten from string.
I'm pretty sure that means that the datatype you chose for unflattening isn't the same as the one that was flattened.If this is a complicated data structure, you should typdef it so there is no chance if this happening. Or, it might be because you told it to include size data in one but not the other.