Friday, July 13, 2012

Rules for Arranging Modules on cntraral rack


Rules for Arranging Modules (SIMATIC 300) 
Basic Rule
Modules must be inserted in the rack without gaps.
Exception: For installations with one rack, one slot in the configuration table must remain free
(reserved for the interface module). With the S7-300, this is slot 3 and with M7-300, the slot after the
module group (slot 3, 4, 5, or 6). In the actual configuration there is no gap because the backplane bus
would be interrupted.
 
Slot Rules (S7-300)
Rack 0:
•  Slot 1: Power supply only (for example, 6ES7 307-...) or empty
•  Slot 2: CPU only (for example, 6ES7 314-...)
•  Slot 3: Interface module (for example, 6ES7 360-.../361-...) or empty
•  Slots 4 through 11: Signal or function modules, communications processors, or free.
Racks 1 to 3:
•  Slot 1: Power supply module only (for example, 6ES7 307-...) or empty
•  Slot 2: Free
•  Slot 3: Interface module
•  Slots 4 through 11: Signal or function modules, communications processors (dependent on the
inserted interface module), or free.
!--RELATED-POSTS-STARTS-->

Procedure for Configuring Hardware


Basic Procedure for Configuring Hardware 
Window for Configuring 
   Configuring a programmable controller involves the use of two windows:
   •  The station window in which you place the racks for the station structure
   •  The "Hardware Catalog" window from which you select the required hardware components, for
       example, racks, modules, and interface submodules
Displaying the Hardware Catalog 
   If the "Hardware Catalog" window is not displayed, select the menu command View > Catalog. This
  command toggles the display of the Hardware Catalog on and off.
Basic Steps for Configuring a Station 
First you should go to your project Click on Simatic 300 Station from tree window, see on object window

  • Hardware
  • CPU319-3PN/DP
Click on Hardware for setting....
During hard ware setting keep mind Rules for Arranging Modules on centraral rack !--RELATED-POSTS-STARTS-->

How to create a project in Simatic S7

After installing s7 ,you see a desktop icon on your PC of S7(Simatic Manager).
Click on the Icon and wait for opening.
Now click on File>>New Project Wizard    which appear a new pop-up window like below:


Now click on Next> button to give CPU name and MPI adress,here I select CPU319-PN/DP afterthat click Next>
Now click to checkbox select all for Blocks,select language LAD or STL or FBD.
You can also click on create with source file chechbox. and click to next..

Now give your project name here I put a name Test and click to next button.......to create your project.

Finally your project tree will apear like below:

                                                                                                       Hardware setting>> !--RELATED-POSTS-STARTS-->

Thursday, July 12, 2012

CALL_FC Call FC from Box

CALL_FC  Call FC from Box



Description
CALL_FC (Call a Function from a Box) is used to call a function (FC). The call is executed if EN is "1".
If CALL_FC is executed,
•  The return address of the calling block is stored,
•  The previous local data area is replaced by the current local data area,  
•  The MA bit (active MCR bit) is shifted to the B stack,
•  A new local data area for the called function is created.
After this, program processing continues in the called function.
The BR bit is scanned in order to find out the ENO. The user has to assign the required state (error
evaluation) to the BR bit in the called block using ---(SAVE).
If you call a function and the variable declaration table of the called block has IN, OUT, and IN_OUT
declarations, these variables are added in the program for the calling block as a list of formal
parameters.
When calling the function, you must assign actual parameters to the formal parameters at the call
location. Any initial values in the function declaration have no significance.


The Ladder rungs shown above are program sections from a function block written by a user. In this
FB, DB10 is opened and MCR functionality is activated. If the unconditional call of FC10 is executed,
the following occurs:
The return address of the calling FB plus selection data for DB10 and for the instance data block for
the calling FB are saved. The MA bit, set to "1" in the MCRA instruction, is pushed to the B stack and
then set to "0" for the called block (FC10). Program processing continues in FC10. If MCR functionality
is required by FC10, it must be re-activated within FC10. The state of the RLO must be saved in the
BR bit by the instruction ---(SAVE) in order to be able to evaluate errors in the calling FB. When FC10
is finished, program processing returns to the calling FB. The MA bit is restored. After execution of
FC10, program processing is continued in the calling FB depending on the ENO:
ENO = "1"  FC11 is processed
ENO = "0"  processing starts in the next network
If FC11 is also processed correctly, ENO = "1" and therefore Q4.0 = "1".

Another CALL instruction almost same...........

!--RELATED-POSTS-STARTS-->

Call FC SFC from Coil (without Parameters)


---(Call)    Call FC SFC from Coil (without Parameters) 
Symbol
<FC/SFC no.>
---( CALL )

Parameter              Data Type            Memory Area      Description
<FC/SFC no.>      BLOCK_FC              -                  Number of FC/SFC; range depends on CPU
                             BLOCK_SFC

Description
---(Call) (Call FC or SFC without Parameters) is used to call a function (FC) or system function (SFC)
that has no passed parameters. A call is only executed if RLO is "1" at the CALL coil. If ---(Call) is
executed,
•  The return address of the calling block is stored,
•  The previous local data area is replaced by the current local data area,
•  The MA bit (active MCR bit) is shifted to the B stack,
•  A new local data area for the called function is created.
After this, program processing continues in the called FC or SFC.


The Ladder rungs shown above are program sections from a function block written by a user. In this
FB, DB10 is opened and MCR functionality is activated. If the unconditional call of FC10 is executed,
the following occurs:
The return address of the calling FB plus selection data for DB10 and for the instance data block for
the calling FB are saved. The MA bit, set to "1" in the MCRA instruction, is pushed to the B stack and
then set to "0" for the called block (FC10). Program processing continues in FC10. If MCR functionality
is required by FC10, it must be re-activated within FC10. When FC10 is finished, program processing
returns to the calling FB. The MA bit is restored, DB10 and the instance data block for the user-written
FB become the current DBs again, regardless of which DBs FC10 has used. The program continues
with the next rung by assigning the logic state of I0.0 to output Q4.0. The call of FC11 is a conditional
call. It is only executed if I0.1 is "1". If it is executed, the process of passing program control to and
returning from FC11 is the same as was described for FC10.

!--RELATED-POSTS-STARTS-->

Overview of Program Control Instructions


Overview of Program Control Instructions   
Description
The following program control instructions are available:
•  ---(CALL)              Call FC SFC from Coil (without Parameters)
•  CALL_FB              Call FB from Box
•  CALL_FC              Call FC from Box
•  CALL_SFB            Call System FB from Box
•  CALL_SFC            Call System FC from Box
•  Call Multiple Instance
•  Call Block from a Library

•  Important Notes on Using MCR Functions
•  ---(MCR<)              Master Control Relay On
•  ---(MCR>)             Master Control Relay Off
•  ---(MCRA)             Master Control Relay Activate
•  ---(MCRD)             Master Control Relay Deactivate
• RET                        Return !--RELATED-POSTS-STARTS-->

Jump-If-Not


---( JMPN )  Jump-If-Not 
Symbol
<label name>
---( JMPN )
Description
---( JMPN ) (Jump-If-not) corresponds to a "goto label" function which is executed if the RLO is "0".
A destination (LABEL) must also exist for every ---( JMPN ).  
All instructions between the jump instruction and the label are not executed.
If a conditional jump is not executed, the RLO changes to "1" after the jump instruction.
If I0.0 = "0", the jump to label CAS1 is executed. Because of the jump, the instruction to reset output
Q4.0 is not executed even if there is a logic "1" at I0.3.
!--RELATED-POSTS-STARTS-->

Conditional Jump


--(JMP)---  Conditional Jump
Symbol
<label name>
---( JMP )
Description  
---( JMP ) (jump within the block when 1) functions as a conditional jump when the RLO of the
previous logic operation is "1".
A destination (LABEL) must also exist for every ---( JMP ).
All instructions between the jump instruction and the label are not executed.
If a conditional jump is not executed, the RLO changes to "1" after the jump instruction.

If I0.0 = "1", the jump to label CAS1 is executed. Because of the jump, the instruction to reset output
Q4.0 is not executed even if there is a logic "1" at I0.3.
!--RELATED-POSTS-STARTS-->

Unconditional Jump


---(JMP)---  Unconditional Jump 
Symbol
<label name>
---( JMP )
Description  
---( JMP ) (jump within the block when 1) functions as an absolute jump when there is no other Ladder
element between the left-hand power rail and the instruction (see in example before JMP  there is no logic).
A destination (LABEL) must also exist for every ---( JMP ).
All instructions between the jump instruction and the label are not executed.



The jump is always executed and the instructions between the jump instruction and the jump label are
missed out
!--RELATED-POSTS-STARTS-->

Tuesday, July 10, 2012

Encoder




An 
encoder is a device, circuit, transducer, software program, algorithm or person that converts information from one format or code to another, for the purposes of standardization, speed, secrecy, security, or saving space by shrinking size.



What is the basic definition of an encoder?
Answer: An encoder comes in two architectures. The first architecture is linear. The second architecture is rotary. Both types sense mechanical motion and translates the information (velocity, position, acceleration) into useful electrical data.
What isIncremental encoder?
An incremental encoder is a pulse generator that provides square–wave signals and a zero index.
The disc has 2 channels divided into “n” equal angular intervals; alternately opaque and clear. “n” is called resolution or number of counts.
Pulses counted by the processing electronics give the angular position of the rotor. For this purpose 2 squarewaves A and B are used with a third channel, Z, synchronous with signals A and B giving only one signal per revolution. It allows the user to initialize or reset the count.
Incremental encoder
Incremental encoder chart
what is Absolute encoder?
This concept has been developed to compensate for the performance limitations of incremental encoders :
  • need for initialization
  • must be re–zeroed after a power interruption: zero reset to obtain the mechanism angular position
  • sensitivity to the interference
The absolute encoder supplies the shaft position as a binary code.
The output code is unique for each position. The resolution is equal to 2n(n= number of bit).
The shaft position information is given instantly when power is supplied.
There are two different types of absolute optical encoders :

  • Single turn absolute optical encoder –> gives the absolute angular position over 360° rotation.
  • Multiturn absolute encoder –> a system of additional shafts and discs which allows the number of revolutions to be counted.
The complete cycle is realized by « m » shaft rotations. The total resolution is equal to m x n (m=number of revolutions, n=number of counts per revolution).
Absolute encoder
Multiturn Absolute Encoder Principle
What is a channel? 
Answer: A channel is an electrical output signal from an encoder. Typical incremental encoders have either two or three channels. An example would be: A, A not, B, B not, and Z, Z not (also referred to I or I not.). 

What is the Index pulse (strobe, Z, and I.)? 
Answer: It is the absolute reference added to an incremental encoder. It is also known as home position. It signifies a full rotation of the encoder disk 
How can I reduce the effect of noise when using encoders? 
Answer: There are several ways to improve noise immunity. Be careful to separate motor and all power wires away from encoder wires. Always separate the channels from each other. All encoder wire should be shielded and carefully terminated. The pigtail that connects to the control unit using the encoder should be as short as possible. The leads will act as antennas for any stray RF in the vicinity. The addition of other noise suppression devices may be required in high noise environments. 


What equipment do I need to troubleshoot an encoder? 
Answer: A: An oscilloscope or specially designed encoder tester. A basic multimeter will do for basic diagnostics such as power supply and low speed pulse outputs. Any advanced pulse detection and diagnostics needs to be performed by a trained technician and an oscilloscope. 



!--RELATED-POSTS-STARTS-->

Thursday, July 5, 2012

S7 system function


System Function Blocks

NumberNameFamilyDescription
SFB 0CTUIEC_TCCount Up
SFB 1CTDIEC_TCCount Down
SFB 2CTUDIEC_TCCount Up/Down
SFB 3TPIEC_TCGenerate a Pulse
SFB 4TONIEC_TCGenerate an On Delay
SFB 5TOFIEC_TCGenerate an Off Delay
SFB 8USENDCOM_FUNCUncoordinated Sending of Data
SFB 9URCVCOM_FUNCUncoordinated Receiving of Data
SFB 12BSENDCOM_FUNCSending Segmented Data
SFB 13BRCVCOM_FUNCReceiving Segmented Data
SFB 14GETCOM_FUNCRead Data from a Remote CPU
SFB 15PUTCOM_FUNCWrite Data to a Remote CPU
SFB 16PRINTCOM_FUNCSend Data to Printer
SFB 19STARTCOM_FUNCInitiate a Warm or Cold Restart on a Remote Device
SFB 20STOPCOM_FUNCChanging a Remote Device to the STOP State
SFB 21RESUMECOM_FUNCInitiate a Hot Restart on a Remote Device
SFB 22STATUSCOM_FUNCQuery the Status of a Remote Partner
SFB 23USTATUSCOM_FUNCReceive the Status of a Remote Device
SFB 29HS_COUNTCOUNTERSCounter (high-speed counter, integrated function) (only exist on the CPU 312 IFM and CPU 314 IFM)
SFB 30FREQ_MESCOUNTERSFrequency Meter (frequency meter, integrated function (only exist on the CPU 312 IFM and CPU 314 IFM)
SFB 31NOTIFY_8PCOM_FUNCGenerating block related messages without acknowledgement indication
SFB 32DRUMTIMERSImplement a Sequencer
SFB 33ALARMCOM_FUNCGenerate Block-Related Messages with Acknowledgment Display
SFB 34ALARM_8COM_FUNCGenerate Block-Related Messages without Values for 8 Signals
SFB 35ALARM_8PCOM_FUNCGenerate Block-Related Messages with Values for 8 Signals
SFB 36NOTIFYCOM_FUNCGenerate Block-Related Messages without Acknowledgment Display
SFB 37AR_SENDCOM_FUNCSend Archive Data
SFB 38HSC_A_BCOUNTERSCounter A/B (integrated function) (only exist on the CPU 314 IFM)
SFB 39POSICONTPosition (integrated function) (only exist on the CPU 314 IFM)
SFB 41CONT_CICONTContinuous Control (only exist on the CPU 314 IFM)
SFB 42CONT_SICONTStep Control (only exist on the CPU 314 IFM)
SFB 43PULSEGENICONTPulse Generation (only exist on the CPU 314 IFM)
SFB 44ANALOGTEC_FUNCPositioning with Analog Output (only exist on the S7-300C CPUs)
SFB 46DIGITALTEC_FUNCPositioning with Digital Output (only exist on the S7-300C CPUs)
SFB 47COUNTTEC_FUNCControlling the Counter (only exist on the S7-300C CPUs)
SFB 48FREQUENCTEC_FUNCControlling the Frequency Measurement (only exist on the S7-300C CPUs)
SFB 49PULSETEC_FUNCControlling Pulse Width Modulation (only exist on the S7-300C CPUs)
SFB 52RDRECDPReading a Data Record
SFB 53WRRECDPWriting a Data Record
SFB 54RALRMDPReceiving an Interrupt
SFB 60SEND_PTPTEC_FUNCSending Data (ASCII, 3964(R)) (only exist on the S7-300C CPUs)
SFB 61RECV_PTPTEC_FUNCReceiving Data (ASCII, 3964(R)) (only exist on the S7-300C CPUs)
SFB 62RES_RECVTEC_FUNCDeleting the Receive Buffer (ASCII, 3964(R)) (only exist on the S7-300C CPUs)
SFB 63SEND_RKTEC_FUNCSending Data (RK 512) (only exist on the S7-300C CPUs)
SFB 64FETCH_RKTEC_FUNCFetching Data (RK 512) (only exist on the S7-300C CPUs)
SFB 65SERVE_RKTEC_FUNCReceiving and Providing Data (RK 512) (only exist on the S7-300C CPUs)
SFB 75SALRMDPSend interrupt to DP master
SFB 81RD_DPARIO_FUNCTRead Predefined Parameter

System Function Calls

NumberNameFamilyDescription
SFC 0SET_CLKCLK_FUNCSet System Clock
SFC 1READ_CLKCLK_FUNCRead System Clock
SFC 2SET_RTMCLK_FUNCSet Run-time Meter
SFC 3CTRL_RTMCLK_FUNCStart/Stop Run-time Meter
SFC 4READ_RTMCLK_FUNCRead Run-time Meter
SFC 5GADR_LGCIO_FUNCTQuery Logical Address of a Channel
SFC 6RD_SINFODB_FUNCTRead OB Start Information
SFC 7DP_PRALDPTrigger a Hardware Interrupt on the DP Master
SFC 9EN_MSGCOM_FUNCEnable Block-Related, Symbol-Related and Group Status Messages
SFC 10DIS_MSGCOM_FUNCDisable Block-Related, Symbol-Related and Group Status Messages
SFC 11DPSYC_FRDPSynchronize Groups of DP Slaves
SFC 12D_ACT_DPDPDeactivation and activation of DP slaves
SFC 13DPNRM_DGDIAGNSTCRead Diagnostic Data of a DP Slave (Slave Diagnostics)
SFC 14DPRD_DATDPRead Consistent Data of a Standard DP Slave
SFC 15DPWR_DATDPWrite Consistent Data to a DP Standard Slave
SFC 17ALARM_SQPMC_FUNCGenerate Acknowledgeable Block-Related Messages
SFC 18ALARM_SPMC_FUNCGenerate Permanently Acknowledged Block-Related Messages
SFC 19ALARM_SCPMC_FUNCQuery the Acknowledgment Status of the last ALARM_SQ Entering State Message
SFC 20BLKMOVMOVECopy Variables
SFC 21FILLMOVEInitialize a Memory Area
SFC 22CREAT_DBDB_FUNCTCreate Data Block
SFC 23DEL_DBDB_FUNCTDelete Data Block
SFC 24TEST_DBDB_FUNCTTest Data Block
SFC 25COMPRESSDB_FUNCTCompress the User Memory
SFC 26UPDAT_PIIO_FUNCTUpdate the Process Image Update Table
SFC 27UPDAT_POIO_FUNCTUpdate the Process Image Output Table
SFC 28SET_TINTPGM_CNTLSet Time-of-Day Interrupt
SFC 29CAN_TINTPGM_CNTLCancel Time-of-Day Interrupt
SFC 30ACT_TINTPGM_CNTLActivate Time-of-Day Interrupt
SFC 31QRY_TINTPGM_CNTLQuery Time-of-Day Interrupt
SFC 32SRT_DINTPGM_CNTLStart Time-Delay Interrupt
SFC 33CAN_DINTPGM_CNTLCancel Time-Delay Interrupt
SFC 34QRY_DINTPGM_CNTLQuery Time-Delay Interrupt
SFC 35MP_ALMPGM_CNTLTrigger Multicomputing Interrupt
SFC 36MSK_FLTDIAGNSTCMask Synchronous Errors
SFC 37DMSK_FLTDIAGNSTCUnmask Synchronous Errors
SFC 38READ_ERRDIAGNSTCRead Error Register
SFC 39DIS_IRTIRT_FUNCDisable New Interrupts and Asynchronous Errors
SFC 40EN_IRTIRT_FUNCEnable New Interrupts and Asynchronous Errors
SFC 41DIS_AIRTIRT_FUNCDelay Higher Priority Interrupts and Asynchronous Errors
SFC 42EN_AIRTIRT_FUNCEnable Higher Priority Interrupts and Asynchronous Errors
SFC 43RE_TRIGRPGM_CNTLRe-trigger Cycle Time Monitoring
SFC 44REPL_VALDIAGNSTCTransfer Substitute Value to Accumulator 1
SFC 46STPPGM_CNTLChange the CPU to STOP
SFC 47WAITPGM_CNTLDelay Execution of the User Program
SFC 48SNC_RTCBCLK_FUNCSynchronize Slave Clocks
SFC 49LGC_GADRIO_FUNCTQuery the Module Slot Belonging to a Logical Address
SFC 50RD_LGADRIO_FUNCTQuery all Logical Addresses of a Module
SFC 51RDSYSSTDIAGNSTCRead a System Status List or Partial List
SFC 52WR_USMSGDIAGNSTCWrite a User-Defined Diagnostic Event to the Diagnostic Buffer
SFC 54RD_PARMIO_FUNCTRead Defined Parameters
SFC 55WR_PARMIO_FUNCTWrite Dynamic Parameters
SFC 56WR_DPARMIO_FUNCTWrite Default Parameters
SFC 57PARM_MODIO_FUNCTAssign Parameters to a Module
SFC 58WR_RECIO_FUNCTWrite a Data Record
SFC 59RD_RECIO_FUNCTRead a Data Record
SFC 60GD_SNDCOM_FUNCSend a GD Packet
SFC 61GD_RCVCOM_FUNCFetch a Received GD Packet
SFC 62CONTROLCOM_FUNCQuery the Status of a Connection Belonging to a Communication SFB Instance
SFC 63AB_CALLPLASTICSAssembly Code Block (only exists for CPU 614)
SFC 64TIME_TCKCLK_FUNCRead the System Time
SFC 65X_SENDCOM_FUNCSend Data to a Communication Partner outside the Local S7 Station
SFC 66X_RCVCOM_FUNCReceive Data from a Communication Partner outside the Local S7 Station
SFC 67X_GETCOM_FUNCRead Data from a Communication Partner outside the Local S7 Station
SFC 68X_PUTCOM_FUNCWrite Data to a Communication Partner outside the Local S7 Station
SFC 69X_ABORTCOM_FUNCAbort an Existing Connection to a Communication Partner outside the Local S7 Station
SFC 70GEO_LOGIO_FUNCTDetermine Start Address of a Module
SFC 71LOG_GEOIO_FUNCTDetermine the Slot Belonging to a Logical Address
SFC 72I_GETCOM_FUNCRead Data from a Communication Partner within the Local S7 Station
SFC 73I_PUTCOM_FUNCWrite Data to a Communication Partner within the Local S7 Station
SFC 74I_ABORTCOM_FUNCAbort an Existing Connection to a Communication Partner within the Local S7 Station
SFC 78OB_RTDIAGNSTCDetermine OB program runtime
SFC 79SETBIT_LOGCSet a Range of Outputs
SFC 80RSETBIT_LOGCReset a Range of Outputs
SFC 81UBLKMOVMOVEUninterruptible Block Move
SFC 82CREA_DBLDB_CTRLCreate a Data Block in the Load Memory
SFC 83READ_DBLDB_CTRLRead from a Data Block in Load Memory
SFC 84WRIT_DBLDB_CTRLWrite from a Data Block in Load Memory
SFC 85CREA_DBDB_FUNCTCreate a Data Block
SFC 87C_DIAGCOM_FUNCDiagnosis of the Actual Connection Status
SFC 90H_CTRLHF_FUNCTControl Operation in H Systems
SFC 100SET_CLKSCLK_FUNCSetting the Time-of-Day and the TOD Status
SFC 101RTMCLK_FUNCHandling runtime meters
SFC 102RD_DPARAIO_FUNCTRedefined Parameters
SFC 103DP_TOPOLDPIdentifying the bus topology in a DP master system
SFC 104CIRPGM_CNTLControlling CiR
SFC 105READ_SIPMC_FUNCReading Dynamic System Resources
SFC 106DEL_SIPMC_FUNCDeleting Dynamic System Resources
SFC 107ALARM_DQPMC_FUNCGenerating Always Acknowledgeable and Block-Related Messages
SFC 108ALARM_DPMC_FUNCGenerating Always Acknowledgeable and Block-Related Messages
SFC 112PN_INPROFIne2Update inputs in the user program interface of PROFInet components
SFC 113PN_OUTPROFIne2Update outputs in the user program interface of PROFInet components
SFC 114PN_DPPROFIne2Update DP interconnections
SFC 126SYNC_PIIO_FUNCTUpdate process image partition input table in synchronous cycle
SFC 127SYNC_POIO_FUNCTUpdate process image partition output table in synchronou
!--RELATED-POSTS-STARTS-->

CPU Resister

!--RELATED-POSTS-STARTS-->

Seimens technical term

siemens technical term



TermDescriptionExplanation
C7Combo PLC/HMI systemA PLC and screen in one package
CFCContinuous Function ChartOptional programming language
CPCommunication ProcessorModules used for special communication protocols
DBData BlockMemory storage areas for user data
FBFunction BlockA function with it's own data block
FBDFunction Block DiagramStandard programming language
FCFunction CallCalled progammed blocks
FMFunction ModuleModules with special functions (e.g. positioning)
GSDGeneric Station DescriptionFiles used for Profibus descriptions
HiGraph Optional programming language
IMInterface ModuleModules to connect remote racks
LADLadder Logic DiagramStandard programming language
M7Programmable modulesA module with processing capabilities
MMCMicro Memory CardCompact plug-in memory card
MPIMulti Point InterfaceStandard communication protocol
OBOrganization BlockBlocks for user programs based on different operating system events.
OPOperator PanelSimple display with or without buttons
PCSProcess Control SystemSoftware for the entire process chain
PGProgramming TerminalDedicated Siemens device - basically a PC
PPIPoint to Point InterfaceSerial RS-232 communication
Profibus DPProfibus Decentral PeripheralsNetworking protocol used for factory automation
Profibus PAProfibus Process AutomationNetworking protocol used for process automation
S7 SIMATIC Step 7 product line
SCLStructured Control LanguageOptional programming language
SFBSystem Function BlockIntegrated FB for CPU information
SFCSystem Function CallIntegrated FC for CPU information
SMSignal ModuleStandard Input/Output modules
STLStatement ListText based programming language
TPTouch PanelTouch screen display
UDTUser-Definded Data TypeSpecial data structures defined by the user
VATVariable Access TableTables used to monitor/modify values in the PLC


!--RELATED-POSTS-STARTS-->

Data Block Instructions


Data Block Instructions 
                ---(OPN)    Open Data Block: DB or DI
Symbol 
<DB no.> or <DI no.>
---(OPN)

Parameter            Data Type       Memory Area         Description
<DB no.>
<DI no.>             BLOCK_DB         DB, DI              Number of DB/DI; range depends on CPU
Description
---(OPN) (Open a Data Block) opens a shared data block (DB) or an instance data block (DI). The
---(OPN) function is an unconditional call of a data block. The number of the data block is transferred
into the DB or DI register. The subsequent DB and DI commands access the corresponding blocks,
depending on the register contents.



Data block 10 (DB10) is opened. The contact address (DBX0.0) refers to bit zero of data byte zero of
the current data record contained in DB10. The signal state of this bit is assigned to the output Q4.0. !--RELATED-POSTS-STARTS-->

Wednesday, July 4, 2012

CMP ? D Compare Double Integer

CMP ? D    Compare Double Integer


Parameter       Data Type     Memory Area        Description
box input        BOOL        I, Q, M, L, D       Result of the previous logic operation
box output      BOOL        I, Q, M, L, D       Result of the comparison, is only processed
                                                                 further if the RLO at the box input = 1
IN1                INT           I, Q, M, L, D        First value to compare
                                       or constant          
IN2                 INT            I, Q, M, L, D      Second value to compare
                                        or constant 

Description 
CMP ? D (Compare Double Integer) can be used like a normal contact. It can be located at any
position where a normal contact could be placed. IN1 and IN2 are compared according to the type of
comparison you choose.
If the comparison is true, the RLO of the function is "1". It is linked to the RLO of a rung network by
AND if the compare element is used in series, or by OR if the box is used in parallel.


Output Q4.0 is set if the following conditions exist:
•  There is a signal state of "1" at inputs I0.0 and at I0.1
•  And MD0 >= MD4
•  And there is a signal state of"1" at input I0.2

!--RELATED-POSTS-STARTS-->

CMP ? I Compare Integer


CMP ? I  Compare Integer 









Parameter       Data Type     Memory Area        Description
box input        BOOL        I, Q, M, L, D       Result of the previous logic operation
box output      BOOL        I, Q, M, L, D       Result of the comparison, is only processed
                                                                 further if the RLO at the box input = 1
IN1                INT           I, Q, M, L, D        First value to compare
                                       or constant        
IN2                 INT            I, Q, M, L, D      Second value to compare
                                        or constant
Description 
CMP ? I (Compare Integer) can be used like a normal contact. It can be located at any position where
a normal contact could be placed. IN1 and IN2 are compared according to the type of comparison you
choose.
If the comparison is true, the RLO of the function is "1". It is linked to the RLO of the whole rung by
AND if the box is used in series, or by OR if the box is used in parallel.


Output Q4.0 is set if the following conditions exist:
•  There is a signal state of "1" at inputs I0.0 and at I0.1
•  AND MW0 >= MW2

!--RELATED-POSTS-STARTS-->

Comparison Instructions


 Overview of Comparison Instructions 
Description
IN1 and IN2 are compared according to the type of comparison you choose:
==  IN1  is equal to  IN2
<>  IN1  is not equal to  IN2
>  IN1  is greater than  IN2
<  IN1  is less than  IN2
>=  IN1  is greater than  or equal to  IN2
<=  IN1  is less than  or  equal to  IN2
If the comparison is true, the RLO of the function is "1". It is linked to the RLO of a rung network by
AND if the compare element is used in series, or by OR if the box is used in parallel.
The following comparison instructions are available:
•  CMP ? I    Compare Integer
 CMP ? D      Compare Double Integer  
•  CMP ? R   Compare Real !--RELATED-POSTS-STARTS-->

Tuesday, July 3, 2012

After installed S7 v5.5 you should give crack for working in S7 you can get crack from web site.

Now open Simatic Manager from desktop or Click Start>>All program>>SIMATIC>>Simatic Manager
after open Simatic Manager Click on File then New project Wizard Its appear like that

Then click on "Next" Which appear like that

Now select your CPU type I choose here CPU319  3PN-DP then click next

Click on checkbox for all block,language type LAD
after that Click on Check box of create with source files
Then click next !--RELATED-POSTS-STARTS-->

Monday, July 2, 2012

SR Set-Reset Flip Flop


SR  Set-Reset Flip Flop 







Parameter  Data Type      Memory Area       Description
<address>   BOOL      I, Q, M, L, D           Set or reset bit
     S           BOOL     I, Q, M, L, D       Enable set instruction
     R           BOOL     I, Q, M, L, D       Enable reset instruction
     Q           BOOL     I, Q, M, L, D      Signal state of <address>
Description 
SR (Set-Reset Flip Flop) is set if the signal state is "1" at the S input, and "0" at the R input. Otherwise,
if the signal state is "0" at the S input and "1" at the R input, the flip flop is reset. If the RLO is "1" at
both inputs, the order is of primary importance. The SR flip flop executes first the set instruction then
the reset instruction at the specified <address>, so that this address remains reset for the remainder
of program scanning.
The S (Set) and R (Reset) instructions are executed only when the RLO is "1". RLO "0" has no effect
on these instructions and the address specified in the instruction remains unchanged.
MCR (Master Control Relay) dependency
MCR dependency is activated only if a SR flip flop is placed inside an active MCR zone. Within an
activated MCR zone, if the MCR is on; the addressed bit is set to "1" or reset to "0" as described
above. If the MCR is off, the current state of the specified address remains unchanged regardless of
input states.



If the signal state is "1" at input I0.0 and "0" at I0.1, memory bit M0.0 is set and output Q4.0 is "1".
Otherwise, if the signal state at input I0.0 is "0" and at I0.1 is "1", memory bit M0.0 is reset and output
Q4.0 is "0". If both signal states are "0", nothing is changed. If both signal states are "1", the reset
instruction dominates because of the order; M0.0 is reset and Q4.0 is "0".

If the example is within an activated MCR zone:
When MCR is on, Q4.0 is set or reset as described above.
When MCR is off, Q4.0 is left unchanged regardless of input states.

!--RELATED-POSTS-STARTS-->

---(SAVE) Save RLO into BR Memory


---(SAVE)    Save RLO into BR Memory 
Symbol
---( SAVE )
Description
---(SAVE) (Save RLO into BR Memory) saves the RLO to the BR bit of the status word. The first check
bit /FC is not reset. For this reason, the status of the BR bit is included in the AND logic operation in
the next network.
For the instruction "SAVE" (LAD, FBD, STL), the following applies and not the recommended use
specified in the manual and online help:
We do not recommend that you use SAVE and then check the BR bit in the same block or in
subordinate blocks, because the BR bit can be modified by many instructions occurring inbetween. It
is advisable to use the SAVE instruction before exiting a block, since the ENO output (= BR bit) is then
set to the value of the RLO bit and you can then check for errors in the block.

!--RELATED-POSTS-STARTS-->

---( P )--- Positive RLO Edge Detection


---( P )---    Positive RLO Edge Detection 
Symbol
<address>
  ---( P )---

Parameter    Data Type      Memory Area     Description
<address>       BOOL        I, Q, M, L, D      Edge memory bit, storing the previous signal state of RLO 
Description
---( P )--- (Positive RLO Edge Detection) detects a signal change in the address from "0" to "1" and
displays it as RLO = "1" after the instruction. The current signal state in the RLO is compared with the
signal state of the address, the edge memory bit. If the signal state of the address is "0" and the RLO
was "1" before the instruction, the RLO will be "1" (pulse) after this instruction, and "0" in all other
cases. The RLO prior to the instruction is stored in the address.



The edge memory bit M0.0 saves the old RLO state. When there is a signal change at the RLO from
"0" to "1", the program jumps to label CAS1.

!--RELATED-POSTS-STARTS-->

---( N )--- Negative RLO Edge Detection


---( N )---    Negative RLO Edge Detection
Symbol
<address>
---( N )

Parameter      Data Type    Memory Area        Description
 <address>       BOOL         I, Q, M, L, D    Edge memory bit, storing the previous signal state of RLO 
Description 
---( N )--- (Negative RLO Edge Detection) detects a signal change in the address from "1" to "0" and
displays it as RLO = "1" after the instruction. The current signal state in the RLO is compared with the
signal state of the address, the edge memory bit. If the signal state of the address is "1" and the RLO
was "0" before the instruction, the RLO will be "1" (pulse) after this instruction, and "0" in all other
cases. The RLO prior to the instruction is stored in the address.


The edge memory bit M0.0 saves the old RLO state. When there is a signal change at the RLO from
"1" to "0", the program jumps to label CAS1.

!--RELATED-POSTS-STARTS-->

RS Reset-Set Flip Flop


RS  Reset-Set Flip Flop 








Parameter     Data Type      Memory Area          Description
<address>         BOOL         I, Q, M, L, D        Set or reset bit
   S                   BOOL         I, Q, M, L, D        Enabled reset instruction
   R                   BOOL         I, Q, M, L, D        Enabled reset instruction
   Q                   BOOL         I, Q, M, L, D          Signal state of<address>
Description 
RS (Reset-Set Flip Flop) is reset if the signal state is "1" at the R input, and "0" at the S input.
Otherwise, if the signal state is "0" at the R input and "1" at the S input, the flip flop is set. If the RLO is
"1" at both inputs, the order is of primary importance. The RS flip flop executes first the reset
instruction then the set instruction at the specified <address>, so that this address remains set for the
remainder of program scanning.
The S (Set) and R (Reset) instructions are executed only when the RLO is "1". RLO "0" has no effect
on these instructions and the address specified in the instruction remains unchanged.
MCR (Master Control Relay) dependency
MCR dependency is activated only if a RS flip flop is placed inside an active MCR zone. Within an
activated MCR zone, if the MCR is on, the addressed bit is reset to "0" or set to "1" as described
above. If the MCR is off, the current state of the specified address remains unchanged regardless of
input states.


If the signal state is "1" at input I0.0 and "0" at I0.1, memory bit M0.0 is set and output Q4.0 is "0".
Otherwise, if the signal state at input I0.0 is "0" and at I0.1 is "1", memory bit M0.0 is reset and output
Q4.0 is "1". If both signal states are "0", nothing is changed. If both signal states are "1", the set
instruction dominates because of the order; M0.0 is set and Q4.0 is "1".

If the example is within an activated MCR zone:
When MCR is on, Q4.0 is reset or set as described above.
When MCR is off, Q4.0 is left unchanged regardless of input states

!--RELATED-POSTS-STARTS-->

---( S ) Set Coil


---( S )    Set Coil
Symbol
<address>
---( S )

Parameter               Data Type                 Memory Area             Description
<address>                  BOOL                   I, Q, M, L, D                Set bit

Description
---( S ) (Set Coil) is executed only if the RLO of the preceding instructions is "1" (power flows to the
coil). If the RLO is "1" the specified <address> of the element is set to "1".
An RLO = 0 has no effect and the current state of the element's specified address remains
unchanged.
MCR (Master Control Relay) dependency
MCR dependency is activated only if a set coil is placed inside an active MCR zone. Within an
activated MCR zone, if the MCR is on and there is power flow to a set coil; the addressed bit is set to
the "1" state. If the MCR is off, the current state of the element's specified address remains unchanged
regardless of power flow status.


The signal state of output Q4.0 is "1" if one of the following conditions exists:
The signal state is "1" at inputs I0.0 and I0.1
Or the signal state is "0" at input I0.2.
If the RLO is "0", the signal state of output Q4.0 remains unchanged.

If the example rungs are within an activated MCR zone:
When MCR is on, Q4.0 is set as described above.
When MCR is off, Q4.0 is left unchanged regardless of RLO state (power flow status).

!--RELATED-POSTS-STARTS-->

---( R ) Reset Coil


---( R )    Reset Coil
Symbol
<address>
---( R )

Parameter     Data Type       Memory Area             Description
<address>      BOOL        I, Q, M, L, D, T, C          Reset bit
Description
---( R ) (Reset Coil) is executed only if the RLO of the preceding instructions is "1" (power flows to the
coil). If power flows to the coil (RLO is "1"), the specified <address> of the element is reset to "0". A
RLO of "0" (no power flow to the coil) has no effect and the state of the element's specified address
remains unchanged. The <address> may also be a timer (T no.) whose timer value is reset to "0" or a
counter (C no.) whose counter value is reset to "0".
MCR (Master Control Relay) dependency
MCR dependency is activated only if a reset coil is placed inside an active MCR zone. Within an
activated MCR zone, if the MCR is on and there is power flow to a reset coil; the addressed bit is reset
to the "0" state. If the MCR is off, the current state of the element's specified address remains
unchanged regardless of power flow status.


The signal state of output Q4.0 is reset to "0" if one of the following conditions exists:
The signal state is "1" at inputs I0.0 and I0.1
Or the signal state is "0" at input I0.2.
If the RLO is "0", the signal state of output Q4.0 remains unchanged.
The signal state of timer T1 is only reset if:
the signal state is "1" at input I0.3.
The signal state of counter C1 is only reset if:
the signal state is "1" at input I0.4.

If the example rungs are within an activated MCR zone:
When MCR is on, Q4.0, T1, and C1 are reset as described above.
When MCR is off, Q4.0, T1, and C1 are left unchanged regardless of RLO state (power flow status).

!--RELATED-POSTS-STARTS-->

---( # )--- Midline Output


---( # )---    Midline Output 
Symbol 
<address> 
  ---( # )--- 

Parameter    Data Type       Memory Area        Description 
<address>     BOOL          I, Q, M, *L, D        Assigned bit 
* An L area address can only be used if it is declared TEMP in the variable declaration table of a logic 
block (FC, FB, OB). 
Description  
---( # )--- (Midline Output) is an intermediate assigning element which saves the RLO bit (power flow 
status) to a specified <address>. The midline output element saves the logical result of the preceding 
branch elements. In series with other contacts, ---( # )--- is inserted like a contact. A ---( # )--- element 
may never be connected to the power rail or directly after a branch connection or at the end of a 
branch. A negated ---( # )--- can be created by using the ---|NOT|--- (invert power flow) element. 
MCR (Master Control Relay) dependency 
MCR dependency is activated only if a midline output coil is placed inside an active MCR zone. Within 
an activated MCR zone, if the MCR is on and there is power flow to a midline output coil; the 
addressed bit is set to the current status of power flow. If the MCR is off, a logic "0" is written to the 
specified address regardless of power flow status. 

!--RELATED-POSTS-STARTS-->