_NCF710_SetAbsOffset (1/4) NCF 710 Absolute Encoder's Origin Position Offset Setting _NCF710_SetAbsOffset Basic function Sets an origin position offset of the absolute encoder. Symbol (BOOL) ENO (BOOL) Done _NCF710_SetAbsOffset Start Setting completed (BOOL) EN (INT) UnitNo (INT) Axis (BOOL) Execute (BOOL) Error (WORD) ErrorID Unit No. Axis No. Error flag Error code Always ON (P_On) File name Lib\FBL\omronlib\PositionController\NCF\_NCF710_SetAbsOffset11.cxf Position Control Unit CJ1W-NCF71, CS1W-NCF71 CPU Unit CS1*-CPU**H Unit Version 3.0 or later CJ1*-CPU**H Unit Version 3.0 or later CJ1M-CPU** Unit Version 3.0 or later CP1H Applicable models CX-Programmer Version 5.0 or later Languages in function block definitions Ladder programming Conditions for usage The following conditions for usage should be the Position Control Unit version 1.2 or earlier. (It will not be required in the Position Control Unit version 1.3 or later) ■CX-Programmer Setting The function blocks related to the Position Control Units will not operate if the area H512 or higher (default setting) is specified as the Non Retain Area through the Function block memory allocation. Make sure to change the memory area to unused area (DM or EM, for example) from the CX-Programmer. To change this value, click PLC/Function Block Memory/Function Block Memory Allocation from the Menu Bar. Function Block Memory Allocation [NewPLC1] FB Instance Area Start Address End Address Size OK Cancel Edit Default Advanced No Retain Retain Timers Counters H512 H1408 T3072 C3072 H1407 H1535 T4095 C4095 896 128 1024 1024 Function Block Memory Allocation [NewPLC1] FB Instance Area Start Address End Address Size OK Cancel Edit Default Advanced No Retain Retain Timers Counters D32020 H1408 T3072 C3072 D32767 H1535 T4095 C4095 748 128 1024 1024 For example, to use the memory area from D32020 to D32767 (748 words), specify the addresses as shown in the left. Specify unused area. The required size varies depending on the used FB and the number of FBs. If an area being used in the ladder program is specified or sufficient free space cannot be found, the CX-Programmer will display a compile error. _NCF710_SetAbsOffset (2/4) Function description Sets the origin offset of the absolute encoder for the axis specified with Unit No. and Axis No. when Start (Execute) is turned ON. This FB processes the feedback present position to set the offset in the Servo Parameter Absolute encoder zero point position offset (Refer to the Restrictions Other). The Error flag (Error) will be turned ON and the Error code (ErrorID) will be output if an error occurs for the FB. This will not occur for error in other FBs or other instances of the FB. These statuses (Done/Error/ErrorID) will be reset when the Start (Execute) turns OFF. If the Start Bit (Execute) turns OFF before the operation has been completed, the status will be set for at least one cycle when corresponding conditions have occurred. This FB should be used according to the following procedure: ・Set so that the absolute encoder is used as an absolute encoder. ・Setup the absolute encoder. ・Start MECHATROLINK communications (i.e., establish connection). ・Stop the axis at the position to be set as a machine origin. ・When executing this FB, the No Origin Flag turns ON meaning an origin is not established, and “Setting completed (Done)” turns ON. ・By executing SERVO LOCK, the No Origin Flag turns OFF and the origin is established. Reflecting the origin position offset, the present position is Clear to 0. Internal processing EN Done Error ON OFF ON OFF ON OFF ENO ON OFF Execute ON OFF ON OFF Kind of FB definition Always execution type. Connect the EN input to the Always ON Flag (P_On). The same instance cannot be used in two or more places. EN input condition ・Connect the EN input to the Always ON Flag (P_On). If another bit is connected to EN, the FB outputs will be held when the connected bit turns OFF. Restrictions Other ・Following are Servo Parameters which this FB sets. Drive PRM No. Parameter name Size Unit Setting range W-Series Pn808 Absolute encoder zero point position offset 4 command units -1073741823 to 1073741823 G-Series Pn200 (808) Absolute origin offset 4 command units -1073741823 to 1073741823 ・This FB uses Unit Error Reset, Write Data, Read Data and Save Data Bits of the Position Control Unit (see Note). Therefore, do not turn these bits ON or OFF between the period from the rising edge of EN to the rising edge of ENO. For the same reason, do not use these bits for coil outputs (OUT commands). ・The output variable of FB may not change even if EN is turned ON. In that case, check if any of Unit Error Reset, Write Data, Read Data and Save Data Bit is left ON. ・This FB uses the Device Setup/ Servo Unlock/ Read Servo Parameter/ Save Servo Parameter Bits in the Axis Operating Output Memory Areas. Therefore, do not turn these bits ON or OFF until the operation is completed. For the same reason, do not use these bits for coil outputs (OUT commands). Note: For calculation of bit addresses, these bits are referenced in this FB in the first execution of each instance, and when changing "Unit No. (UnitNo)", "Axis No. (Axis)" of the input variable and set "Start (Execute) ". _NCF710_SetAbsOffset (3/4) Application example Turning the Start Trigger ON from OFF will set the origin offset of the absolute encoder on the Servomotor (axis1) connected to the Position Control Unit with a unit number 0. _NCF710_SetAbsOffset Sample CPU NCF Unit No.: 0 Servomotor Axis 1 Start Trigger Bit A Bit B Bit C Bit A Always ON (P_On) (BOOL) EN (BOOL) ENO (INT) UnitNo (BOOL) Done (INT) Axis (BOOL) Execute (BOOL) Error (WORD) ErrorID Unit No. &0 Axis No. &1 Start Bit A Setting completed Bit B Error flag Bit C Error code D0 Related manuals Position Control Units OPERATION MANUAL (W426-E1) 8-6-5 Absolute Encoder’s Origin (Zero Point) Position Offset Setting _NCF710_SetAbsOffset (4/4) ■Variable Tables Input Variables Name Variable name Data type Default Range Description EN EN BOOL 1 (ON): FB started 0 (OFF): FB not started Unit No. UnitNo INT &0 &0 to &15 Specify the unit number. Axis No. Axis INT &0 &1 to &16 Specified value corresponds to the Axis No. Start Execute BOOL 0(OFF) : Executes setting Output Variables Name Variable name Data type Range Description ENO ENO BOOL 1 (ON): FB operating normally 0 (OFF): FB not operating normally ・FB not started ・Input variable out of the range ・FB ended with error ・Common Parameters could not be read Setting completed Done BOOL 1 (ON) indicates that setting has been completed. Error flag Error BOOL 1 (ON) indicates that an error has occurred in the FB. Error code ErrorID WORD Returns the error code when an error has occurred in the FB. Refer to the Related Manuals for details on errors. A code of #0000 will be returned if any of the following conditions is satisfied. ・Input variable is out of range. ・The common parameters of the Position Control Units are out of range. ・Not established communications with a specified axis. ・While either of Device Setup/Servo Unlock/Read Servo Parameter/Save Servo Parameter is in operation, a corresponding command bit has been changed by other FB. ■Version History Version Date Contents 1.00 2005.01. Original production 1.10 2005.04. Changed status for usage ■The detailed contents of the upgrading Version Detailed Contents 1.10 In the version 1.0x, the Interrupt Feeding Bit in the Axis Operating Output Memory Area was always monitored. Therefore, when turning ON the Interrupt Feeding Bit during processing, the FB output an error regardless of the status of processing. In the version 1.0, this limitation has been removed. ■Note This document explains the function of the function block. It does not provide information of restrictions on the use of Units and Components or combination of them. For actual applications, make sure to read the operation manuals of the applicable products.