Chapter 8 High-speed counter, PWM / Pulse train output and Analogue I/O

8.8 Potentiometers

CPUs other than of the 10-point type are equipped with two potentiometers. Through the use of these potentiometers, it becomes possible to change values in the special internal outputs from the outside using a tool that looks like a screwdriver. The resolution is 10 bits, so it is possible to adjust the values from 0 to 3FFH (1 to 1,023).

The potentiometers are found under the cover on the left side of the main unit. The value becomes larger when the dial is turned clockwise and smaller when turned counterclockwise. In addition, this value is always stored in the special internal output, regardless of whether the CPU is operating or stopped.

VR1VR2

LH LH

Figure 8.39 Potentiometers

(1)Values of the potentiometers

The values entered by means of the potentiometers are stored in the following special internal outputs.

WRF03E:

WRF03F:

Potentiometer 1 input value

Potentiometer 2 input value

Figure 8.40 Potentiometer input value storage special internal output

(2)Setting a filter for the potentiometer

The input values of the potentiometers fluctuate depending on the operating environment of the main unit etc. If the ratio of fluctuation is to be reduced, a sampling number can be set in the following special internal output. Once the sampling number is set, the average of the data obtained in the time period determined by the sampling number calculated by internal processing is set in WRF03E and WRF03F.

The sampling number can be set between 0 and 40 (0 to 28H). If 0 is set, the data without average is stored in WRF03E and WRF03F. If a value greater than 41 is set, the sampling number is treated as 40.

WRF06C:

 

Potentiometer 1 data sampling number

 

 

 

 

 

 

 

 

WRF06D:

 

Potentiometer 2 data sampling number

 

 

 

 

 

 

 

Figure 8.41 Special internal output for setting input data sampling number

This special internal output is stored in the FLASH memory by turning on various setting write requests (R7F6). Once it is stored in the memory, it is not necessary to set the value again when the power is turned on for the next time.

(3)Example

The following shows a simple ladder program using the potentiometers:

WR0

==

0

WR0

==

1F

WR0

==

3F

WR0 = WRF03E

 

1]

Always substitute the value of potentiometer 1 to

LSR(WR0,4)

 

 

WR0.

 

 

2]

Delete the lower four bits of WR0 (because lower

 

 

 

four bits are more prone to error due to changes in

 

 

 

 

Y100

resistance caused by temperature, etc.)

 

3]

If WR0 is “0,” Y100 is turned on.

 

Y101

 

 

4]

If WR0 is 1F, Y101 is turned on.

 

Y102

 

 

5]

If WR0 is 3F, Y102 is turned on.

By turning potentiometer 1, one of flags Y100 to Y102 turns on.

8-22

Page 231
Image 231
Hitachi NJI-350B manual Potentiometers