BECKHOFF KL3361, KL3362: Data |
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: Unprocessed 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 revision level
Register R9 contains the firmware revision level of the terminal in hexadecimal coding, e. g. 0x3144 (12612 dec).
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.
A restart will reset the code word.
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 centre of the recording. | |||
011bin | FastSampling (from firmware version 1B'): Operation with increased sampling rate of up to 10µs.
|
|||
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
Example 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).
Note | 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. |
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
- KL3361 is assigned process data register DataOUT0
- KL3362 is assigned process data register DataOUT0 (channel 1) or process data register DataOUT0 (channel 2)
The decimal value of the index corresponds to the register number of the parameter to be written.
The following indices are supported:
Index | Decimal | Parameters |
---|---|---|
0x00 | 00 | Default value |
0x29 | 41 | Trigger Unit 1, Threshold 1 |
0x2A | 42 | Trigger Unit 1, Threshold 2 |
0x2B | 43 | Trigger Unit 1, Pulse width |
0x2C | 44 | Trigger Unit 1, Valid Trigger Time |
0x2F | 47 | Trigger Unit 2, Threshold 1 |
0x30 | 48 | Trigger Unit 2, Threshold 2 |
0x31 | 49 | Trigger Unit 2, Pulsewith |
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
- KL3361 is assigned process data register DataOUT1
- KL3362 is assigned process data register DataOUT1 (channel 1) or process data register DataOUT1 (channel 2)
(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
- DataIN0 of oscilloscope terminal KL3361
- DataIN0 (channel 1) or DataIN0 (channel 2) of oscilloscope terminal KL3362
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: threshold level is trigger level 1
|
0x0008 | 8 |
Pulse width - low: threshold level is trigger level 1
|
0x0009 | 9 | Mark/space ratio |
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 threshold level 1 |
0x0015 | 21 | Number of samples up to analog value less than threshold level 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
- DataIN1 of oscilloscope terminal KL3361
- DataIN1 (channel 1) or DataIN1 (channel 2) of oscilloscope terminal KL3362
(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 enabled if signal at first analog input above threshold level 2 | First analog input is for | |||
010bin | Trigger enabled if signal at first analog input below threshold level 2 | ||||
011bin | Trigger enabled if signal at second analog input above threshold level 2 | Second analog input is for
|
|||
100bin | Trigger enabled if signal at second analog input below threshold level 2 | ||||
101bin | Trigger enabled if trigger input (24V trigger) on high potential. | ||||
110bin | Trigger enabled if trigger input (24V trigger) on low potential. | ||||
R40.11, R40.10 |
TriggerSource | 00bin | Timer with threshold level 1 | 11bin | |
01bin | First analog input (IN1), with threshold level 1 | ||||
10bin | Second analog input (IN2), with threshold level 1 (KL3362 only) | ||||
11bin | Digital input | ||||
R40.9, R40.8 |
TriggerMode | 00bin | Shot: The trigger is triggered with an edge of the bEnableTrigger bit of the control byte (CB1.0), if it is enabled via enableSource. | 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 by bit 2 of the 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, threshold level 1
Threshold level for the trigger source (TriggerSource) of trigger unit 1
R42: Trigger unit 1, threshold level 2
Threshold level 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! Example:
- 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! Example:
- - Sample rate: Ts = 200 µs
- - Valid samples: nVS=100
Valid Trigger Time: tVT = Ts x nVS =200 µs x 100 = 20 ms
R45:
reserved
R46: Trigger unit 2, trigger logic
R47: Trigger unit 2, threshold level 1
Threshold level for the trigger source (TriggerSource) of trigger unit 2
R48: Trigger unit 2, threshold level 2
Threshold level 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
R51:
reserved
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! Example: 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. Examples: | - | |
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. |