# Reading file in RAPID does not work .

**URL:** <https://tech-community.robotics.abb.com/t/reading-file-in-rapid-does-not-work/6558>\
**Category:** RobotStudio\
**Created:** [March 30, 2015, 5:08am UTC](https://tech-community.robotics.abb.com/t/reading-file-in-rapid-does-not-work/6558 "2015-03-30T05:08:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![milerik](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@milerik](https://tech-community.robotics.abb.com/u/milerik)\
**Post date:** [March 30, 2015, 5:08am UTC](https://tech-community.robotics.abb.com/t/reading-file-in-rapid-does-not-work/6558/1 "2015-03-30T05:08:26Z")

</div>

Hello there !  
  
I want to use OPEN command and read an TXT file. Offline mode is working like a charm ( txt file contains coordinates) , but when I uploaded the code to the real robot is writing an error on the pedant :

Error 41676 Device access error , and write the path that containts the \*.txt files.

Its a simple code of lines :  
PROC Reading()

VAR iodev file;  
VAR string text;

Open “HOME:” \file:= “1.txt” , file \Read;  
!TPWrite ReadStr(file);  
Rewind file;  
!text := ReadStr(file\Delim:=“,”);  
Runnable:= ReadNum(file);  
Close file;

ENDPROC

the HOME folder the default one.I did not change it . Its on my laptop hard drive

C:\Users\Hanokri\Documents\RobotStudio\Systems\IRB140\_6kg\_0.81m\_typeC\_28\HOME\1.txt

Maybe I need to calibrate the controller somehow, to see my laptop folder ? I connected the robot via Ethernet cable.

I welcome any answer , please : )

---

<div class="post-metadata">

**Author:** ![svoldgaard](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/svoldgaard/32/3334_2.png) [@svoldgaard](https://tech-community.robotics.abb.com/u/svoldgaard)\
**Post date:** [March 30, 2015, 6:29am UTC](https://tech-community.robotics.abb.com/t/reading-file-in-rapid-does-not-work/6558/2 "2015-03-30T06:29:41Z")

</div>

Do you have a copy of the txt file on the robot or is it only on you laptop?

---

<div class="post-metadata">

**Author:** ![milerik](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@milerik](https://tech-community.robotics.abb.com/u/milerik)\
**Post date:** [March 30, 2015, 9:58am UTC](https://tech-community.robotics.abb.com/t/reading-file-in-rapid-does-not-work/6558/3 "2015-03-30T09:58:04Z")

</div>

It is only on my laptop. But I realized I can not used this methode , the robot is checking its on hard drive only, not on my laptop harddrive .  
Can I use Socket Messaging to get the same result? I mean my rapid code is already upload on my robot and Its in run mode, waiting for 1 value to begin reading incoming X and Y coordinates from my labview TCP/IP connection. I get the string(coordinates) from like this  
…  
SocketReceive socket1 \Str:=received\_string;

…  
then received\_string: = VAR NUM Y\_coordinate . Could It work ?
