Crimson Right() Function Explanation

20 Oct 2026

The Right(string,count) function can be used to determine the characters in a string, starting from the right side of the string and returning the characters based on the count in the function.

 

APPLICABLE PRODUCTS

Crimson 2.0

Crimson 3.0

Crimson 3.1

Crimson 3.2

 

ISSUE / QUESTION / SYMPTOM

How to use the Right(string,count) function in Crimson programming.

Use Case:

  To determine the last three characters in a string tag starting from the right of the string.

  String=the string of characters you want to extract the characters from. A string tag can be used or characters       inside quotations ex:”Test1234”

   Count=the number of characters to return from the extraction.

 

Application:

When you scan a barcode/input a long string of characters in a text box.

You can extract the characters from the right of the string to use as a verification to setup a machine.

 

Example Programming:

RightStringExtract=Right(String,3);//This will extract the first three characters from the tag called string and put them in tag called RightStringExtract

If the tag labeled String=ABCD123 when this function is run, the characters that will show in tag RightStringExtract will be 123.

You can use this in other programming for to choose settings for a machine.

Example:

MachineSpindleUp=0;

MachineSpindleDown=0;

if(RightStringExtract == ”123”)

{MachineSpindleUp=1;}

else if( RightStringExtract != “123”)

{MachineSpindleDown=1;};

 

Explanation:

This function will extract the number of characters starting at the Right of the string and put them in a string tag.

 

POSSIBLE CAUSES / ANSWER

Using the Right() function can extract characters from a string tag or value starting from the right first character. It returns the number of characters in the count value.

 

Need Further assistance? Submit a support ticket here.

https://support.hms-networks.com/

© HMS Networks AB 2026