11-28-2012 08:56 AM
Hi,
is possible to read data from measurement file and send it via tcp?
I alwais have a loop or an error... Is there a guide or a tutorial? I didn't find it.
Thanks,
Veronica
11-28-2012 09:00 AM
Modify data server.vi example that ships with labview. Reading a file should be fairly straightforward.
11-28-2012 09:05 AM
In this case I'm not the server but the client, because a java program wait for my connection.
11-28-2012 09:08 AM - edited 11-28-2012 09:08 AM
The answer is yes. However to give you any more detail it would be helpful to see what you have currently done. It would also help to know exactly what you are trying to do as well. Are you doing this to simply copy the file to another computer on the network? Is the other side going to process the data or do something with it? Also, you will need to know what the other end of the connection expects in terms of the data and protocol.
11-28-2012 09:18 AM
I attach a sketch of my program.
On the other side I have a java program, that wait for the connection, accept the connection and then only read data to write it on a local txt file.
I use the "flatted to string" block because allow me to write correctly double values.
11-28-2012 09:40 AM
You have a classic race condition. Your express VI reading the data outside of the loop and using it's output (EOF?) to determine when the loop should stop. However as written you will not execute the loop until after the read has occurred. It can't run since the loop is dependent on the data output of the express VI. You will read data and send a single element and then that single data element. If you are not at the end of the file, which most times you will not be you will not exit the loop since EOF? will be false and the only way to change the value is not running. You should read the data inside the loop.
11-28-2012 10:24 AM
I built a loop as you suggest but I had this error.
ERROR - 2525
LabVIEW: TDMS file data could not be converted into the specified data type.
I don't understand, because in past I used the reader correctly (without sending data via tcp).
11-28-2012 04:17 PM
@Skeggy88 wrote:
I built a loop as you suggest but I had this error.
ERROR - 2525
LabVIEW: TDMS file data could not be converted into the specified data type.
I don't understand, because in past I used the reader correctly (without sending data via tcp).
Are you trying to read the same file? Also, you will still have you race condition since you are using a property node to control stopping the loop. You should wire the output of the express VI directly to the conditional terminal of the loop.
Also, it would be much better if you posted your actual code and not just a picture of it. Could you also post the file you are trying to read as well.