Write CSV file to Revpi connect + using CodeSys

Post Reply
Fproject
Posts: 3
Joined: 08 Feb 2022, 15:11

Write CSV file to Revpi connect + using CodeSys

Post by Fproject »

Hi,
I am having some problem with writing a CSV file to the connect + using CodeSys.
Currently I am using the function block CSV.Init, and the FB shows either xerror "19" or "Cannot_get_file_size".
Does anyone have any idea to what the problem could be?

The following is set up to the FB CSV.init

xExecute: "TRUE";
sDirectorypatch: "/root/"
sFileName: "JustTesting.csv"
sColumSeparator: ";"
rCSVWriter: "gCSVWriter" -> where gCSVWriter is set as CSV.CSVWriter; in the program var.
User avatar
nicolaiB
KUNBUS
Posts: 931
Joined: 21 Jun 2018, 10:33
Location: Berlin
Contact:

Re: Write CSV file to Revpi connect + using CodeSys

Post by nicolaiB »

Hi,
sDirectorypatch: "/root/"
Shouldn't this be sDirectoryPath? Also I doubt that codesys should be allowed to write to /root

Nicolai
Fproject
Posts: 3
Joined: 08 Feb 2022, 15:11

Re: Write CSV file to Revpi connect + using CodeSys

Post by Fproject »

Hi,

Meant to write sDirectoryPath, typo from me with patch.
Tried with many other paths, but got the same error.
Do you have a suggestion for a path that should work, or other alternatives for what it could be?
User avatar
nicolaiB
KUNBUS
Posts: 931
Joined: 21 Jun 2018, 10:33
Location: Berlin
Contact:

Re: Write CSV file to Revpi connect + using CodeSys

Post by nicolaiB »

Hi,

unfortunately I don't have any other idea about this. Maybe it would make sense, to ask this question directly at the CODESYS forums. There are lots of CODESYS specialists and this problem is not directly related to the RevPi codesys library: https://forge.codesys.com/forge/talk/

Nicolai
User avatar
Amar
KUNBUS
Posts: 160
Joined: 15 Jul 2019, 12:58

Re: Write CSV file to Revpi connect + using CodeSys

Post by Amar »

Codesys App would most probably not be able to write to /root path. I am attaching a example with RevpiCompact which has functionality for writing to a csv file.
You could also ask on Codesys forum for further help.

https://forge.codesys.com/forge/talk/

Attachment:
CompactCycleTimeEvaluator.zip
(206.49 KiB) Downloaded 679 times
KUNBUS
Fproject
Posts: 3
Joined: 08 Feb 2022, 15:11

Re: Write CSV file to Revpi connect + using CodeSys

Post by Fproject »

Hi again,
I tested with another revpi connect, and got no error there.
I have been comparing the two, and the only difference that i found is that the one that gets the error is missing this folder :"cmat_licenses" when wieved in device->files->runtime in codesys.
Could this be the fault?
Post Reply