How to calculate the decimal value of thumbwheel bool input?

wqtony2004

Member
Join Date
Apr 2015
Location
melbourne
Posts
13
hi, guys. I am using the Siemens setp 7. I have a thumbwheel input in the panel, which has four bit input all boolean ones? How can I get the decimal value of this wheel input, thanks a lot! PLZ help me- a new leaner of PLC.
 

Thank you first, i have already read this thread, but i am a new leaner I still can not quite follow Ron Beaufort's meaning.When i check the input i found that my thumbwheel has 4 boolean input with their address fixed in I137.3,I137.2,I137.1,I137.0 repectively. The situation sames different mentioned in the thread you offered, coz they are dealing with binary input,though the value is same but the format of value is different, right?
So, is there any way i can access my thumbwheel input and get a decimal value?
 
.. or another..
First, thanks for your help ,LD.:D
I still have some questions.
In the first figure you offer, is there any possible the initial instruction will be implemented after other bit instruction? If not, is it because the program scan is top down, so it will always implement the top instruction first?

In the second figure, do you mean we use a word 'AND' instruction between 4 bit thumbwheel input and 'FF', and then we get the decimal output? what if there are some random '1' in the high bit of word I137?
 
In the first figure you offer, is there any possible the initial instruction will be implemented after other bit instruction? If not, is it because the program scan is top down, so it will always implement the top instruction first?

No and yes.
 
In the second figure, do you mean we use a word 'AND' instruction between 4 bit thumbwheel input and 'FF', and then we get the decimal output? what if there are some random '1' in the high bit of word I137?

The AND is with F, not FF so the high bits of byte IB137 are masked to zero.
 
I think the OP is referring to the fact that I am moving a byte to a word. The screen shot is from my Step 7 program so yes it can be implemented.
 

Similar Topics

Hi everyone, This is my first time posting, so please forgive any omissions or mistakes. I am attempting to control the velocity of a stepper...
Replies
18
Views
1,063
Good morning, I have a question. I don't know much about ST yet I would like to calculate the average number of products per hour. how do I do...
Replies
22
Views
2,983
Can someone help me with this? I'm no good at SCL - virtually everything I've done so far has been ladder logic. The return value from the...
Replies
13
Views
1,119
I want to calculate the energy consumed from instantaneous power. Can this be done using the TOT block with timebase set to Hour?
Replies
2
Views
701
Hi everyone, I have to calculate the length in millimeters of a glass that enters a transport (I don't know the speed yet) through a barrier...
Replies
15
Views
3,474
Back
Top Bottom