Red Lion Crimson 3, Concat 3 strings to make a new one.

Edmhydraulics

Member
Join Date
Apr 2014
Location
Beaumont
Posts
173
Hey all, is there a way with Crimson where I can Concat 3 different string tags into a new tag.

Something like:

Filename = (partnumber + serialnumber + test type)

Please let me know.

Thanks
 
Yes, pretty much just like your example. Use the "+" operator with strings. Use quotation marks around literal strings.

You describe it as a new tag, but it would actually be the data contents of a CString type of tag.

Note that if you want to concatenate tags that are numeric or flag types you can use the property ".AsText" appended to the tag name. So if PartNumber and Serial are numeric tags, and you want to make them into a single string:

Newstring := PartNumber.AsText + Serial.AsText
 
You can also use the DecToText() command to convert a numeric value to a string, which gives you control of how the number is formatted. See the reference manual for details on the syntax.
 
Thanks guys this is very helpful, I was able to concat the strings I needed. What I am trying to do is create a file name using the 3 different strings, this seems to work well, but when I go over 8 characters in the file name it adds a period and the remaining characters after the period so that pretty much wont work.

Can I create a file folder on the SD card such as Workorder/serial_number and then save the a bmp file into the file folder. I have tried the file create functions, but again I cant seem to get it to work. As well, the system doesnt really seem to like when there are numbers in any of the strings.

Thanks again.
 
Thanks guys this is very helpful, I was able to concat the strings I needed. What I am trying to do is create a file name using the 3 different strings, this seems to work well, but when I go over 8 characters in the file name it adds a period and the remaining characters after the period so that pretty much wont work.

Can I create a file folder on the SD card such as Workorder/serial_number and then save the a bmp file into the file folder. I have tried the file create functions, but again I cant seem to get it to work. As well, the system doesnt really seem to like when there are numbers in any of the strings.

Thanks again.

I'm pretty sure you have answered your own question. As far as I remember, the file system doesn't allow the folders or filenames to be more than 8 characters. I believe it uses FAT16.
 
As well, the system doesnt really seem to like when there are numbers in any of the strings.
Numeric characters should not be a problem in filenames. Of course, they need to be in string format.
"string" + "56" will return "string56"
"string" + 56 will probably return "string8" since 56 is the ASCII code for character "8".

As mentioned previously, names of files and folders are limited to 8 characters with the G3 system.
 

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
103
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
665
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,111
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,012
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,660
Back
Top Bottom