Using String

Jdhannon

Member
Join Date
Dec 2012
Location
Factoryville, Pa
Posts
5
I have 5 lines the can be set up as "Blue" or "Red". The name of the lines are Line1Name, Line2Name, Line3Name, Line4Name and Line5Name and the value of the line is changed through a string that will show them as BLUE or RED. I need to be able to look for a blue line and a red line that is full to release. How can I search the lines for a blue and a red?
 
I have 5 lines the can be set up as "Blue" or "Red". The name of the lines are Line1Name, Line2Name, Line3Name, Line4Name and Line5Name and the value of the line is changed through a string that will show them as BLUE or RED. I need to be able to look for a blue line and a red line that is full to release. How can I search the lines for a blue and a red?

What hardware? What software? what language? Going to need a lot more details to even start helping you.
 
Good reference, Christoff. I saved that manual also.

What hardware? What software? what language? Going to need a lot more details to even start helping you.
That is always the same old problem on this site. It reminds me of that science fiction book Stranger in a Strange Land by Robert Heinlein (underline here is correct English for a book title, and is not an Internet link). PLC strangers always assume that everyone speaks a common PLC language, has the same brand and model of software, and that everyone will immediately be able to understand what s/he is talking about.
 
Last edited:
I have 5 lines feeding into machine. A photo eye tell rslogix5000 plc when the lines are availible for release. in the plc each line line labeled with a string that says weather the line is red or blue ( example line1=blue;line2=red; line3=blue; line4=red; line5=blue) The lines can be changed from red to blue depending on production run for the day. I need to be able to look for an avaible blue & red line and release and look for next blue line that is ready and release with any red availible.
 
I need to be able to look for an avaible blue & red line and release and look for next blue line that is ready and release with any red availible.
Suppose you create and save two strings ST9:0 = "BLUE", ST9:1 = "RED". Then suppose the strings for the color of products to be released are Line 1 = ST10:1, Line 2 = ST10:2, Line 3 = ST10:3, and so on. Because the comparison statements in Logix5000 will accept strings, as shown in your manual on page 220, use EQUAL to compare each line to the "BLUE" and RED strings. You could use indirect addressing to shorten the logic.

| DO LINE 1 |
| BLUE DONE +-------------------+ BLUE |
|-----------|/|--------| Equal |--+---(OTE-----|
| | Source A ST10:1 | | |
| | | | BLUE DONE |
| | Source B ST9:0 | +---(OTL)----|
| +-------------------+ |
| DO LINE 1 |
| RED DONE +-------------------+ RED |
|-----------|/|--------| Equal |--+---(OTE)----|
| | Source A ST10:1 | | |
| | | | RED DONE |
| | Source B ST9:1 | +---(OTL)----|
| +-------------------+ |
| DO LINE 2 |
| BLUE DONE +-------------------+ BLUE |
|-----------|/|--------| Equal |--+---(OTE)----|
| | Source A ST10:2 | | |
| | | | BLUE DONE |
| | Source B ST9:0 | +---(OTL)----|
| +-------------------+ |
| DO LINE 2 |
| RED DONE +-------------------+ RED |
|-----------|/|--------| Equal |--+---(OTE)----|
| | Source A ST10:2 | | |
| | | | RED DONE |
| | Source B ST9:1 | +---(OTL)----|
| +-------------------+ |
. . .(AND SO ON FOR ALL 5 LINES)
. . .(AFTER ALL 5 HAVE BEEN CHECKED, AND FIRST TWO WITH A
RED AND A BLUE HAVE BEEN RELEASED, THEN UNLATCH THE "DONE"
BITS)
| BLUE DONE RED DONE BLUE DONE |
|-----------||------------| |-----------------+---(OTU)----|
| | RED DONE |
| |---(OTU)----|

 
Last edited:
I have 5 lines feeding into machine. A photo eye tell rslogix5000 plc when the lines are availible for release. in the plc each line line labeled with a string that says weather the line is red or blue ( example line1=blue;line2=red; line3=blue; line4=red; line5=blue) The lines can be changed from red to blue depending on production run for the day. I need to be able to look for an avaible blue & red line and release and look for next blue line that is ready and release with any red availible.

Determining availability of a line through the use of STRING variables seems to be an odd way to go. Perhaps deeper in the software there's a value attached to the line that would be better suited to the task in hand. You said it yourself... "A photo eye tell rslogix5000 plc when the lines are availible for release". The string value RED BLUE or whatever is derived from this, the photo-eye doesn't supply it.
 
What do you want to happen each time that your PLC programs checks all 5 lines and:
(1) There is a BLUE ready, but no RED, or
(2) There is a RED ready, but no BLUE, or
(3) There are none ready.

For each case, you need to set up a handling routine after the above Post #7 color-check routine.

I wondered about using the strings also, Daba. It could be a student exercise about string handling, or maybe JD has a new improved color-sensitive photosensor that outputs a color string instead of a bit. :confused:
 
Last edited:
thanks for the suggestion I will try that. The reason I am trying to use the string is because I am not the owner of the original program, the programmer used a string so he could name each line and built a matrix using that sting the the hmi and wonderware looks at. So I am trying to work with what I have been given. The problem we have is if the matrix is not satisfied no lines release so I am looking to release 2 lines 1 Blue(And again know clue why they are called blue/red not my program)and 1 red line and alternating lines each pass
 
I am looking to release 2 lines: 1 Blue . . . and 1 red line, and alternating lines each pass.
What do you mean by alternating? A true alternation for 5 objects taken 2 at a time is a fairly tough problem. My program only takes the first two available. If it takes some time to move new objects into place on those first-selected lines, then there will be some natural alternation due to the physical process (the first two will not be ready until two others have been released). If that is not good enough for your alternation, then you will have to save the line numbers of the ones that have been selected, until all other lines have been released, then reset the saved numbers to 0 and start again. Another way is to set up a 5-position rotary que or stack, so that the just-released line pair are moved to the bottom, and new selections are made from the top-to-bottom of the que (Last In, Last Out, or LILO).

You probably will need to add a contact to each rung that checks to see if that line is "Ready to Release". If not, it is skipped and the next line is checked until a pair are found.

Make an attempt and post the modified part of the program (ZIP it or print it to a PDF file), and somebody will come up with a good method.
 
Last edited:

Similar Topics

Long story short, I am creating a display to display an array of Strings from PLC [topic]VarStrA_RPHD.Desc[VarStrB] totally 100 strings...
Replies
1
Views
1,391
Hi all, I have a customer that is asking for a recipe of 200 recipes to be sorted. I'm trying to do this by way of a bubble sort. Basically my...
Replies
18
Views
3,442
FactoryTalk ME- Using a"String Input Enable" for Password Entry.How can I place X's Good Morning , FactoryTalk View ME ...... I'm...
Replies
2
Views
2,640
Hi to all, I have a quick ask. Is it possible to use a String as a PLC Tag? At input of FB I want to put a String. Lets say the value will be...
Replies
11
Views
2,208
So, I am a beginner-slightly intermediate level programmer, and I am looking for a way to access specific data, and pull it out of a larger...
Replies
11
Views
3,387
Back
Top Bottom