these are bitinstructions.LD I0.0
LD I0.1
LD I0.2
LD I0.3
=
this is a wordaddress without instruction, therefor it does nothing.VW10
LD SM0.0 //Do always
MOVB IB0, VB10 //copy input byte 0 to variable byte 10
ANDB 16#F, VB10 //mask out all but 4 lowest bits
+---------+
SM0.0 | WAND_B|
--| |--------|EN |
| |
IB0 -|IN1 |
| |
16#F -|IN2 OUT|- VB10
+---------+
Shortest way is to perform a masked move (lowest 4 bits) from inputbyte 0 to variable byte 10. S7-200 does not have a masked move, but you can perform an bitwise AND function. The solution should look like this:
LD SM0.0 //Do always
MOVB IB0, VB10 //copy input byte 0 to variable byte 10
ANDB 16#F, VB10 //mask out all but 4 lowest bits
or in ladder:
+---------+
SM0.0 | WAND_B|
--| |--------|EN |
| |
IB0 -|IN1 |
| |
16#F -|IN2 OUT|- VB10
+---------+