Posted 14 Dec 2021 Hello, I have an idea to read a text file (txt,xml,csv, etc.) from USB on NA HMI. I did small research over internet and NA terminal manual, but was not able to find any information how can I read a file using VB script on NA HMI panel. Is it anybody tried vb scripting in way to read a file or data from USB stick connected to HMI panel? Thanks in advance! Share this post Link to post Share on other sites
Posted 11 Jan 2022 I believe I have found the solution. System.IO.StreamReader or System.IO.File.AppendText Share this post Link to post Share on other sites
Posted 14 Jan 2022 with StreamReader , you read but with AppendText you can create and add a line in a txt file . Share this post Link to post Share on other sites
Posted 14 Jan 2022 Make a text box on your screen and a button to call the ReadTXT subroutine. Add this to your page code: Dim FileReader As System.IO.StreamReader Public Sub ReadTXT FileReader = System.IO.File.OpenText( "\USBDisk\txtdoc.txt") TextBox0.text=FileReader.ReadToEnd FileReader.close End Sub Share this post Link to post Share on other sites