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,673
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
87
What is the best way to extract the hour and minute from the register that comes from Yaskawa VFD. In studio 5000 I have a register saved as INT...
Replies
3
Views
94
I have an Allen Bradley temperature switch that I am trying to use in studio 5000. I am getting the message "Unable to interpret the IODD file"...
Replies
0
Views
60
Hi all. I want to ask what may seem a stupid question, as I have a project to send live data to a Yeacode line printer which will print meterage...
Replies
8
Views
158
Back
Top Bottom