Inst ToolsInst ToolsInst Tools
  • Courses
  • Videos
  • Q & A
    • Interview
      • Instrumentation
      • Electronics
      • Electrical
      • Practical Questions
    • MCQ
      • Instrumentation MCQ
      • Electrical MCQ
      • Electronics MCQ
      • Control Systems MCQ
      • Analog Electronics MCQ
      • Digital Electronics MCQ
      • Power Electronics MCQ
      • Microprocessor MCQ
      • Multiple Choice Questions
  • EE
    • Electronics
      • Electronics Q & A
      • Electronic Basics
      • Electronic Devices & Circuits
      • Electronics Animation
      • Digital Electronics
    • Electrical
      • Electrical Basics
      • Electrical Q & A
      • Power Electronics
      • Electrical Machines
      • Electrical Animation
      • Power Systems
      • Switchgear & Protection
      • Transmission & Distribution
  • Measure
    • Control Valves
    • Calibration
    • Temperature
    • Pressure
    • Flow
    • Level
    • Analyzers
    • Switches
    • Vibration
    • Solenoid Valve
  • Control
    • PLC Tutorials
    • Control Systems
    • Safety Instrumented System (SIS)
    • Communication
    • Fire & Gas System
  • More
    • Design
    • Tools
    • Animation
    • Basics
    • Formulas
    • Standards
    • TextBooks
    • Common
    • Software
    • Excel Tools
    • Erection & Commissioning
    • Process Fundamentals
    • Videos
    • Books
Search
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Reading: Siemens PLC programming: BCD, Integer, Double Integer, Real
Share
Notification Show More
Font ResizerAa
Inst ToolsInst Tools
Font ResizerAa
  • Courses
  • PLC Tutorials
  • Control Systems
Search
  • Courses
  • Videos
  • Q & A
    • Interview
    • MCQ
  • EE
    • Electronics
    • Electrical
  • Measure
    • Control Valves
    • Calibration
    • Temperature
    • Pressure
    • Flow
    • Level
    • Analyzers
    • Switches
    • Vibration
    • Solenoid Valve
  • Control
    • PLC Tutorials
    • Control Systems
    • Safety Instrumented System (SIS)
    • Communication
    • Fire & Gas System
  • More
    • Design
    • Tools
    • Animation
    • Basics
    • Formulas
    • Standards
    • TextBooks
    • Common
    • Software
    • Excel Tools
    • Erection & Commissioning
    • Process Fundamentals
    • Videos
    • Books
Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Inst Tools > Blog > PLC Tutorials > Siemens PLC programming: BCD, Integer, Double Integer, Real

Siemens PLC programming: BCD, Integer, Double Integer, Real

Last updated: March 4, 2021 1:11 pm
Editorial Staff
PLC Tutorials
No Comments
Share
7 Min Read
SHARE

Let’s study the working converters in Siemens PLC programming commands: BCD to Integer, Integer to BCD, Integer to Double Integer, BCD to Double Integer, Double Integer to Real.

Contents
Siemens PLC programmingBCD to Integer InstructionInteger to BCD InstructionInteger to Double Integer InstructionBCD to Double Integer InstructionDouble Integer to BCD InstructionDouble Integer to Real InstructionLadder LogicLadder DescriptionNetwork 1:Network 2:Network 3:Network 4:Network 5 :Network 6:Variable Table:

Siemens PLC programming

Siemens PLC programming BCD, Integer, Double Integer, Real

Data types are used to identify the type of data used in the user program. Its a data storage format that can contain a specific type or range of values. When PLC program stores data in variables must be assigned to specific data type like Bool (1 Bit), integer (16 bit), Word (16 bit), Double Integer (32 bit) and Real (32 bit).

While processing inputs and outputs in PLC program, conversion like BCD to an integer, Integer to a double integer, etc are much needed.

BCD to Integer Instruction

BCD to Integer instruction is used to convert BCD coded number to integer format. Input data can be read at IN. Input condition can give EN input and ENO is output, it has the same signal as EN. The least significant bit in BCD format is the sign bit.

Example 1:

Input IN : 0000 0001 0001 1000

Output OUT : 118

Example 2:

Input IN :1000 0001 0001 1000

Output OUT : -118

Integer to BCD Instruction

Integer to BCD instruction is used to convert integer format to BCD coded numbers. Input data can be read at IN. Input condition can give EN input and ENO is output, it has the same signal as EN.

Example 1:

Input (IN) : 118

Output (OUT) : 0000 0001 0001 1000

Example 2:

Input (IN):  -118

Output (OUT): 1000 0001 0001 1000

Integer to Double Integer Instruction

Integer to Double Integer instruction is used to convert the data which is in 16 bit to 32 bit. Input data can be read at IN. Input condition can give EN input and ENO is output, it has the same signal as EN.

Example 1:

Input (IN) : 90

Output (OUT) : L # 90     (Decimal Format )

Example 2:

Input (IN):  0000 0000 0101 1010

Output (OUT): 0000 0000 0000 0000 0000 0000 0101 1010    (Binary format)

BCD to Double Integer Instruction

BCD to Double Integer instruction is used to convert BCD coded numbers to double integer format(32 bit ). Input data can be read at IN. Input condition can give EN input and ENO is output, it has the same signal as EN. The least significant bit in BCD format is the sign bit.

Example 1:

Input IN : 0000 0010 0101 0101

Output OUT : 255

Example 2:

Input IN :1000 0100 0100 0010 1000 0010 0101 0101

Output OUT : -4428255

Double Integer to BCD Instruction

Double Integer to BCD instruction is used to convert a double integer format(32 bit ) to BCD coded number. Input data can be read at IN. Input condition can give EN input and ENO is output, it has the same signal as EN. The least significant bit in BCD format is the sign bit.

Example 1:

Input IN : 225

Output OUT : 0000 0010 0101 0101

Example 2:

Input IN : -4428255

Output OUT : 1000 0100 0100 0010 1000 0010 0101 0101

Double Integer to Real Instruction

Double Integer to Real instruction is used to convert a double integer format(32 bit ) to a floating-point number (32bit). Input data can be read at IN. Input condition can give EN input and ENO is output, it has the same signal as EN. The least significant bit in BCD format is the sign bit.

Example 1:

Input IN : 987

Output OUT: 987.0

Example 2:

Input IN: 209834

Output OUT: 209834.0

Ladder Logic

Siemens PLC programming Commands
BCD to Integer Program in PLC

Ladder Description

Network 1:

Input I0.0 is pressed, BCD to I instruction reads the value in MW0 and convert that to a corresponding integer value and result in the output to MW2. Q0.0 enables as long as I0.0 enables.

Network 2:

Input I0.0 is pressed; I to BCD instruction read the value in MW4 and convert that to corresponding BCD value and result in the output to MW6. Q0.1 enables as long as I0.0 enables.

Network 3:

Input I0.0 has pressed I to DI instruction reads the value in MW8 and convert that to a corresponding integer value and result in the output to MD10. Q0.2 enables as long as I0.0 enables.

Network 4:

Input I0.0 is pressed; BCD to DI instruction reads the value in MD14 and convert that to corresponding double integer value and result in the output to MD18. Q0.3 enables as long as I0.0 enables.

Network 5 :

Input I0.0 is pressed, DI to BCD instruction reads the value in MD22 and convert that to corresponding BCD  value and result in the output to MD26. Q0.4 enables as long as I0.0 enables.

Network 6:

Input I0.0 is pressed; DI to R instruction reads the value in MD30 and convert that to corresponding floating-point value and result in the output to MD34. Q0.5 enables as long as I0.0 enables.

Variable Table:

Variable Table in Siemens PLC

Variable is used to view the inputs and outputs in different formats.

In Siemens, MW is the address used for integer data, MD is the address used for double integer data.

Status Value in Variable table is used to see the input and output values.

Modify the value in the variable table is used to give input data.

Author: Hema Sundaresan

If you liked this article, then please subscribe to our YouTube Channel for PLC and SCADA video tutorials.

You can also follow us on Facebook and Twitter to receive daily updates.

Read Next:

  • Bitwise Logical Operations
  • PLC Packaging System
  • Memory Instructions in PLC
  • PLC Profinet I/O System
  • Pulse Timer Instruction in PLC
Don't Miss Our Updates
Be the first to get exclusive content straight to your email.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address
You've successfully subscribed !

Continue Reading

Data Handling Instructions in PLC Programming
Various Types of Delta PLC used in Industrial Automation
PLC Ladder Logic Design: Control 3 Motors with Toggle Switch
Car Wash Program using Functional Block Diagram (PLC)
Two Hand Control Logic using PLC
How to Work with Allen Bradley RsLogix Emulator?
Share This Article
Facebook Whatsapp Whatsapp LinkedIn Copy Link
Share
Leave a Comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

128.3kFollowersLike
69.1kFollowersFollow
208kSubscribersSubscribe
38kFollowersFollow

Categories

Explore More

PLC FBD Program for Bottle’s Capping with Rotating Mechanism
What are AI, AO, DI, and DO? – Definition, Examples, Purpose
Types of Failures in Industrial Automation Systems
VFD Interview Questions and Answers – Electrical Drives
If Else Statement in SCL Language
Basic PLC Ladder Programming Example
PLC Program for Sequential Motor Control
PLC Count values higher than 999
How Could FB and FC Make Me Professional PLC Programmer?
What is PLC Redundancy?

Keep Learning

PLC Tag Naming Conventions

PLC Tag Naming Conventions

Principle of Operation of PLC

Principle of Operation of PLC

Gate Array Logic using PLC

PLC Program to Simulate Gate Array Logic

How to Use the Shift and Rotate Instructions in PLC

How to Use the Shift and Rotate Instructions in PLC?

Omron PLC programs

Daily Alarm PLC Program using Real-Time Clock

Configuration of Siemens Scada and PLC

#12 PLC Best Practices – Validate Inputs based on Physical Plausibility

Best PLC for Your Project

Finding the Best PLC for Your Project – Tips and Tricks

factorytalk view studio hmi

How to Create Templates in FactoryTalk View Studio?

Discover More

Tank Level Control Process in PLC

Tank Level Control in PLC

Tilt Level Switch Theory

Tilt Level Switch Working Principle

Power Electronics Objective Questions

Dual Converters Multiple Choice Questions

Transformer Coil Polarity

Transformer Coil Polarity

PLC Ladder Logic Door Open and Closing System

Which Language is Best for PLC Programming?

RTD-standards

How to calculate the tolerance of a RTD sensor

Control Valve in Last Position

Control Valve Fail Safe Action

Ultrasonic level measurement

Ultrasonic Level Measurement

Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?