CLGX 5000 Binary to Decimal

zerokewl

Member
Join Date
Jul 2003
Location
in a apt
Posts
50
New to rslogix 5000. so forgive the simple questions.
I want to read a set of inputs as a binary into logix 5000?
Is there a special inst. set I can use?

Thank you
 
Yes, I have a 1796-IB16 on a 1794-Ethernet, I am reading all inputs from this module into logix 5000. what I am trying to do is read these as Binary or convert them to a decimal value from Binary. For example I have Inputs 7.0, 7.1,7.2 as 7.0 = 1, 7.1 = 2, 7.2 =4, so on, want to read the first 7 and display as Decimal code, almost like a mask move, I know the terminology but am not sure with the instructions.
Thanks for reading
 
unless I'm just misunderstanding what you're asking for, the MVM that you mentioned should do the trick (as shown in the attached figure) ... the tag shown as the Destination is a DINT ...

if not, then we need more detail ...

mvm.JPG
 
weird ... I just added that info as an "edit" - while you were "editing" to ask the question - that I was answering before you asked it ...
 
weird ... I just added that info as an "edit" - while you were "editing" to ask the question - that I was answering before you asked it ...

^^ Yes that is ironic! Here is what I am getting my TAG is a DINT,
reading the values correctly just having problems displaying.
Thanks for your time!

Mask.JPG
 
I'll check this out in the lab later today, but for now just try putting the 2# code in front of your mask entry ... my hunch is that the MVM thinks your mask is a "decimal" number - instead of a "binary" number ...

also, making your TESTID Destination an INT instead of a DINT might help ...

as I said, I'll check it later (I'm tied up on other projects right now) - but I'd bet (pocket change only) that the suggestions above will fix it up ...

edit: I just got some extra time - and mine is working with the 2# code in front of the mask ... using a DINT or an INT as the Destination isn't making any difference (one way or the other) on my setup ...

BUT ...

make SURE that any previous "test value" in your Destination has been set to all ZEROs before you use the MVM ... hint: the MVM won't reset any "unused" bits that have already been set to a ONE status by a previous "test run" ...
 
Last edited:
Thats what it was, Thanks Ron for all your help. You were correct on the MVM not resetting any "Unused" bits!
Put a 2# and created a whole new DINT Tag and it gave me the correct number right away, now I just need to
figure out how I can populate the destination with all Zero's before it re-scans again and I dont have the same issue!

Thanks once again, appreciate your time.
 
Last edited:
just use an MOV (Move) instruction to put a ZERO in the Destination box just BEFORE you do the MVM to rewrite the latest value ...

glad we were able to help ...
 
Or possibly, as discussed in another topic, just use the AND instruction. That may do what you want without the preliminary clearing of the destination.
 
1. Read the definition of the AND instruction in the instruction help.

2. Use it in palce of the MVM. The clearing of the target will not be necessary as the AND instruction will affect all the bits of the target.
 
I don't think an AND instruction will help here, because I am trying to get a decimal value out of a binary, and using a AND instruction will give me a different read when it changes my target numbering.
 

Similar Topics

Hi. I can find plenty of info on the NET-DNI connecting to a micrologix using the micrologix as slave IO with an SLC as the master but nothing...
Replies
1
Views
4,980
Situation: Single [EQU] instruction with single [OTE] on a rung, nothing else/simple. [EQU] operand(A) is a real number data type...
Replies
16
Views
2,601
I have a 1756-HYD02 card. Is properly configured with the LDT connected. card output is not connected to anything because the panel is in the...
Replies
7
Views
2,372
Hello, I am currently trying to change the scaling max output value in the logic of the above controller. It's under a DNET1_IO_Map Structured...
Replies
1
Views
1,640
On a job site where we swapped out an old SLC 5/03 and replaced with a Clgx. There is another SLC 5/03 that used to message to the SLC 5/03 via...
Replies
3
Views
1,538
Back
Top Bottom