You are on page 1of 3

NC VAR -READING NC PARAMETERS THROU PLC

Open an NC Variable; Go to project and select new; You will find a dialog box as shown below; Select ncv_NcData.mdb

Goto HELP--INFO ABOUT VARIABLES (to find the variable which is to be read)
Ex-To read R parameters/Axis position in MCS, select the following option.

R PARAMETERS AXIS POSITION

Double click on “rpa(.)” .You will find one more window . Double click on selected parameter. You will find one more window .
Unit No: 1 (Channel Number)
Line: 201 (To read R200)
Save this file in some location with *.var extension. Then go to code and select
option “Selections” to create a DB; Create a DBxx and mention the DB name
e.g. R_Values. Then click on code select option generate to create a source file.
Save *.awl file in some location.
Once again click on code select option “to STEP7 project”.
Step7 project window will get open; Select the concerned project.
Click on “S7 Program” And also select the option “transfer db and symbol”. Press OK

After executing that event a source file will get transferred to PLC project.
This file will get complied; the values of this source file will get transferred to DBxx
NOTE: There should not be any errors or warning message,

now open the step 7 project in which the DB is transferred and Open tht DBxx and observe:

now your DB is created in PLC.. That is NC VAR's job is over.. Now you have to program it in Step7--
if we open those DBs in step7, we can see the offset address and name of that DB. After Execution of FB2, values will be transferred to this location.

to program FB2 (GET function)


in OB1, call FB2 and select any instant DB.
ex. Call FB2,db140 // here DB140 will be generated.
>>>after positive edge of this signal, parameter reading kob will be started
>>> these are the No, of variable to be read in this call of FB2.. We can call this FB no. of times.

>>> as per syntax, write name given to this DB then "." and then offset address
ex."r para".C1_SPARP_actLineNumber1

Example

CALL "GET" , DB149 //call fb2


Req :=L0.0 // after L0.0 positive edge, parameters will be read.
NumVar :=2 // Max number of variable is 2 // max no. of 2 variables can be read in this FB
Addr1 :="R_Vaules".C1_RP_rpa200_1 // name of DB in " " and name of offset address of that DB (which is called with the NC var software
Unit1 :=
Column1:=
Line1 :=
Addr2 :="Z_Position".C1_SEMA_measPos13_5 // Take Z axis 1st meas sys value into PLC--here you can write the DB address also
Unit2 :=
Column2:=
Line2 :=
Addr3 :=
Unit3 :=
Column3:=
Line3 :=
Addr4 :=
Unit4 :=
Column4:=
Line4 :=
Addr5 :=
Unit5 :=
Column5:=
Line5 :=
Addr6 :=
Unit6 :=
Column6:=
Line6 :=
Addr7 :=
Unit7 :=
Column7:=
Line7 :=
Addr8 :=
Unit8 :=
Column8:=
Line8 :=
Error :="GET1_eror_flg" //error flag ex m100.1
NDR :="GET1_done_flg"
State :=MW68
RD1 :="Read _R _PLC".R_201 // Store R201 variable value in this memory location
RD2 :="Read _R _PLC".Z_POS // Store Z axis position in This PLC location.
RD3 :=
RD4 :=
RD5 :=
RD6 :=
RD7 :=
RD8 :=
NOP 0

You might also like