Beginner string question, RSLogix 5000

Hi,

I am reading on strings and having a hard time finding an instruction on making a string to display on the HMI. What I want to do is move a word into a string tag so that I can add it to a variable using concat. What instruction do I use to move the word "TEMP" into a tag "tmp"? thanks much
 
So I'm understanding that you have a STRING data type, and you'd like to put it into a temporary string so that you can CONCAT an integer to it.

If you want to "move" strings to another tag, you use the COP command.

In order to CONCAT an integer onto a string, I think you need to convert the integer to a string using the DTOS (DINT to STRING).
 
Not sure if this is want you want, but...

Just create the string tag, and on the monitor/edit tags, write 'TEMP' (or whatever you want) on the string value...
 
thanks for the reply,

COP would work if the text "TEMP" was already stored in a tag. What I want to do is store the text in a tag. For example, if I want to store the number 32 in a DINT tag I would use the MOV instruction. The MOV instruction does not work with strings because the source is alpha, so the instruction thinks "TEMP" is a tag, not raw text.
 
you're welcome

There's other ways, like moving the ascii code of each character to each
string position, and this way the MOV instruction works, but if you need a constant string I think it's easier just to write it like I said above...
 

Similar Topics

Post: Hi everyone, I’m pretty new to PLCs and industrial automation, and I’m trying to figure out the best way to get started. I’ve seen a lot...
43
Replies
2,668
Views
I have a powerflex 525 reset to the factory settings. Then I wired a normally closed switch from terminal 11 to terminal 1. with a jumper to a...
16
Replies
1,295
Views
Hi everyone, I'm new to the PLC world and currently learning step by step alongside my friend, who is a PLC programmer. I come from a mechanical...
5
Replies
854
Views
Interested getting into learning PLC. Thinking of getting factory I/O and a beginner and budget friendly PLC to start. Not sure what PLC to get do...
3
Replies
734
Views
Is there a site or repository with project examples of Siemens TIA S7-1200? Or just any good resource to learn to program the S7-1200. I have...
9
Replies
4,005
Views
Top