LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read from measurement file and send data via tcp

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

0 Kudos
Message 1 of 8
(2,897 Views)

Modify data server.vi example that ships with labview. Reading a file should be fairly straightforward.


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 2 of 8
(2,894 Views)

In this case I'm not the server but the client, because a java program wait for my connection.

0 Kudos
Message 3 of 8
(2,891 Views)

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.

 

 



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 8
(2,890 Views)

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.

0 Kudos
Message 5 of 8
(2,884 Views)

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 8
(2,876 Views)

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).

0 Kudos
Message 7 of 8
(2,868 Views)

@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.

 

 

 



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 8 of 8
(2,857 Views)