RSLogix 5000 Data Search & UDT

This absolutely works for me...

You have put "Part_Recipe" at the end of your expression, you should have "Part_Number" - that is what you are searching for.....

2018-04-23_120504.jpg
 
Last edited:
daba: WHAAAAAATTTTT?!?! So I changed the expression to Part_Number as you suggested in your example and my errors went away!!! This is what I found to be confusing, previously I did not have anything after the [Control.POS] and that gave me errors. Then I added the Part_Recipe after that and then I got other errors. Now that I have changed it as you suggested....POOF, no more errors!!!! SO thanks to everyone who has patiently assisted me with this problem, its good to also know that I wasn't too far off on my original expression. I just wasn't quite there and needed that extra nudge(probably with a locomotive at full speed) to connect all the dots!!! Now that the FSC no longer has any errors, I should be ok with configuring the rest of the logic for this project!!!! Great advice, and another issue resolved!!! Thanks again!!!
 
Another thing to consider is the use of STRING data-type in your UDT.

That allows for strings up to 82 characters, and could be extremely wasteful on memory space.

You can make your own STRINGxx data-types to accommodate for shorter (or longer) strings. Say the maximum length of your Part_Number is 8 digits, you will save a huge chunk of memory by creating a STRING8 data-type, and using that in your Part_Recipe UDT instead.

STRING uses 88 bytes of memory
STRING8 uses just 12 bytes

Multiply the difference by 50 Recipe tags, thats over 3K of memory saved...

2018-04-23_122222.jpg 2018-04-23_122233.jpg
 
daba: WHAAAAAATTTTT?!?! So I changed the expression to Part_Number as you suggested in your example and my errors went away!!! This is what I found to be confusing, previously I did not have anything after the [Control.POS] and that gave me errors. Then I added the Part_Recipe after that and then I got other errors. Now that I have changed it as you suggested....POOF, no more errors!!!! SO thanks to everyone who has patiently assisted me with this problem, its good to also know that I wasn't too far off on my original expression. I just wasn't quite there and needed that extra nudge(probably with a locomotive at full speed) to connect all the dots!!! Now that the FSC no longer has any errors, I should be ok with configuring the rest of the logic for this project!!!! Great advice, and another issue resolved!!! Thanks again!!!

Sometimes the trees obscure what you are looking at ....
 
Good catch Daba, I overlooked that too... looks good, then you can do something like
xic control.fd copy part_data[control.pos] to current_recipe then res your search.
you can also add some logic with what you want to do if the search is .dn and the part is not .fd
 
DonBlack: That is exactly what I am working on right now, and I also will be including a part not found condition to be displayed on the HMI as well.
 
Another little tip: after the part recipe is found, copied, and the search is reset, you might want to clear the hmi input tag. I do this just so it is empty for when the next guy goes to type a part number in.
 
DonBlack: That is exactly what I am working on right now, and I also will be including a part not found condition to be displayed on the HMI as well.

One other (minor) thing to mention is your use of INT and SINT data-types.

You only need to use these if you need to communicate them with another machine that works only with 8 or 16-bit data (such as a PLC5, for example).

ControlLogix controllers are 32-bit machines, so whenever you address a tag (or a tag member) less than a DINT, it has to be converted to a DINT for processing, and converted back again for storage. This is very inefficient.

Just make all your numeric data DINTs and/or REALs for maximum efficiency.

Probably your "Part_Number" could be a DINT as well, since a DINT will hold positive numbers up to 2,147,483,647 - this might be enough digits for your application, and will gain you even more efficiency and memory usage....
 
DonBlack: You and I are thinking on the same page today sir, that is just what I finished doing!!!

daba: I'm using the INT for moving a value into a counter preset, the SINT is a data type that is for an external device that requires this data type. My part numbers are all alphanumeric so I do need the STRING type for those. Thanks!
 
DonBlack: You and I are thinking on the same page today sir, that is just what I finished doing!!!

daba: I'm using the INT for moving a value into a counter preset, the SINT is a data type that is for an external device that requires this data type. My part numbers are all alphanumeric so I do need the STRING type for those. Thanks!

No problem... looks like you've got it covered, the STRING could be shortened though, to save memory, surely ?
 
daba: Yes you are correct, I will just have to do some testing to see where I can trim it up some! Again thanks for all your help, it has definitely saved me time with getting this resolved.

Knowing that the PLC is capable of doing a task and knowing how to program the PLC to do that task are worlds apart!!! This forum has been and continues to be of such great help for me in helping me with PLC programming. The longer I work in this field, the more I try to make use of the functions of PLC's. I just feel that the knowledge shared here is so far above that provided by RA Tech Support when it comes to Allen Bradley. This is one of those instances!!! Thanks again!!!
 
DonBlack: You and I are thinking on the same page today sir, that is just what I finished doing!!!

daba: I'm using the INT for moving a value into a counter preset, the SINT is a data type that is for an external device that requires this data type. My part numbers are all alphanumeric so I do need the STRING type for those. Thanks!

I missed this at first... A logix5000 counter preset is a DINT data-type, so using a DINT in your UDT would be wholly appropriate, increases program scan efficiency, and, as it happens due to allocation of memory in your UDT, will have zero effect on your UDT byte-count.

I'll say it again, not just for you but for anyone else reading... Stick with DINTS as your data-types UNLESS it really has to beanother data-type for whatever reason.
 

Similar Topics

Thank you for any and all responses/help. I have an RSLogix 5000 v20 and a Cognex In-Sight v5.9 spreadsheet (8502P). I can not figure out how to...
Replies
0
Views
101
I have a micrologix 1100 that I am trying to read three data points from it on my safety plc using studio 5000. Any tips or guidance is appreciated.
Replies
4
Views
815
I want transfer my I/O data from schneider (Unity Pro) as a write data and RS Logix 5000 as a read data. I use Ethernet as an communication...
Replies
0
Views
682
Im trying to sum a running "Shift Total" production value and move it into a Month Total value that will continuously update for viewing...
Replies
1
Views
1,517
It has been a while since I used RSLogix 5000. Is there a way for me to save data in excel, notepad, etc?? I want data to be saved when a user...
Replies
4
Views
1,748
Back
Top Bottom