LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I hold serial input data until needed?

I am running a while loop which is constantly checking the state of a pump (motor frquency). I am also needing to read from the serial port data coming in from another computer which is being written to a file. Can I hold that data coming in from the other computer until it is needed? We only write to the file every 90 seconds, and if the timing is off, then the data coming in doesn't get written to the file. Is there a way to store data coming in to a buffer, then when it is written to the file clearing the buffer for the next data set? Or just overwrite the last set of data.
0 Kudos
Message 1 of 2
(2,632 Views)
I hope this answer does not over-simplify.

If you do not read data from the serial port, it will just sit there until the buffer over-flows. I believe the buffer is generally about 4096 bytes.

You may be able to get away with just deffering the read operation until you are ready.

Other-wise you will have to implement a buffer of some sort. For this I would suggest using a LV2 global or just a normal gloabal.

I hope this helps,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 2
(2,632 Views)