Studio 5000 Make your own BCD?

LoganB

Lifetime Supporting Member
Join Date
Apr 2017
Location
Michigan
Posts
607
Studio 5000 v24.11 on a 1769-L33ERM

Pretty simple question today! I have a piece of testing hardware with four outputs wired to four inputs on my PLC. The testing hardware sends different BCD values to the PLC based on the test result. I want to convert those four inputs into an integer value in the PLC.

I know I can brute force it with 16 lines of logic, one for each possible outcome, but is there an easier/shorter/neater way to do this? Haven't had my coffee yet this morning :angr:

TIA!
 
BTW, I already tried to directly activate bits in a DINT and that didn't work.

Code:
   Input.0                        INT.0
-----]  [----------------------(  )-----------

The outputs don't activate...
 
However, upon further examination, the outputs DO activate once you put a JSR in place. :oops:

Now off to get that coffee
 
I am lost, are you done or still asking for another solution vs 16 rungs?

In case you need solution:
If input 16 bits, output 16 bits (INT) then use: COP (Input, Output, 1)
If input 16 bits, output 32 bits (DINT) then use: BTD (Input, 0, Output, 0, 16)
 
The inputs will directly activate the bits of the INT in the program, so I have my solution. I had my solution before, I just forgot the JSR. You'd think eventually that little mistake would go away with experience, but somehow it keeps on sneaking back into my life :ROFLMAO:
 

Similar Topics

Good Evening , I purchased Studio 5000 Standard a few weeks ago . I know Studio goes down only has far has version 20. I need to go down to...
Replies
8
Views
4,705
I recently did a program conversion from logix 500 to studio 5000 and when machine runs it depends on two ton instructions to keep the machine in...
Replies
16
Views
274
Hi Everyone. Not posted on here for a long time, but I am hoping someone can help me. I am doing a differential pressure calculation in a L27ERM...
Replies
16
Views
381
Hi, how do I convert 2x Integer registers to a Real? The two integers are from Modbus registers that contain a floating point value, I need to...
Replies
2
Views
129
Back
Top Bottom