Showing results for 
Search instead for 
Did you mean: 

Save each iteration of data using VISA read to file

Go to solution



I am using a simple labview vi to read data from an Arduino, which is attached to a couple of sensors. The VISA read is correct, and I'm happy with that, but I now want to be able to save each serial reading over each while loop iteration. Each attempt I've made to do this has resulted in only one iteration being saved. Either it is overridden each time, or it only appears to save the last iteration before I hit the stop button.


I've attached my vi as it currently is, which saves the last iteration. If I remove the property node entirely it saves every iteration but it causes an override. Any help would be appreciated.



0 Kudos
Message 1 of 3
Accepted by topic author CJT1993

Do not use the Read VISA To File.  It is made for a single write.  Instead, treat the file like the VISA session: open/create/replace the file before the loop, close the file after the loop, and write as much as you want inside of the loop.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 3

Hi, thanks a lot for the reply. I've tried to implement your suggestion. I added the changes you suggested, but now I don't seem to read anything, or save anything. So I tried to copy your block diagram completely, and I can't seem to replicate it. I've attached my vi, not sure if I'm doing something dumb or not. From my untrained eye, it looks like the wiring is different on the build path block diagram object, but I can't seem to get what you did, so perhaps the difference is aesthetic across out labview versions/settings?


Edit: Ignore that, I figured out the mistake. Funnily enough I got the VISA read to file working too, so I now have two working solutions. Thanks a lot though!

0 Kudos
Message 3 of 3