Red Lion Crimson 3.1 CR/LR in complex code return string

Join Date
Sep 2015
Location
Atlanta
Posts
1
I have this complex code tag that returns as a string variable. For some reason it returns the two strings with a ?? between them -- not the second string on a newline as I need it.

Code:
cstring _string,_string2;

_string := AsText(Hz) + " Hz - " + AsText(Amps) + " Amps";
_string2 := AsText(CPM) + " CPM - " + AsText(FPM) + " FPM";


return _string + "\r\n" + _string2;
 
I have this complex code tag that returns as a string variable. For some reason it returns the two strings with a ?? between them -- not the second string on a newline as I need it.

Code:
cstring _string,_string2;

_string := AsText(Hz) + " Hz - " + AsText(Amps) + " Amps";
_string2 := AsText(CPM) + " CPM - " + AsText(FPM) + " FPM";


return _string + "\r\n" + _string2;

In Crimson, you would use the PIPE symbol to put the rest of the string on the second line. I haven't looked at the rest of your logic to be sure it is correct, but to answer your question, simply replace the "\r\n" with "|"
 
I have tried a similar thing on 3.0 simulator and get the same result. But I think you are confusing what is displayed on screen and what would be sent to a Port. The screen can't use the \n\r, it doesn't know what they mean, so you get the ?s. The Port passes the ASCII equivalent of \n\r to the connected device and hopefully it does know what to do with them. If you aren't sending the data using PortPrint(), then you are trying a bit of a strange way to get a two line string on to the screen. You should just have two Result tags and put each in to its own separate box on screen.
Code:
_string := AsText(Hz) + " Hz - " + AsText(Amps) + " Amps";
_string2 := AsText(CPM) + " CPM - " + AsText(FPM) + " FPM";
Then put _string in one box on screen and _string2 in a second box.
 

Similar Topics

How do you install update on Red Lion Crimson ver 3.1. Do I just need to run the exe file on the host server?
Replies
1
Views
107
Hi, I am trying to increase the size of the user login pop up using a Red Lion CR1000 7” HMI with Crimson 3.1 software. The login pop up is very...
Replies
2
Views
668
Hello, We are currently running a bunch of g310's connected to their SLC5 PLCs through ethernet. I've attempted to upgrade the program from 2.0...
Replies
1
Views
1,121
Hi I have been using Red Lion products for some time, I had a thought over the bank holiday weekend, As you do. It would be nice if whenever a...
Replies
4
Views
1,015
Well, I have yet another question for the great minds on this forum! We have a red lion HMI for one of our machines and every time I hook my...
Replies
11
Views
1,670
Back
Top Bottom