Ascii strings and programming constants

02js4130

Member
Join Date
Jun 2014
Location
Wales
Posts
38
HI,

i am having trouble trying to differentiate between 2 strings using just integers, so i need to do a string compare and use the letters to differentiate and this will work perfect. The in-comming data is from a barcode scanner.

My problem comes with my limited knowledge on how to hard code a constant value in a string....any help would be great??

I am using rslogix 500 and a micrologix 1200 with an ascii module.

The strings i need too compare are quite long:

^J0922^AT08RM00030\00
AND
^J0922^AT08FL0003A\00

Both strings can only be differentiate by 3 as integers and that is my problem, idealy i would like just too use 3A.

Thank you for any help :)
 
I think you need to put the "hardcoded" string value into a tag and use that tag in the compare. I dont think you can put a string into a compare function directly.
 
Here are the RSLogix ASCII String Control instructionsthat you have to work with. ASR may work for your comparison.

If you know that the internal location of your integers are always at the same place, you can use AEX to extract only that integer portion, then do a ACI on that portion, then check the integer value using regular integer instructions.
My problem comes with my limited knowledge on how to hard code a constant value in a string....any help would be great??
To enter a string in RSLogix memory, first set up a String Data File (ST9 perhaps), then click on "Data Files, ST9", then type in your Strings in two of the 82 string memory locations.

RSLogix String Instructions.jpg
 
Last edited:
thanks for the reply's! much help.

I have solved the problem using your methods of inputting via the data table and it works a treat.

Also learnt something new :)
 

Similar Topics

Hello All, Is there a way to send several ascii stings to a display using one AWT command? I am using one AWT for every error message, if there...
Replies
3
Views
1,935
Dear Gentlemen/Ladies, I have a bit of a nut cracker here. I am using a Koyo DL06 and a D0-DCM (slot 4). I have some issues with the DCM module...
Replies
10
Views
4,768
I am trying to send a command string via the serial port of a Logix5555 processor to an Omron RFID controller. Using a SLC 500 I can send this...
Replies
2
Views
4,383
this is a request posted on another forum ... since this topics of "using ASCII input data ... converting strings into numeric values ... and...
Replies
3
Views
16,710
Firstly great website guys!! I am having difficulties copying an ascii string from an integer register to an ascii register. In our system, a...
Replies
6
Views
10,974
Back
Top Bottom