Register description

The following registers exist for each signal channel of the oscilloscope terminal. This means these registers exist

  • once on the single-channel KL3361;
  • twice on the two-channel KL3362.

R0: Raw ADC value

Raw value of the analog/digital converter.

R6: Diagnostic register

In a later firmware version, the diagnostic register will be used to provide diagnostic information about the state of the oscilloscope terminal.

R7: Command register

This register can be used to transfer commands to the oscilloscope terminal.

Commands

Command 0x0201: WriteEnvCurvToRAM

Writes the sampling values into the RAM envelope curve (Teach-in method).
Return value: 0x201

Command 0x0202: WriteEnvCurvToFLASH

Writes the sampling values into the RAM envelope curve and the flash envelope curve (Teach-in method).
Return value: 0x202

ROM register

The terminal uses two channels for assigning a byte/word/word data structure. This structure is not supported by couplers that do not have the BK200 switch functionality. In this case, read access to the second register set is not available.

The terminal always reports with a shift register length of 5 bytes (see general terminal documentation).

R8: Terminal description

Register R8 contains the terminal identifier in hexadecimal coding:
KL3361: 0x0D21 (3361dec)
KL3362: 0x0D22 (3362dec)

R9: Firmware version

Register R9 contains the firmware revision level of the terminal in hexadecimal coding, e. g. 0x3144 (12612dec).

R10: Shift register length

KL3361: 0x0128
KL3362: 0x0228

R11: Number of signal channels

KL3361: 0x0128
KL3362: 0x0228

R12: Minimum data length

KL3361: 0x2828
KL3362: 0x2828

R13: Data type

Register R13 contains the data type of the Bus Terminal. 0x0004 means analog input.

R15: Alignment register

R16: Hardware version number

Register R16 contains the hardware revision level of the terminal in hexadecimal coding, e.g. 0x0000 (0dec).

User register

The user registers of the oscilloscope terminal can be written by the user program in order to change the characteristics of the oscilloscope terminal at run-time.

R31: Code word register

  • If you write values into the user registers without previously having entered the user code word (0x1235) in the code word register, these values are only stored in the RAM registers, but not in the EPROM registers and are therefore lost if the terminal is restarted.
  • If you write values into the user registers and have previously entered the user code word (0x1235) in the code word register, these values are stored in the RAM registers and in the EPROM registers and are therefore retained if the terminal is restarted.

The code word is reset if the terminal is restarted.

R32: Feature register

The feature register specifies the terminal's operating mode.

Bit

Operation mode

Value

Explanation

Default

R32.15

-

-

reserved

0bin

...

-

-

reserved

0bin

R32.11

-

-

reserved

0bin

R32.10
R32.9
R32.8

Trigger type

000bin

Post-trigger. Recording commences as soon as a trigger event occurs.

000bin

001bin

Pre-trigger. Recording ceases as soon as a trigger event occurs.

010bin

Mid-trigger: The trigger event is the center of the recording.

011bin

FastSampling (from firmware version 1B'): Operation with increased sampling rate of up to 10 µs.

  • The recording can only be started via the trigger input.
  • The settings of the trigger units are not taken into account.
  • Only the first channel is recorded, even for KL3362.

R32.7

-

-

reserved

0bin

R32.6

Auto trigger

0bin

not active

0bin

1bin

active: The trigger unit is automatically activated once the preceding event has been evaluated. To this end, bit 0 is toggled in status byte 1 (SB1) with each new evaluation.

R32.5

Test mode

0bin

not active

0bin

1bin

active: The oscilloscope terminal simulates a ramp of sampling values. The sampling value is incremented after each reading. The ramp thus runs from 0x0000 to 0x3FFF. From 0x3FFF, the sampling value after each reading is decremented, so that the ramp returns to 0x0000. The process is repeated cyclically.

R32.4

Trigger delay

0bin

not active

0bin

1bin

active: Samples skipped after the trigger event. The number of samples that are skipped is specified in the Trigger delay register (R52).

R32.3

-

-

reserved

0bin

...

-

-

reserved

0bin

R32.0

-

-

reserved

0bin

R33: User offset

Offset, can be changed by the user. Scaling:
offset = full scale value x parameter / resolution

Sample for KL3361: 16 mV x 100 / 32767 = 0,049 mV

R34: User gain

Gain factor, can be changed by the user.

R35: Sample rate

Interval (Ts) between two samples (scans) in microseconds.
The sampling speed is limited to Ts =100 µs (10 kHz) by the evaluation of the trigger detectors.
Only the Fast sampling mode enables sampling at Ts =10 µs (100 kHz).

Data transfer rate on the K-bus

The sample rate influences the transmission speed with which the oscilloscope terminal can be addressed by the K-Bus.
This must be taken into account when considering your PLC cycle time:

  • A sample rate of 100 µs can only accommodate bus cycles with a minimum duration of 3 ms!
  • A sample rate of 150 µs can only accommodate bus cycles with a minimum duration of 2 ms!
  • The Fast sampling mode can only accommodate K-bus cycles with a minimum duration of 2 ms!

R36: Sample amount

Number of sampling values to be recorded. A maximum of 4,000 values can be recorded (default 100).

R37: Index register for output data (terminal parameters)

  • Low byte:
    The content of the Low byte of this register determines which parameter of the oscilloscope terminal
  • is described. The decimal value of the indices corresponds to the register number of the parameter to be written.

The following indices are supported:

Index

Decimal

Parameter

0x00

00

Default value

0x29

41

Trigger unit 1, switching threshold 1

0x2A

42

Trigger unit 1, switching threshold 2

0x2B

43

Trigger unit 1, pulse width

0x2C

44

Trigger unit 1, valid trigger time

0x2F

47

Trigger unit 2, switching threshold 1

0x30

48

Trigger unit 2, switching threshold 2

0x31

49

Trigger unit 2, pulse width

0x32

50

Trigger unit 2, valid trigger time

  • High byte:
    The content of the High byte of this register determines which parameter of the oscilloscope terminal
  • is described (see Low byte for indices).

R38: Index register 1 for input data

The content of this register (default value: 0x0000) determines which date is shown in the process data register

The following indices are supported:

Index

Decimal

Date

0x0000

0

Current analog value

0x0001

1

Maximum value of a recording

0x0002

2

Minimum value of a recording

0x0003

3

RMS value of the recording: Sqrt((Sum (xn2))/n

0x0004

4

Mean value of the recording: (Sum (xn))/n

0x0005

5

Peak-peak value of the recording

0x0006

6

Cycle duration

0x0007

7

Pulse width - high: switching threshold is trigger level 1

  • The trigger starts as soon as four successive values are above the switching threshold
  • The trigger is stopped as soon as four successive values are below the switching threshold

0x0008

8

Pulse width - low: switching threshold is trigger level 1

  • The trigger starts as soon as four successive values are below the switching threshold
  • The trigger is stopped as soon as four successive values are above the switching threshold

0x0009

9

Duty factor

0x000A

10

reserved for jitter Tmax

0x000B

11

reserved for jitter Tmin

0x000C

12

reserved for jitter Tmean

0x000D

13

Histogram max, i.e. the value that has occurred most frequently.

0x000E

14

Timer1LatchValue

0x000F

15

Timer1Run (read/write)

0x0010

16

Timer2LatchValue 

0x0011

17

Timer2Run (read/write)

0x0012

18

Error counter inner envelope curve

0x0013

19

Error counter outer envelope curve

0x0014

20

Number of samples up to analog value greater than switching threshold 1

0x0015

21

Number of samples up to analog value less than switching threshold 1

0x8000 

 

First sampling value.
The recorded sampling values are available from here. The MSB has to be set to zero in order to determine the trace offset.

0x8001 

 

Second sampling value.

0x8002 

 

Third sampling value.

...

...

...

0x8063

 

Hundredth sampling value (in the delivery state, 100 values are stored).

...

...

...

0x8F9F

 

Four thousandth sampling value (a maximum of 4,000 values can be stored).

R39: Index register 2 for input data

The content of this register (default value: 0x8010) determines which date is shown in the process data register

(see Index register 1 for process input data for indices).

R40: Trigger unit 1, trigger logic

Bit

Operation mode

Value

Explanation

Default

R40.15

-

-

reserved

0bin

R40.14,
R40.13,
R40.12

enableSource

000bin

Trigger always enabled

000bin

001bin

Trigger activated, if signal at analog input 1 above switching threshold 2

Analog input 1 is in

  • KL3361: the input for differential voltage of the measuring bridge in KL3361 (UB+/UB-)
  • KL3362: oscilloscope input channel 1 (IN 1)

010bin

Trigger activated, if signal at analog input 1 below switching threshold 2

011bin

Trigger activated, if signal at analog input 2 above switching threshold 2

Analog input 2 is in

  • KL3361 not available
  • KL3362: oscilloscope input channel 2 (IN 2)

100bin

Trigger activated, if signal at analog input 1 below switching threshold 2

101bin

Trigger enabled if trigger input (24 V trigger) on high potential.

110bin

Trigger enabled if trigger input (24 V trigger) on low potential.

R40.11,
R40.10

TriggerSource

00bin

Timer with switching threshold 1

11bin

01bin

first analog input (IN1), with switching threshold 1

10bin

second analog input (IN2), with switching threshold 1 (KL3362 only)

11bin

Digital input

R40.9,
R40.8

Trigger mode

00bin

Shot: The trigger is activated with an edge of bit bEnableTrigger of control byte 1 (CB1.0), if enableSource is set.

01bin

01bin

Edge: The trigger is triggered via the edge selected via TriggerSource and bLogic, if it is enabled via enableSource.

10bin

Glitch: The trigger is triggered via the pulse selected via TriggerSource, bLogic and bLarger, if it is enabled via enableSource.

R40.7

-

-

reserved

0bin

R40.6

bTriggerWinEn

1bin

The trigger condition for the following trigger unit must arrive within the valid trigger time for trigger unit 1. Otherwise everything is reset

0bin

R40.5

bStartScopeRec

0bin

The trigger event causes the downstream trigger unit to be enabled

0bin

1bin

The trigger event causes the recording to be started

R40.4

bTriggerOutEn

1bin

The trigger event causes the digital output to be set, if this is enabled through bit 2 of control byte 1 (CB1.2).

0bin

R40.3

bLatchtimer

1bin

The trigger event causes the current value of the running timer to be stored.

0bin

R40.2

bResetTimer

1bin

The trigger event causes the timer to be reset to zero. The timer will start running again automatically immediately.

0bin

R40.1

bLarger

0bin

in glitch mode: pulse width less than the pulse width specified for trigger unit 1

0bin

1bin

in glitch mode: pulse width greater than the pulse width specified for trigger unit 1

R40.0

bLogic

0bin

in edge mode (edge triggering): falling edge

in glitch mode: negative pulse

1bin

1bin

in edge mode (edge triggering): rising edge

in glitch mode: positive pulse

R41: Trigger unit 1, switching threshold 1

Switching threshold for the trigger source of trigger unit 1

R42: Trigger unit 1, switching threshold 2

Switching threshold for enabling the trigger (EnableSource) of trigger unit 1

R43: Trigger unit 1, pulse width

Here you can specify the pulse width (tP) of trigger unit 1 for the glitch mode. The number of samples (nSP) is entered as the parameter. The pulse width thus depends on the sample rate! Sample:

  • Sample rate: Ts = 200 µs
  • Samples: nSP = 100

Pulse width: tP = Ts x nSP = 200 µs x 100 = 20 ms

R44: Trigger unit 1, valid trigger time

Here you can specify the valid trigger time (tVT) for trigger unit 1. The number of valid samples (nVS) is entered as the parameter. The valid trigger time thus depends on the sample rate! Sample:

  • Sample rate: Ts = 200 µs
  • Valid samples: nVS=100

Valid Trigger Time: tVT = Ts x nVS =200 µs x 100 = 20 ms

R46: Trigger unit 2, trigger logic

see Trigger detector 1

R47: Trigger unit 2, switching threshold 1

Switching threshold for the trigger source (TriggerSource) of trigger unit 2

R48: Trigger unit 2, switching threshold 2

Switching threshold for enabling the trigger (EnableSource) of trigger unit 2

R49: Trigger unit 2, pulse width

Here you can specify the pulse width (tP) of trigger unit 2 for the glitch mode (see Trigger unit 1, pulse width).

R50: Trigger unit 2, valid trigger time

see Trigger unit 1, valid trigger time

R52: Trigger delay

A trigger delay (tTD) can be specified here. The number of skipped samples (nSTD) is entered as the parameter. The trigger delay thus depends on the sample rate! Sample: - Sample Rate: Ts = 200 µs, - Skipped Samples:  nSTD=100
tTD = Ts x nSTD = 200 µs x 100 = 20 ms

R53: Parameter 1 envelope curve

e.g. distance of the inner envelope curve
After the trace recording, the envelope curve is evaluated.

R54: Parameter 2 envelope curve

e.g. distance of the outer envelope curve
After the trace recording, the envelope curve is evaluated.

R55: Samples envelope curve

Number of samples to be evaluated (512 max.).

R56: Trigger frequency

Frequency of the timer that can be used for triggering.

R60: Trace data register 1

Contains the sampling value from the register specified in the trace index register (R62).
After the end of the read access (change of register address), the trace index (R62) is incremented by the zoom distance nZ (see R63).

R61: Trace data register 2

Contains the sampling value from the register following the register specified in the trace index register (R62).
After the end of the read access (change of register address), the trace index (R62) is incremented by the zoom distance nZ (see R63).

R62: Trace index register

Writing: Sets the trace index to offset
Reading: Current value of the trace index.

The index is reset to zero at the start of a recording.
Offset zero to 0x3FFF contains the trace data.
From 0x8000, the envelope curve is given

R63: Zoom register

With the zoom register you can specify that

  • only certain values or
  • pre-processed values (maximum value , minimum value or arithmetic mean value)

are transferred to the control.

Bit

Name

Value

Explanation

Default

R63.15
R63.14

Zoom mode

00bin

Sample zoom - the trace index register is increased automatically after each reading by the zoom distance nZ. Therefore, only every nZth value is read.

-

01bin

Max zoom - the highest of the read values is output

10bin

Min zoom - the lowest of the read values is output

11bin

Mean value zoom - the arithmetic mean of the read values is output

R63.13
R63.12

-

-

reserved

-

R63.11

...

R63.0

Zoom distance nZ

Number nZ of sampling values, by which the trace index register (R62) is increased in zoom mode Sample zoom after each reading. Samples:

-

0x000

The same value is always read.

0x001

All values are read.

0x002

Only every second value is read.

0x00A

Only every tenth value is read.