omron — Device Setup

Device Setup Device Setup The SETDEVICE program instruction allows the external encoders to be initialized and various parameters to be set up. The action taken by the SETDEVICE instruction depends upon the value of the command parameter. The syntax of the SETDEVICE instruction is SETDEVICE (0, unit, error, command) p1, p2 The following table describes the valid commands. Command Parameter Values eV+Language User's Guide, v2.x, 18318-000 Rev A Page 219 Command Description 0 Initialize Device This command sets all scale factors, offsets, and limits to their default values, as follows: offset = 0; scale factor = 1; no limit checking.

This command also resets any errors for the specified device.This command should be issued before any other commands for a particular unit and before using the DEVICE real-valued function for the unit. 1 Reset Device This command clears any errors associated with this encoder unit. It does not affect the scale factor, offset, or limits. 8 Set Scale Factor This command sets the position and velocity scale factor for this encoder unit to the value of parameter p1. The units are millimeters per encoder count. The scale factor must be set before setting the offset or limits. If the scale factor is changed, the offset and limit values will need to be updated.

9 Set Position Offset This command sets the position offset for this encoder unit to the value of parameter p1. The units are millimeters. The scale factor must be set before setting the offset. 10 Set Position Limits This command sets the position limits for the encoder unit to the values of optional parameters p1 and p2, which are the lower and upper limits, respectively. If a parameter is omitted, no checking is performed for that limit. The units are millimeters. The scale factor must be set before setting the limits.