Autor Thema: OSCAT_NETWORK.CSV_PASER_BUF  (Gelesen 14023 mal)

0 Mitglieder und 1 Gast betrachten dieses Thema.

adrian.garcia

  • Gast
OSCAT_NETWORK.CSV_PASER_BUF
« am: 25. Juli 2014, 23:50:25 »
Hi,

I am new in the forum and I don´t speak German, so I will write in english. I am developing a RecipeManager, and one funtionality is import values since file .csv to array of strings. I use following code for read values:

VAR
hFile      : DWORD;

   dwRead      : DWORD;
   szFilePath   : STRING := 'C:\Temp\CODESYS.csv';
   szSeperator   : STRING(1) := ';';
   szCurrent   : STRING(255);
   szWord      : STRING;
   Result      : SysTypes.RTS_IEC_RESULT;
   
END_VAR
hFile := SysFile.SysFileOpen(szFile:=szFilePath, am:=SysFile.AM_READ, pResult:=ADR(Result));
dwRead := SysFile.SysFileRead(hFile:=hFile, pbyBuffer:=ADR(szCurrent), ulSize:=SIZEOF(szCurrent), pResult:=ADR(Result));

Now, I want to use CSV_PARSER_BUF, so I want to obtain values between Separator (',') and copy everyone in a Strings of my recipe, my problem is that This FB not run correctly. I have attached a picture with errors that i have when i build.

I hope help :).....and many thanks for support in advance

Regards,
Adrián
     

[gelöscht durch Administrator]

Offline peewit

  • Moderator
  • *****
  • Beiträge: 2 378
    • Profil anzeigen
Re: OSCAT_NETWORK.CSV_PASER_BUF
« Antwort #1 am: 26. Juli 2014, 12:20:51 »
Hi,

in the network library in the demo folder you can find an example program (see the picture)


[gelöscht durch Administrator]

adrian.garcia

  • Gast
Re: OSCAT_NETWORK.CSV_PASER_BUF
« Antwort #2 am: 26. Juli 2014, 12:29:00 »
just now, i was Reading that in other post in Forum. I think with this information I can use this FB.

Thank you very much for support ;) ;) ;)

Regards,
Adrián

adrian.garcia

  • Gast
Re: OSCAT_NETWORK.CSV_PASER_BUF
« Antwort #3 am: 28. Juli 2014, 13:37:35 »
Buenos Días,

I have attached a picture of my Project, only with FB CSV_PARSER_BUF. I want learn to use this FB, because it is useful for a Project that i am developing. I am using V3.5 SP4 Patch2. I want to use this CSV_PARSER_BUF for import data of a file csv. I have read help document and demo project of this FB in OSCAT_NETWORK, but I don´t understand, so I hope you can support:
                1.- How define type of separator ‘,’ or ‘;’ if SEP is type BYTE????
                2.- I don’t understand PT type OSCAT_NETWORK.NETWORK_BUFFER, I have seen that it is a pointer of Byte, but How define path and import data to my buffer since file csv????.

Saludos Cordiales, 


[gelöscht durch Administrator]

BlueGreenLable

  • Gast
Re: OSCAT_NETWORK.CSV_PASER_BUF
« Antwort #4 am: 06. November 2014, 05:52:10 »
Congratulations,Couldn't have done it without you! Hugs to you.

adrian.garcia

  • Gast
Re: OSCAT_NETWORK.CSV_PASER_BUF
« Antwort #5 am: 06. November 2014, 08:54:26 »
Hi BlueGreenLable,

Can you send a example using CSV_PARSER_BUF????. I dont have clear using OSCAT demo example.

Regards and thanks in advance
Adrian

Offline drChiavo

  • Newbie
  • *
  • Beiträge: 6
    • Profil anzeigen
    • E-Mail
Re: OSCAT_NETWORK.CSV_PASER_BUF
« Antwort #6 am: 21. Januar 2016, 18:21:05 »
Hallo Peewit,

wo kann ich das CSV_PARSER_FILE_DEMO schauen? Bei mir gehts leider nicht. Es gibt nur den baustein CSV_PARSER_FILE.




[gelöscht durch Administrator]

Offline peewit

  • Moderator
  • *****
  • Beiträge: 2 378
    • Profil anzeigen
Re: OSCAT_NETWORK.CSV_PASER_BUF
« Antwort #7 am: 21. Januar 2016, 23:22:51 »
öffne die network-bibliothek als projekt und schaue dir den ordner "demo" an
darin befinden sich einige ausgeblendete programme


Offline drChiavo

  • Newbie
  • *
  • Beiträge: 6
    • Profil anzeigen
    • E-Mail
Re: OSCAT_NETWORK.CSV_PASER_BUF
« Antwort #8 am: 22. Januar 2016, 13:10:32 »
Hallo Peewit,

danke für die Antwort. Ich habe noch eine Frage und zwar kann ich den "csv.txt" einlesen, wenn ich nur "CODESYS Control Win V3" nutze? weil ich habe gelesen, dass der Textblock auf der sps ablegen muss.  Wenn ja, wo soll ich diesen Textblock ablegen.
Vielen danke im Voraus

Offline peewit

  • Moderator
  • *****
  • Beiträge: 2 378
    • Profil anzeigen
Re: OSCAT_NETWORK.CSV_PASER_BUF
« Antwort #9 am: 22. Januar 2016, 13:48:23 »
das muss dir dein sps lieferant sagen

je nach sps gibt es verschiedenen möglichkeiten eine datei bzw. datei mit pfad anzugeben
wo dieses speicherplatz dann real zu finden ist, ist auch systemabhängig

meinem baustein ist es egal wie und wo, es muss nur für das jeweilige system eine logische angabe sein.