Sign in to follow this  
Followers 0
asjeetabhi8816

How to compare 2 identical scanned values in Micrologix 1400 PLC

9 posts in this topic

I want to compare 2 identical scanned values in Allen Bradley Micrologix 1400 PLC. What are the instructions required to do that?

Share this post


Link to post
Share on other sites

Depends what you want to do.

EQU: If the values are equal to each other.

NEQ: If the values are not equal to each other

GRT" If A is greater than B

GEQ: If A is equal to or greater then B

LES: If A is Less than B

LEQ: If A is equal to or less then B

Share this post


Link to post
Share on other sites

If by 'scanned values' you mean strings then use the ASR command.

Share this post


Link to post
Share on other sites

Please clarify...what do you mean by "scanned values"?  Float, real, string/ASCII?

1 person likes this

Share this post


Link to post
Share on other sites

Its a string.

and I want to know if i scan a certain barcode,then can i store or use that barcode to match the exact same barcode which i will scan later?

 

 

Share this post


Link to post
Share on other sites

You can use COP (Copy File) to copy one string to another. Later, as mentioned, you can use the ASR command to compare strings.

Share this post


Link to post
Share on other sites

Thanks for the reply b_carlton

But how to use this copy command in case of string?

I have put ST12:1 to source and ST12:2 to destination with 10 as length.but it is saying my program has errors.

So can you tell me how to put values of string in COP command.

Share this post


Link to post
Share on other sites

I have tried COP command again and this time its working.

But i have one problem, when i scan a certain value at  ST 12:1 (as an example),then the value gets copied to ST 12:20(through COP command).But when i reset the scan and scan again the value do not remain on ST 12:20.It gets vanished.

So can you tell me how to save that value so that i can compare it with another scan

Share this post


Link to post
Share on other sites

It sound like your program is continously copying ST12:1 to ST12:20 so that when you 'reset the scan' ST12:1 is cleard and the cleared string is copied. If you can create a PDF printout of your program or at least this particular section we could look at it. (I only have the 'free' software and it can't operate with a Micrologix 1400 program.)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0