Jump to content
OMRON Forums

put and read a file (.txt) into PMAC flashmemory


CVillaleiva
 Share

Recommended Posts

Hi,

 

i have a aplication on windows 7 that generate a output file in .txt format.

I need that the pmac have acces to this file to read and load global variables with the information.

 

I try put file using the ftp (ftp://192.168.200.1) but i dont have succes.

 

i create a C aplication into pmac using libraries

 

#include

#include

#include

 

but i have dude with the path to acces a file. if you can give me a example how to put the path and where is the best place to put the file.

 

thanks.

 

int main(void)

{

FILE * fp;

char * line = NULL;

int len = 0;

int read;

struct Data data;

{

 

};

fp = fopen("test.txt", "r");

if (fp != NULL){

while ((read = getline(&line, &len, fp)) != -1) {

data = getValue(line, read);

}

fclose(fp);

if (line)

free(line);

}

printStructure(&data);

return 0;

}

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...

If you place the file in the ftp top level directory it should be located in /var/ftp. So pass the full file path to fopen:

 

fp = fopen("/var/ftp/test.txt", "r");

 

 

thanks for your answer.

 

I try but when i put the file into the ftp folder the system throw the attached problems.

 

how can i enable and wich is the best folder to put the file?

 

thanks again

cap1.PNG.bdfbd1d0bdc0eb7ef46221764c5e18af.PNG

cap2.PNG.9ea8376b218f3a1e843886db117e9fcc.PNG

Cap3.PNG.04384fdbf33cf1ede828b9e3c71d7b81.PNG

Link to comment
Share on other sites

I am able to drag a text file into gather or usrflash no problem on multiple PMAC CPU types through ftp in a file explorer like your computer shows. What PMAC form factor is this and can you share the file or try with a dummy text file with just a sentence written?

 

the Pmac is POWER PMAC CLIPsee P233I-E-01 [4-4050JA0-310-000000] and the text file (.txt) that i tried put was:

 

start=1;

stop=0;

Link to comment
Share on other sites

I am not able to replicate your problem. Please try using an FTP client like filezilla as windows file explorer as FTP can have some issues.

 

There is a windows option you can try to see if it helps. Find "internet options" in either the control panel or searching the start menu. Go to the advanced tab and scroll down to "Use passive FTP (for..." and check/uncheck the box. If it doesn't help, just set it back.

passiveftp.png.d4f97480ab68e25385cd7b7fa4cdc540.png

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...