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.
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.
05-29-2017 12:32 PM
Hey Everyone,
I haven't dealt with parallel processing in labview, so hopefully someone can help me out. Here is the what I am working on:
I need to read data from TCP Read and write that data into text file. As the data reading is continuous, I was thinking about doing it in parallel processes. Each data packet will be 20kB.
Here is what I was thinking to do:
So the first process will read the data from TCP Read and write to buffer 1. It will write the complete 20kB of data and send a signal to second process to get the data from buffer 1. Second process will then take the data from buffer 1 and write to text file. In the meantime, the first process can write the data to buffer 2 while process 2 is still using the buffer one.
I will appreciate any help implementing this or any documents I can refer to get started.
Thanks
05-29-2017 12:52 PM
05-29-2017 04:43 PM
Why don't you just read 20kB packets from the TCP Read and write them to a file? The TCP Read already has a parallel process working behind the scenes to fill the buffer from which you read, so further "parallel processing" seems redundant.
06-02-2017 11:32 AM
Thanks for the suggestion. I will give it a shot.
06-02-2017 11:34 AM
I end up loosing some data after few frames. Thats why i thought maybe parallel processing would be better
06-05-2017 03:44 PM
@manny09 wrote:
I end up loosing some data after few frames. Thats why i thought maybe parallel processing would be better
Better to diagnose your problem then guess. Figure out why your losing data.
06-05-2017 06:43 PM
Thanks for the reply everyone. I dont loose data after I included delay in receiving each frame. But there is a different problem now. I end up getting more data as somehow the data from some samples add addition bytes of carriage return and linefeed which I don't want to read. I am suspecting it has something to do with TCP Read subVI.
Here is the complete story:
I have CAN-Ethernet Gateway that sends the data to TCP. Each data sample is 8 bytes, but the gateway adds another 26 bytes of headers to it. When I read using TCP Read, it reads all 34 bytes most of the time (which is correct) but sometimes it also adds 2 bytes of carriage return and linefeed (I dont want to record that). I am not sure why I read those 2 extra bytes with some samples.
Please let me know if it doesnt make sense.
Thanks
06-07-2017 04:02 PM
You should post some code if you want to get better help in debugging your issues. I would guess from your mention of a "delay" that you are just grabbing whatever has arrived at a particular time, rather than using a method of waiting for the whole message. No TCP code should ever require a delay.