![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/3/8d/38d56254-54fe-46e3-85ae-d3f5260e1091/38d56254-54fe-46e3-85ae-d3f5260e1091-bg15a.png)
FX Series Programmable Controllers Points Of Technique 10
10-6
10.8 Reading And Manipulating Thumbwheel Data
Data can be easil
read into a pro
rammable controller throu
h the use of the BIN instruction.
When data is read from multiple sources the data is often stored at different locations. It ma
be required that certain data values are combined or mixed to produce a new value.
Alternativel
, a certain data di
it ma
need to be parsed from a lar
er data word. This kind of
data handlin
and manipulation can be carried out b
usin
the SMOV instruction. The
example below shows how two data values (a sin
le di
it and a double di
it number) are
combined to make a final data value.
Explanation:
The two BIN instructions each read in one of the data values. The first value, the sin
le di
it
stored in D1, is combined with the second data value D2 (currentl
containin
2 di
its). This is
performed b
the SMOV instruction. The result is that the contents of D1 is written to the third
di
it of the contents of D2. The result is then stored back into re
ister D2.
10.9 Measuring a High Speed Pulse Input
10.9.1 A 1 msec timer pulse measurement
Some times due to s
stem requirements or even
as a result of maintenance activities it is
necessar
to 'find out' how lon
certain input
pulses are lastin
for. The followin
pro
ram
utilizes two interrupt routines to capture a pulse
width and measure it with a 1 msec timer. The
timer used in the ample is one of the FX timers.
However, T63 on the FX0N would be used for a
similar situation on that PLC.
Explanation:
The 1 msec timer T246 is driven when interrupt
I001 is activated. When the input to X1 is
removed the current value of the timer T246 is
moved to data re
ister D0 b
interrupt pro
ram
I100. The operation complete fla
M0 is then set
ON.
Note: X10 acts as an enable/disable fla
.
M8000
SMOV D1 K1
BIN
K1
K2X20 D2
BIN K1X0 D1
D2 K3
657
X0 to X3 X20 to X27
D2 = 65
D1=7
D1- D2 D2=765
10
0
1
0
Digit
10
10
Digit
SMOV
FX prpgrammable
controller
X 10
S (X0, X1)
X 0 X 1
FEND
M8000
RST T246
X10
RST M 0
RST D 0
IRET
X10
D 0MOV T246
SET M 0
M0
K1
RST T246
M8000
IRET
END
I001
I100
T246
K32767
T246
General wiring-pluse
to be measured is
connected to both X0
and X1
Pulse to be
measured
EI instruction
MUST be
included in main
program
Pulse has been
measured
1 msec timer-
FX
0N
use T63
Measured time
stored inD0