I have troubles to read the data from a write protected file. In the case of "WriteProtection" is off, the application works without problems. In the case of "WriteProtection" is on, the application get only an blank string.
Your problem that you are using vi Open File with default parameter that opens file for reading/writing mode. Change parameter function to Open (Read-Only).