JJH
Member
Hey all,
I've reviewed many threads regarding converting one data type to another and I have something I'm working on that I'm stumped on and haven't found an answer for yet.
Without getting into the details, I need to get a DINT bit value from an entered decimal value. A user will enter in a whole number in an entry box and then it needs to get converted to the number of whatever number of bits that the number holds in a DINT. For instance:
# Entered Variable Bit value
------0----------------0
------1----------------1
------2----------------3
------3----------------7
------4---------------15
etc....
I'm looking for a fairly clean way to do this, with perhaps just two or three instruction blocks to handle it, if possible.
I can provide a screenshot of the HMI and the logic (4 rungs) if necessary.
Any suggestions or advice the group can provide would be greatly appreciated!
I've reviewed many threads regarding converting one data type to another and I have something I'm working on that I'm stumped on and haven't found an answer for yet.
Without getting into the details, I need to get a DINT bit value from an entered decimal value. A user will enter in a whole number in an entry box and then it needs to get converted to the number of whatever number of bits that the number holds in a DINT. For instance:
# Entered Variable Bit value
------0----------------0
------1----------------1
------2----------------3
------3----------------7
------4---------------15
etc....
I'm looking for a fairly clean way to do this, with perhaps just two or three instruction blocks to handle it, if possible.
I can provide a screenshot of the HMI and the logic (4 rungs) if necessary.
Any suggestions or advice the group can provide would be greatly appreciated!