© Siemens Ⓟ2011
A5E03696579-01, 10/2011 1
SIMATIC
S7-300
Product information for the S7-300 Automation System
Manual, Module Data
Product Information
Introduction
The present product information describes additions and corrections to the S7-300 Automation System Manual, Module
Data, issued 03/2011 online (http://support.automation.siemens.com/WW/view/en/8859629).
Digital input module SM 321; DI 16 x DC 24 V; with hardware and
diagnostic interrupts, isochronous
Order number: "Standard module"
6ES7321-7BH01-0AB0
Order number: "SIPLUS S7-300 module"
6AG1321-7BH01-2AB0
Properties
TheSM 321; DI 16 x DC 24 V; with hardware and diagnostic interrupts are distinguished by the following features:
16 inputs, electrically isolated in groups of 16
Rated input voltage 24 VDC
Input characteristics to IEC 61131, Type 2
suitable for switches and 2- /3-/4-wire proximity switches (BEROs)
2 short circuitproof sensor supplies for each group of 8 channels
external redundant sensor supply is supported
"Sensor supply (Vs)" status display
Group error display (SF)
Supports isochronous mode
Supports parameter reassignment in RUN
Programmable diagnostics
Programmable diagnostic interrupt
Programmable hardware interrupts
Programmable input delays
High-feature operation (HF operation)
From product class ES06, the module supports
channel-granular diagnostics
and
channel-granular hardware interrupts.
Product information for the S7-300 Automation System Manual, Module Data
2 A5E03696579-01, 10/2011
Requirements for the HF operation
If the following requirements are met, the module will work in HF operation:
Distributed operation in conjunction with a High-Feature interface module with:
PROFIBUS, as of IM153-2BAx2-0XB0
PROFINET, as of IM153-4BA00-0XB0
Configured as of STEP7 V5.5+SP1+Hotfix 1 and/or SIMATIC process control system PCS 7 as of V8.0
as "SM 321 DI16xDC24V, Alarm, HF"
or
Configured using the corresponding GSD file with:
PROFIBUS as "6ES7321-7BH01-0AB0 HF 16DE"
PROFINET as "SM 321 DI16xDC24V HF".
Note
If the SM 321 is not configured as a "HF" module from ES06, then it functions compatible with earlier product classes
and does not support channel-granular diagnostics or channel-granular hardware interrupts.
Wiring and block diagrams of SM 321; DI 16 x DC 24 V
6)
9V
9V
 9V
9V
/
/
/










9
0
0
Channel number
Status displays - green
Error displays - red
Sensor supply VS -green
Backplane bus interface
Wire-break detection
Product information for the S7-300 Automation System Manual, Module Data
A5E03696579-01, 10/2011 3
Wiring diagram of the redundant sensor supply
The figure below shows how an additional redundant voltage source can be used to power sensors using Vs.
VKLUWFLUFXLWSURRI
GULYHU
'LJLWDOLQSXW
PRGXOH
WRWKHVHQVRUV
9V
/
/
0
/
Figure 1 Wiring diagram of the redundant supply of sensors of SM 321; DI 16 x DC 24 V
Wiring diagram of the shunt circuit of the sensors
For wire-break detection, it is necessary to connect a shunt resistor to the transducer contacts.
([[
/9
V
NവNവ
Technical specifications of SM 321; DI 16 x DC 24 V
Technical specifications
Dimensions and weight
Dimensions W x H x D (mm) 40 x 125 x 117
Weight ca. 200 g
Module-specific data
Supports isochronous mode yes
Supports parameter reassignment in RUN yes
Response of non-programmed inputs return the process value which was valid before
configuration
Number of inputs 16
Cable length
unshielded
shielded
max. 600 m
max. 1000 m
Voltages, currents, electrical potentials
Rated supply voltage L+ for the electronic system and sensors 24 VDC
Reverse polarity protection yes
Number of simultaneously controlled inputs
horizontal mounting position
to 60 °C
16
vertical mounting position
to 40 °C
16
Electrical isolation
between channels and the backplane bus
between channels
In groups of
yes
16
Maximum potential difference
between different circuits 75 VDC / 60 VAC
Isolation test voltage 500 VDC
Product information for the S7-300 Automation System Manual, Module Data
4 A5E03696579-01, 10/2011
Technical specifications
Current consumption
from the backplane bus max. 130 mA
from load voltage L + (without sensor supply VS) max. 90 mA
Power loss of the module typ. 4 W
Status, interrupts, diagnostics
Status display
Inputs
green LED per channel
Sensor supplies (Vs) green LED per output
Interrupts
Hardware interrupt
Diagnostic interrupt
programmable
programmable
Diagnostic functions programmable
Group error display red LED (SF)
Reading diagnostic information supported
Monitoring for
wirebreak
yes, sensing I < 1 mA
Sensor supply outputs
Number of outputs 2
Output voltage
on load
min. L+ (- 2.5 V)
Output current
Rated value
Permitted range
120 mA
0 mA to 150 mA
Additional (redundant) supply supported
Short-circuit protection yes, electronic
Sensor selection data
Input voltage
Rated value
"1" signal
"0" signal
24 VDC
13 V to 30 V
-30 V to + 5 V
Input current
"1" signal
typ. 7 mA
Input characteristics to IEC 61131, type 2
Connection of 2-wire BEROs
Permissible quiescent current
supported
max. 2 mA
Wiring the signal transducers using a 20-pin front connector
Shunt circuit of the sensor for wire-break detection 10 kohms to 18 kohms
Time/frequency
Internal preparation time for diagnostics (in non-isochronous mode)
Enabling of process and diagnostic interrupts
max. 40 ms
Input delay
programmable
Rated value
yes
typ. 0.1/0.5/3/15/20 ms
Product information for the S7-300 Automation System Manual, Module Data
A5E03696579-01, 10/2011 5
Isochronous mode
Properties
Reproducible reaction times (i.e. of the same length) are achieved in a SIMATIC system by means of a constant DP bus
cycle, and synchronization of the single cyclic processes outlined below:
Independent user program cycle. The length of the cycle time may vary due to non-cyclic program branching.
Independent and variable DP cycle on the PROFIBUS subnet
Cyclic operation of the backplane bus of the DP slave.
Cyclic signal conditioning and conversion at the electronic modules of the DP slave.
The constant DP cycle runs in synchronism and at the same length. The CPU run levels (OB61 to OB64) and isochronous
IO are synchronized with this cycle. I/O data are therefore transferred at defined and constant intervals (isochronous mode.)
Requirements
The DP master and slave must support isochronous mode. STEP 7 V5.2 or higher.
Operating mode: Isochronous mode
Conditions of isochronous mode:
Filtering and processing time TWE between reading actual values and writing these to the
transfer buffer(the value defined for TWE applies, irrespective of the enable status of diagnostics)
255 μs to 345 µs
includes an input delay time of 100 µs
TDPmin 2.5 ms
Diagnostic interrupt max. 4 x TDP
Note
In "isochronous" mode, the input delay is automatically set to 100 μs, regardless of the input delay setting in STEP 7
Further information
For further information on the isochronous mode, refer to STEP 7 Online Help, in the operating instructions ET 200M
Distributed IO System (http://support.automation.siemens.com/WW/view/en/1142798) and Isochronous Mode
(http://support.automation.siemens.com/WW/view/en/15218045) in the manual.
Product information for the S7-300 Automation System Manual, Module Data
6 A5E03696579-01, 10/2011
SM 321; DI 16 x DC 24 V - Parameters
The table below shows an overview of configurable parameters and their default settings for SM 321; DI 16 x DC 24 V.
The default settings apply if you have not set any parameters in STEP 7.
Table 1 Parameter of the SM 321; DI 16 x DC 24 V
Parameters Range of values Default Parameter type Scope Scope in HF
operation
Enable
Diagnostic interrupt
Hardware interrupt
yes/no
yes/no
no
no
dynamic
Module
Module
Input delay/
voltage type
0.1 ms (DC)
0.5 ms (DC)
3 ms (DC)
15 ms (DC)
20 ms (DC/AC)
(DC) static Module Module
Diagnostics
Missing sensor supply
yes/no
no
static
Channel group
(8 channels)
Channel group
(8 channels)
Wire break yes/no no static Channel group
(2 channels)
channel-
granular
Hardware interrupt trigger
Positive edge
yes/no
no
dynamic
Channel group
(2 channels)
channel-
granular
Negative edge yes/no no dynamic Channel group
(2 channels)
channel-
granular
Allocating the sensor supplies to channel groups
The module's two sensor supplies power the two channel groups: Inputs 0 to 7 and inputs 8 to 15. You also configure
diagnostics for the sensor supply at these channel groups.
Assigning interrupt parameters to channel groups
Diagnostics of missing sensor supply:
The diagnostic interrupt can be set to each 8 channels in channel groups. If there is a fault with the sensor supply, then the
diagnostics interrupt will be reported to all channels/channels groups concerned.
Diagnostics interrupts in the event of wire breaks:
In "HF operation" of the SM 321, the diagnostics interrupt can be programmed channel-granularly. If a wire break is
registered, it is reported to the corresponding channel.
If the SM 321 is not working in "HF operation", the diagnostics interrupt in channel groups is programmed and reported to
each 2 channels. The 16 channels of the SM 321 are compiled into 8 channel groups (0 ... 7). This means, for example, that
one diagnostic interrupt is reported for any wire break diagnostic interrupt in channel group 3 (channel 6 and 7), so for any
wire breaks in either channel 6 or 7.
Hardware interrupt (triggered by negative, positive or both edges):
In "HF operation" of the SM 321 the edges which trigger hardware interrupts are programmed channel-granularly and the
channel-granular edge transitions are reported as hardware interrupts.
If the SM 321 is not working in "HF operation", the edges which trigger hardware interrupts in channel groups are each
programmed to 2 channels. That means that the channels compiled in the channel groups always work with the identical
programming. However, the corresponding edge transitions are reported channel-granularly per hardware interrupt.
Product information for the S7-300 Automation System Manual, Module Data
A5E03696579-01, 10/2011 7
Tolerances of the programmable input delays
Table 2 Tolerances of the input delay times of theSM 321; DI 16 x DC 24 V
Programmed input delay Tolerance
0.1 ms 60 μs to 140 μs
0.5 ms 400 ms to 900 ms
3 ms (default) 2.6 ms to 3.3 ms
15 ms 12 ms to 15 ms
20 ms 17 ms to 23 ms
Programming the Data Set 1 parameter of SM 321; DI 16xDC24V not in "HF operation".
You enable a parameter by setting the corresponding bit to "1".
If the module does not work in "HF operation", programming takes place via the parameter in byte 1 ... 2 with channels
groups each with 2 channels.


2QULVLQJHGJHDWFKDQQHOJURXS
Hardware interrupt
Hardware interrupt
2QIDOOLQJHGJHDWFKDQQHOJURXS
2QULVLQJHGJHDWFKDQQHOJURXS
2QIDOOLQJHGJHDWFKDQQHOJURXS
2QULVLQJHGJHDWFKDQQHOJURXS
2QIDOOLQJHGJHDWFKDQQHOJURXS
2QULVLQJHGJHDWFKDQQHOJURXS
2QIDOOLQJHGJHDWFKDQQHOJURXS
2QULVLQJHGJHDWFKDQQHOJURXS
2QIDOOLQJHGJHDWFKDQQHOJURXS
2QULVLQJHGJHDWFKDQQHOJURXS
2QIDOOLQJHGJHDWFKDQQHOJURXS
2QULVLQJHGJHDWFKDQQHOJURXS
2QIDOOLQJHGJHDWFKDQQHOJURXS
2QULVLQJHGJHDWFKDQQHOJURXS
2QIDOOLQJHGJHDWFKDQQHOJURXS
8QDVVLJQHG
8QDVVLJQHG
8QDVVLJQHG
'LDJQRVWLFVLQWHUUXSWHQDEOH
%\WH
%\WH
%\WH
%\WH
%\WH
%\WH
Hardware interrupt enable
Product information for the S7-300 Automation System Manual, Module Data
8 A5E03696579-01, 10/2011
Programming of the Data Set 1 parameter of SM 321; DI 16xDC24V in "HF operation".
You enable a parameter by setting the corresponding bit to "1".
In "HF operation" of the module, the edges which trigger the hardware interrupts are programmed channel-granularly via the
parameters in byte 1 ...4.

+DUGZDUH LQWHUUXSW
2QULVLQJHGJHDWFKDQQHO
2QIDOOLQJHGJHDWFKDQQHO
2QULVLQJHGJHDWFKDQQHO
2QIDOOLQJHGJHDWFKDQQHO
2QULVLQJHGJHDWFKDQQHO
2QIDOOLQJHGJHDWFKDQQHO
2QULVLQJHGJHDWFKDQQHO
2QIDOOLQJHGJHDWFKDQQHO
2QULVLQJHGJHDWFKDQQHO
2QIDOOLQJHGJHDWFKDQQHO
2QULVLQJHGJHDWFKDQQHO
2QIDOOLQJHGJHDWFKDQQHO
2QULVLQJHGJHDWFKDQQHO
2QIDOOLQJHGJHDWFKDQQHO
2QULVLQJHGJHDWFKDQQHO
2QIDOOLQJHGJHDWFKDQQHO
'LDJQRVWLFVLQWHUUXSWHQDEOH
%\WH
%\WH
%\WH
+DUGZDUHLQWHUUXSW
+DUGZDUHLQWHUUXSWHQDEOH
Product information for the S7-300 Automation System Manual, Module Data
A5E03696579-01, 10/2011 9


2QULVLQJHGJHDWFKDQQHO
2QIDOOLQJHGJHDWFKDQQHO
2QULVLQJHGJHDWFKDQQHO
2QIDOOLQJHGJHDWFKDQQHO
2QULVLQJHGJHDWFKDQQHO
2QIDOOLQJHGJHDWFKDQQHO
2QULVLQJHGJHDWFKDQQHO
2QIDOOLQJHGJHDWFKDQQHO
2QULVLQJHGJHDWFKDQQHO
2QIDOOLQJHGJHDWFKDQQHO
2QULVLQJHGJHDWFKDQQHO
2QIDOOLQJHGJHDWFKDQQHO
2QULVLQJHGJHDWFKDQQHO
2QIDOOLQJHGJHDWFKDQQHO
2QULVLQJHGJHDWFKDQQHO
2QIDOOLQJHGJHDWFKDQQHO
%\WH
%\WH +DUGZDUHLQWHUUXSW
+DUGZDUHLQWHUUXSW

8QDVVLJQHG
%\WH
Product information for the S7-300 Automation System Manual, Module Data
10 A5E03696579-01, 10/2011
SM 321; DI 16 x DC 24 V - Diagnostics
Diagnostic messages of SM 321; DI 16 x DC 24 V
The table below provides an overview of the diagnostic messages.
Table 3 Diagnostic messages of SM 321; DI 16 x DC 24 V
Diagnostic message Scope of diagnostics programmable
Sensor supply missing Channel group (8 channels)
Wire break in "HF operation"
Wire break not in "HF operation"
Channel
Channel group (2 channels)
Channel not programmed ("HF operation")
Channel module not programmed (non "HF operation")
Channel
Channel group
yes
External auxiliary voltage missing Module
Internal auxiliary voltage missing Module
Fuse blown Module
No/incorrect programming in module Module
Watchdog timeout Module
EPROM fault Module
RAM fault Module
Hardware interrupt lost Module
no
Note
In order to detect the errors indicated by programmable diagnostic messages you must have programmed the digital module
accordingly in STEP 7.
If the SM 321 is not working in "HF operation", one of the wire break diagnostic messages reported by the SM 321 always
concerns one channel group. It is only possible to determine that one of the two channels has suffered a wire break; it is not
possible to identify which one.
The structure of the diagnosis data is described in the S7-300 module data
(http://support.automation.siemens.com/WW/view/en/8859629) device manual in chapter "Configuration and Content of the
Diagnostics Data from Byte 0"
In "HF operation" the SM 321 supplies the module with a total of 25 Byte diagnostic information (Diagnostic data set 0 with a
length of 4 Byte and the Diagnostic data set 1 with a length of 25 Byte).
If the SM 321 work in "HF operation", 16 Byte diagnostic information is formed (Diagnostic data set 0 with a length of 4 Byte
and the Diagnostic data set 1 with a length of 16 Byte).
Product information for the S7-300 Automation System Manual, Module Data
A5E03696579-01, 10/2011 11
Causes of error and troubleshooting
Table 4 Diagnostics Messages of the SM 321; DI 16 x DC 24 V, causes of error and troubleshooting
Diagnostic message Possible cause of error To correct or avoid error
Overload at sensor supply Eliminate overload Sensor supply missing
Short-circuit to M at sensor supply Eliminate the short-circuit
External auxiliary voltage
missing
Power supply L+ to module missing Feed supply L+
Power supply L+ to module missing Feed supply L+ Internal auxiliary voltage
missing Fuse blown in module Replace the module
Fuse blown Fuse blown in module Replace the module
Incorrect module
parameters
Implausible parameter or combination thereof Program the module
Infrequent high electromagnetic interference Eliminate the interference Watchdog timeout
Module defective Replace the module
Infrequent high electromagnetic interference Eliminate interference and cycle the power
supply of CPU off/on.
EPROM fault
Module defective Replace the module
Infrequent high electromagnetic interference Eliminate interference and cycle the power
supply of CPU off/on.
RAM fault
Module defective Replace the module
Hardware interrupt lost The module can not output an interrupt,
because the previous interrupt was not
acknowledged; possibly a configuration error
Change interrupt processing in the CPU, and
reprogram the module as required
The error persists until the module is assigned
new parameters
Module not programmed Startup error Program the module
Product information for the S7-300 Automation System Manual, Module Data
12 A5E03696579-01, 10/2011
SM 321; DI 16 x DC 24 V - Behavior
Influence of the operating state and supply voltage on input values
The SM 321; DI 16 x DC 24 input values are determined by the CPU's operating state and the module's power supply.
Table 5 Dependency of input values on the CPU's operating state, and on the L+ power
CPU operating state Power supply L+ at digital module input value
of the digital module
L+ present Process value RUN
L+ missing 0 signal
L+ present Process value
POWER ON
STOP
L+ missing 0 signal
L+ present - POWER OFF -
L+ missing -
Reaction to power failure
Failure of the SM 321; DI 16 x DC 24 power supply is always indicated by the module's SF LED. This information is also
available on the module.
The input value is initially held for the duration of 20 ms to 40 ms before the zero signal is transferred to the CPU. Supply
voltage dips <20 ms do not influence the process value (see the table above.)
Triggering of diagnostic interrupts is determined by the parameter settings (see chapter Interrupts of SM 321; DI 16 x DC 24
V (Page 13)).
Power supply failure with redundant external sensor supply
Note
When an external redundant power source is connected in parallel to the sensor supply (Vs) and the L+ power supply fails,
the module does not report failure of the sensor supply, but rather the failure of the internal and/or external auxiliary voltage,
and/or a blown fuse.
Short-circuit at the sensor supply Vs
The relevant Vs LED goes dark if a short-circuit is detected at the sensor supply Vs, irrespective of parameter settings.
Product information for the S7-300 Automation System Manual, Module Data
A5E03696579-01, 10/2011 13
SM 321; DI 16 x DC 24 V - Interrupts
Introduction
This section describes the SM 321; DI 16 x DC 24 V in terms of its interrupt behavior. Always distinguish between the
following interrupts:
Diagnostic interrupt
Hardware interrupt
For detailed information on the OBs and SFCs mentioned below, refer to the STEP 7 Online Help.
Enabling interrupts
There is no default interrupt setting, i.e. interrupts are disabled if parameters are not set accordingly. You can enable
interrupts in STEP 7 (see the chapter Parameters of SM 321; DI 16 x DC 24 V (Page 6)).
Diagnostic interrupt
When diagnostic interrupts are enabled, incoming error events (initial occurrence) and outgoing error events (error is
cleared) are reported by means of an interrupt.
The CPU interrupts user program execution in order to process diagnostic interrupt OB82.
You can call SFC51 or 59 in OB82 in the user program to view detailed diagnostics data output by the module.
Diagnostics data remain consistent until the program exits OB82. The module acknowledges the diagnostic interrupt when
the program exits OB82.
Hardware interrupt
SM 321; DI 16 x DC 24 V can trigger a hardware interrupt for each channel at the positive, negative, or both edges of a
signal transition.
Perform the programming of the SM 321 channel-granularly in "HF operation", otherwise per channel group (see Section
Programming SM 321; DI 16 x DC 24 V (Page 6)).
Active hardware interrupts trigger hardware interrupt processing in the CPU (OB40) and interrupt execution of the user
program or of object classes with lower priority in the CPU.
You can define the response of the AS to signal edge transitions in the user program of hardware interrupt OB40. The
module acknowledges the hardware interrupt when the program exits the hardware interrupt OB.
The module can save one interrupt per channel to the stack. If no higher priority classes are pending processing, the CPU
processes the buffered interrupts (of all modules) in the order of their occurrence.
Hardware interrupt lost
A "Hardware interrupt lost" diagnostic interrupt is generated if a successive interrupt is triggered at the channel previously
saved to the stack and which has not yet been processed by the CPU.
The CPU does not register any further interrupts at this channel unless it has completed processing of the queued interrupts
of the same channel.
Product information for the S7-300 Automation System Manual, Module Data
14 A5E03696579-01, 10/2011
Interrupt-triggering channels
The relevant hardware interrupt-triggering channel is logged in the OB40_POINT_ADDR variable of the start information of
OB40. The figure shows the bit assignments of DWORD 8 in the local data.
Byte Variable Data type Description
6/7 OB40_MDL_ADDR WORD B#16#0 Address of the interrupt-triggering module
starting
at 8
OB40_POINT_ADDR DWORD see the figure
below
Indication of the interrupt-triggering inputs
5HVHUYHG
(GJHWUDQVLWLRQV&KDQQHO
(GJHWUDQVLWLRQV&KDQQHO
(GJHWUDQVLWLRQV&KDQQHO
(GJHWUDQVLWLRQV&KDQQHO
(GJHWUDQVLWLRQV&KDQQHO
(GJHWUDQVLWLRQV&KDQQHO
(GJHWUDQVLWLRQV&KDQQHO
(GJHWUDQVLWLRQV&KDQQHO
%LW1R

      
/% /% /% /%
/'
Figure 2 Start Information of OB40: which event has triggered the hardware interrupt
Siemens AG
Industry Sector
Postfach 48 48
90026 NÜRNBERG
Product information for the S7-300 Automation System Manual, Module Data
A5E03696579-01, 10/2011