PLCnext on Instagram  PLCnext on YouTube Github PLCnext CommunityStore PLCnext Community

  1. avladut@phoenixcontact.com
  2. PLCnext Engineer
  3. Monday, 10 February 2020

In PC WORX we can insert CR LF like this:

(*CR LF*)
sCRLF := BYTE_TO_STRING(BYTE#16#0D,'%c');
sCRLF := CONCAT(sCRLF,BYTE_TO_STRING(BYTE#16#0A,'%c'));

How can I do this in PLCnextEngineer?

To_String((BYTE#16#0D,'') or To_String((BYTE#16#0D,'{0:C}') does not seem to work.

Accepted Answer
Stefan Brinkmann Accepted Answer Pending Moderation
0
Votes
Undo

Try to use only one bracket at the beginning of your definition, e.g. stCR := To_String(BYTE#16#0D,'{0:C}'); and stLF := To_String(BYTE#16#0A,'{0:C}');. With the concat function adding this to your string it works fine for me.

avladut@phoenixcontact.com Accepted Answer Pending Moderation
0
Votes
Undo

Thank you, it works like you said.

  1. one week 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.