PLCnext on LinkedInPLCnext on Instagram  PLCnext on YouTube Github PLCnext CommunityStore PLCnext Community

0
Votes
Undo
  1. Louis L.
  2. PLCnext Engineer
  3. Monday, 17 February 2020

Hello dear colleagues,

 

I'm actually having trouble about the newline format to use in a string while using the FILE_WRITE function.

Here is the way i use all the FILE_* functions : 

FILE WRITE

And here is how my string input looks like :

InputString

StrLine

 

I tried to used a multiple newline format like "\n", "\r\n", " " , ",\n," but i still don't have any newline in my CSV file:

CSVFile

 

Do you have any idea of what i'm doing wrong ?

 

Thanks in advance for your reply.

 

Best regards.

Accepted Answer
Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Hello,

Something like the below should work.

The trick is to to use the "C" formatter to format ASCII codes as the corresponding control characters.

Note that you will not see these control characters when viewing the String variable in PLCnext Engineer debug mode - not even a placeholder. So it may seem like these control characters have not been inserted into the string. But you should find that they are there in your CSV file.

 

52585DA2 3689 484A 885A E82093125336

Hope this helps.

~ Martin.

 

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

  1. more than a month ago
  2. PLCnext Engineer
  3. # Permalink
Louis L. Accepted Answer Pending Moderation
0
Votes
Undo

It works for me ! 

 

Thanks for your reply.

  1. more than a month ago
  2. PLCnext Engineer
  3. # 1
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.