Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Word Wrap / Carriage Return on CSI Web Server


MPPMC Oct 31, 2012 11:19 AM

Hi all,

Is it possible to enter commands that the program will read in to a string? I have a string used for adding comments that is displayed on a website via CSI Web Server. As I can't seem to get the Digital box or Set Point box to word wrap, I'm wondering if I could add a carriage return by entering something in the string. I already have CHR(13) assigned to Const = CR and use this for formatting in another string used for sending messages via SMS.

I've already tried [First line of text here "+CR+" second line of text] and the above with "+CR(13)+" but neither work. I use this format fine in the SMS string I mentioned that is a fixed message defined in the program e.g. ,"Some text"+CR+"More text"+CR+"Variable has gone:"+Variable,

I can see why adding commands via a string would not be allowed for integrity/security measures. Any ideas how to do this or just simply get a word wrap on the website? Note that I've tried a few variations already: double and triple quotation marks and omitting the plus when using CHR(13).

Thanks


tmecham Oct 31, 2012 02:50 PM

Try entering Line1%13Line2. Special characters are sent using URL safe encodings. They won't show up properly in the web display, but the string should be set properly in the logger.


MPPMC Nov 1, 2012 12:31 PM

Thanks for the reply but it's the carriage return showing up in the web display that I'm after.


MPPMC Nov 1, 2012 12:48 PM

I've just noticed that if you go through the table display in the Connect screen and right click then View / Modify Value to update the field, you can just use the return key to get to the next line in the resulting text box. This shows up as desired in the web display. The field in the table display shows the two line unrecognised character symbol. Just need to find out what this character code is.


MPPMC Nov 15, 2012 11:22 AM

Just as a quick follow up to this, I couldn't find any character to enter to allow a carriage return so used a simple work around. I broke up the string in to several parts and reconstructed it in another string with the ASCII code for carriage returns(13) in between. Hopefully this will be useful for anyone else who needs to word wrap a setpoint on CSI Web Server / RTMC.


Const CR=CHR(13)
Public Comment As String *300
Dim CommentS(5) As String *60
Public CommentF As String * 300

BeginProg

Scan (1,Sec,0,0)
CommentS(1) = Mid (Comment,1,60)
CommentS(2) = Mid (Comment,61,60)
CommentS(3) = Mid (Comment,121,60)
CommentS(4) = Mid (Comment,181,60)
CommentS(5) = Mid (Comment,241,60)
CommentF = CommentS(1)+CR+CommentS(2)+CR+CommentS(3)+CR+CommentS(4)+CR+CommentS(5)

NextScan
EndProg

Log in or register to post/reply in the forum.