Page 1 of 1

Write CSV file to Revpi connect + using CodeSys

Posted: 09 Feb 2022, 10:29
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.

Re: Write CSV file to Revpi connect + using CodeSys

Posted: 09 Feb 2022, 11:00
by nicolaiB
Hi,
sDirectorypatch: "/root/"
Shouldn't this be sDirectoryPath? Also I doubt that codesys should be allowed to write to /root

Nicolai

Re: Write CSV file to Revpi connect + using CodeSys

Posted: 09 Feb 2022, 13:02
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?

Re: Write CSV file to Revpi connect + using CodeSys

Posted: 09 Feb 2022, 13:06
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

Re: Write CSV file to Revpi connect + using CodeSys

Posted: 10 Feb 2022, 13:35
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 314 times

Re: Write CSV file to Revpi connect + using CodeSys

Posted: 16 Feb 2022, 15:41
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?