課件教案成果ncfreal_第1頁
課件教案成果ncfreal_第2頁
課件教案成果ncfreal_第3頁
全文預(yù)覽已結(jié)束

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)

文檔簡介

_NCF204_ReadActualPosition_REAL(

1/3)

FBInstanceArea

StartAddress

EndAddress

Size

NoRetain

H512

H1407

896

Retain

H1408

H1535

128

Timers

T3072

T4095

1024

Counters

C3072

C4095

1024

Specifyunu

sedarea.

Therequire

dsizevariesd

FBInstancerea

StartAddress

EndAddress

Si

NoRetain

D32020

D32767

748

Retain

H1408

H1535

128

Timers

T3072

T4095

1024

Counters

C3072

C4095

1024

NCF204

ReadPresentPosition(REAL)_NCF204_ReadActualPosition_REAL

Basicfunction

Readsthepresentpositionofanaxis.

Symbol

_NCF204_ReadActualPosition_REAL

AlwaysON(P_On) (BOOL) (BOOL)

EN ENO

UnitNo. (INT) (BOOL) NormalendUnitNo Done

AxisNo. (INT) (BOOL) ErrorflagAxis Error

Outputenablebit (BOOL) (WORD) Errorcode

Enable ErrorID

(REAL) PresentpositionPosition

Filename

Lib\FBL\omronlib\PositionController\NCF\NCF204ReadActualPositionREAL12.cxf

Applicablemodels

PositionControlUnit

CJ1W-NCF71,CS1W-NCF71

CPUUnit

CS1*-CPU**HUnitVersion3.0orlaterCJ1*-CPU**HUnitVersion3.0orlaterCJ1M-CPU**UnitVersion3.0orlater

CP1H

CX-Programmer

Version5.0orlater

Languagesinfunctionblock

definitions

Ladderprogramming

Conditionsforusage

ThefollowingconditionsforusageshouldbethePositionControlUnitversion1.2orearlier.(ItwillnotberequiredinthePositionControlUnitversion1.3orlater)

CX-ProgrammerSetting

ThefunctionblocksrelatedtothePositionControlUnitswillnotoperateiftheareaH512orhigher(defaultsetting)isspecifiedastheNonRetainAreathroughtheFunctionblockmemoryallocation.Makesuretochangethememoryareatounusedarea(DMorEM,forexample)fromtheCX-Programmer.Tochangethisvalue,clickPLC/FunctionBlockMemory/FunctionBlockMemoryAllocationfromthe Bar.

FunctionBlockMemoryAllocation[NewPLC1]

OK

CancelEditDefault

ependingontheusedFBandthenumberofFBs.Ifanareabeingusedintheladderprogramisspecifiedorsufficientspacecannotbefound,theCX-Programmerwilldisyacompileerror.

FunctionBlocMemoryAllocation[NewPLC1]

OK

CancelEdit

Default Forexample,tousethememoryareafromD32020toD32767

Advanced (748words),specifythe

addressesasshownintheleft.

Functiondescription

ThepresentpositionoftheaxisofthespecifiedUnitNo.(UnitNo)andAxisNo.(Axis)iscontinuouslyupdatedinthe“Presentposition(Position)”whiletheOutputenablebit(Enable)isON.WhentheOutputenablebit(Enable)turnsOFF,the“Presentposition(Position)”isclearedtoallzeros.

TheNormalend(Done)turnsONwhenthepresentpositiondataisvalid.

TheErrorflag(error)willbeturnedONandtheErrorcode(ErrorID)willbeoutputifanerroroccursfortheFB.(TheywillnotbeturnedONwhenaxiserrorsoccurs.)

ThisstatuswillberesetthentheOutputenablebit(Enable)turnsOFF.

Thesestatus(Done/Error/ErrorID)willberesetthentheOutputenablebit(Enable)turnsOFF.

ENONOFF

ENOONOFF

EnableON

OFF

DoneONOFF

ErrorONOFF

ReadPresentONPositionOFF

KindofFBdefinition

Alwayecutiontype.

ConnecttheENinputtotheAlwaysONFlag(P_On).

Thesameinstancecannotbeusedintwoormoreces.

ENinput

condition

?ConnecttheENinputtotheAlwaysONFlag(P_On).

IfanotherbitisconnectedtoEN,theFBoutputswillbeheldwhentheconnectedbitturnsOFF.

RestrictionsOther

?TheErrorflag(Error)andErrorcode(ErrorID)forthisFBreflectthestatusoftheMemoryAreainthePositionControlUnitwithoutaltion.

?ThisFBusesUnitErrorReset,WriteData,ReadDataandSaveDataBitsofthePositionControlUnit(seeNote).Therefore,donotturnthesebitsONorOFFbetweentheperiodfromtherisingedgeofENtotherisingedgeofENO.Forthesamereason,donotusethesebitsforcoiloutputs(OUTcommands).

?TheoutputvariableofFBmaynotchangeevenifENisturnedON.Inthatcase,checkifanyofUnitErrorReset,WriteData,ReadDataandSaveDataBitisleftON.

Note:

Forcalculationofbitaddresses,thesebitsarereferencedinthisFBinthefirstexecutionofeachinstance,andwhenchanging"UnitNo.(UnitNo)","AxisNo.(Axis)"oftheinputvariableandset“Outputenablebit(Enable)".

Applicationexample

WhenturningtheBitAONfromOFF,thepresentpositionofaxis1oftheServomotorconnectedtothePositionControlUnitwithunitnumber0isreadandstoredinD0.

UnitNo.:0

CPU NCF

Servomotor

Axis1

Sample

_NCF204_ReadActualPosition_REAL

AlwaysON(P_On) (BOOL) (BOOL)

EN ENO

UnitNo. (INT) (BOOL) Normalend

&0 UnitNo Done BitB

AxisNo. (INT) (BOOL) Errorflag

&1 Axis Error BitC

Outputenablebit (BOOL) (WORD) Errorcode

BitA Enable ErrorID D100

(REAL) Presentposition

Position D0

Related

manuals

PositionControlUnitsOPERATIONMANUAL(W426-E1)12-4ErrorCodes

VariableTablesInputVariables

Name

Variablename

Datatype

Default

Range

Description

EN

EN

BOOL

1(ON):FBstarted

0(OFF):FBnotstarted

UnitNo.

UnitNo

INT

&0

&0to&15

Specifytheunitnumber.

AxisNo.

Axis

INT

&1

&1to&16

Specifytheaxisnumber.

Outputenablebit

Enable

BOOL

0(OFF)

TurnONtoenableoutput.TurnOFFtoresettheoutput.

OutputVariables

Name

Variablename

Datatype

Range

Description

ENO

ENO

BOOL

1(ON):FBoperatingnormally

0(OFF):FBnotoperatingnormally

?FBnotstarted

?Inputvariableoutoftherange

?FBendedwitherror

?CommonParameterscouldnotberead

Normalend

Done

BOOL

TurnsONforanormalend.

Errorflag

Error

BOOL

TurnsONforanerrorend.

Errorcode

ErrorID

WORD

ReturnstheerrorcodewhenanerrorhasoccurredintheFB.RefertotheRelatedManualsfordetailsonerrors.

Acodeof#0000willbereturnedifanyofthefollowingconditionsissatisfied.

?Inputvariableisoutofrange.

?ThecommonparametersofthePositionControlUnitsareoutofrange.

?Notestablishedcommunicationswithaspecifiedaxis.

Presentposition

Position

REAL

ThepresentpositionoftheaxiscontrolledbythePositionControlUnit.

VersionHistory

Version

Date

Contents

1.00

2004.06.

Originalproduction

1.10

2005.01.

Limitationaboutthesettingtimingwith"UnitNo."and"AxisNo."wasremoved.

1.20

2007.11.

Limitationonreading“Presentposition(Position)"wasremoved.

UpgradeDetails

Version

DetailedContents

1.10

Inversion1.0x,"UnitNo.(UnitNo)"and"AxisNo.(Axis)"mustbesetwhenENwasONand"Outputenablebit(Enable)"wasOFF.Thismeans

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論