Page 1
This manual describes the commands used to create software for establishing the settings for the MG40 series to perform operations and for acquiring data from the series. For details on how to use the software created with these commands, refer to the operating instructions provided with the software or contact your dealer/distributor.
Th e term “command” refers to the language used for the control which is exercised in order for the computer or PLC to instruct the MG40 series to carry out operations or acquire information from the series. By using the commands correctly, it is possible to establish the MG40 series settings, issue instructions for the series to operate and to acquire its statuses, measurement results and other information.
[31B] = Axis B for MG42 hub unit #31 [31C] = Axis C for MG42 hub unit #31 [31D] = Axis D for MG42 hub unit #31 Th e “= ” part is abbreviated for commands with no parameters. MG40 Series...
A protocol of the application layer of its own is stipulated for the data interface. Th is means that if the interface is to be connected to an existing network, it may be necessary to apply to the network administrator for the connection and/or change the network equipment settings and/or computer security settings. MG40 Series...
Input “MG41” as the login name, and transmit the line feed code. login: MG41 CR LF “Password:” now appears. Password: Input MG41 as the password, and transmit the line feed code. login: MG41 CR LF Password: MG41 CR LF Th is completes the connection to the command interface. MG40 Series...
If a return is not sent even when a command has been sent, it is possible that the “no response” has been set as the command response. When “response” is set using the command response command (CRP), a return will be sent. CRP command MG40 Series...
Level 2 0.000 0.002 0.001 Level 1 0.000 Use the CMM command to set “1” which signifi es 4 levels and “0” which signifi es the current value. CMM command CMM=1 0 CR LF OK000 CR LF MG40 Series...
Page 81
Use the CMS command to set the comparator setting group number to be used. (In this example, the comparator group number is set as group number 1.) CMS command CMS[00A]=01 CR LF OK000 CR LF CMS[01D]=01 CR LF OK000 CR LF MG40 Series...
Data format (ASCII data) Reference Th e data request command re-calculates the data and outputs it so an error results if there is an axis whose data updating has been fi xed by the latch or pause setting. MG40 Series...
Port numbers 1024 to 49151 : Th ese may already be used by other systems. <Example> Setting 49154 as the port number Use the NPN command to set 49154 as the port number. NPN command NPN=49154 CR LF OK000 CR LF MG40 Series...
Th e data sent is in the binary format. For details, refer to “5. Data Formats”. Stopping the data transmission Set transmission stop using the data transmission control settings. NDT command Use the NDT command to set “0” which signifi es transmission stop. NDT=0 CR LF OK000 CR LF MG40 Series...
128 bits; used for communication handshaking and status notifi cation. Remote registers Word input/output expressed by RWr and RWw; there are 16 inputs and 16 outputs, a register having a total of 32 bytes; used for command and data communication. MG40 Series...
When commands are sent or execution results are returned, the buff ers are used to hold 32 ASCII code characters; when data is transferred, they are used to hold binary data complying with the binary data format specifi cations. MG40 Series...
Th e response is written in the buff er, and “1” is set for IRX. (Th e command execution is completed.) Th e MG41 waits for IRY to be set to “0.” (Th e MG41 waits for the response to be received.) “0” is set for IRX. (Th e MG41 checks that the response has been received.) MG40 Series...
[01D] = Axis D for MG42 hub unit #01 [31A] = Axis A for MG42 hub unit #31 [31B] = Axis B for MG42 hub unit #31 [31C] = Axis C for MG42 hub unit #31 [31D] = Axis D for MG42 hub unit #31 MG40 Series...
MOD=<Operation mode> <Operation mode> 0 : Setup mode 1 : Measurement mode Target MG41 main unit MOD? Example of use Transmission : (Acquire the current operation mode.) Return : MOD=1 (Current mode is measurement mode.) Compatible command None MG40 Series...
Page 93
Transmission : (Reset all the axes for the MG42 hub unit ID03.) Return : OK000 (Successfully completed.) SVZ[ Transmission : (Reset all the axes for the system.) Return : OK000 (Successfully completed.) Compatible command Designated axis RES MG40 Series...
Page 94
Command format Return format Execution results Target Designated axis, MG42 hub unit, all axes PSR[ Examples of use Transmission : (Call the preset values for all the axes.) Return : OK000 (Successfully completed.) Compatibility command Designated axis RCL MG40 Series...
Page 95
Return format Execution results Target Designated axis DPC[03B] Examples of use Transmission : (Release the wait to go past reference point status for axis B for the MG42 hub unit ID03.) Return : OK000 (Successfully completed.) Compatible command None MG40 Series...
Page 96
2 : Reference point detected Target Designated axis STR[00A]? Example of use Transmission : (Acquire the reference point status of axis A for the MG41 main unit.) Return : STR[00A]=1 (Wait to go past reference point status) Compatible command None MG40 Series...
Page 97
Command format Return format Execution results Target Designated axis MCR[01B] Examples of use Transmission : (Relocate the master calibration value of axis B for the MG42 hub unit ID01.) Return : OK000 (Successfully completed.) Designated axis MR Compatible command MG40 Series...
Page 98
Return format Execution results Target Single axis, MG42 hub unit, all axes STA[ Examples of use Transmission : (Restart the peak calculation for all the axes.) Return : OK000 (Successfully completed.) Designated axis START Compatible command MG40 Series 4-10...
Page 99
Single axis, MG42 hub unit, all axes ]PAUOFF Examples of use Transmission : (Set pause to “Off ” for all the axes for the MG42 hub unit ID01.) Return : OK000 (Successfully completed.) Designated axis PAUOFF Compatible command MG40 Series 4-11...
Page 100
Single axis, MG42 hub unit, all axes ]LCHOFF Examples of use Transmission : (Set latch to “Off ” for all the axes for the MG42 hub unit ID01) Return : OK000 (Successfully completed.) Designated axis LCHOFF Compatible command MG40 Series 4-12...
Page 101
4 : ABS value Target Single axis OPD[00B]? Examples of use Transmission : (Acquire the output data of axis B for the MG41 main unit.) Return : OPD=1 (Th e output data is the maximum value.) Compatible command None MG40 Series 4-13...
Page 102
16 : Comparator group number 16 Target Designated axis CMS[00A]? Examples of use Transmission : (Acquire the comparator group number for axis A for the MG41 main unit.) Return : CMS[00A]=16 (Th e group number is 16.) Compatible command None MG40 Series 4-14...
Page 103
Designated axis Command format Return format Data Target Designated axis, MG42 hub unit r[00B] Examples of use Transmission : Return : [00B]=3.4567 Compatible command Designated axis r For further details, refer to the “5. Data Formats”. MG40 Series 4-15...
Page 104
Designated axis, MG42 hub unit, all axes MRB[00 Examples of use Transmission : (Acquire the ABS value memory data for all the axes for the MG41 main unit.) Compatible command None For further details, refer to the “5. Data Formats”. MG40 Series 4-16...
Page 105
Return format NDT=<Value> <Standby time> <Value> 0 : Transmission stopped 1 : Transmission underway <Standby time> (ms) 10 to 1000 Target MG41 main unit NDT? Examples of use Transmission : Return : NDT=0 100 Compatible command None MG40 Series 4-17...
3 : 1 μm (0.00005”) 4 : 5 μm (0.0001”) 5 : 10 μm (0.0005”) 0.00002" when the input resolution is 0.5 μm Target Designated axis OPR[00A]? Examples of use Transmission : Return : OPR[00A]=3 Compatible command Designated axis SDR? MG40 Series 4-18...
Page 107
The command acquires the input resolution setting. IPR Designated axis ? Command format Return format IPR Designated axis =<Resolution> <Resolution> 1 : 0.1 μm 2 : 0.5 μm Target Designated axis IPR[00A]? Examples of use Transmission : Return : IPR[00A]=1 Compatible command None MG40 Series 4-19...
Page 108
Command format Return format MCM=<Value> <Value> 0 : Off (Master calibration is not used.) 1 : On (Master calibration is used.) Target MG41 main unit MCM? Examples of use Transmission : Return : MCM=0 Compatible command None MG40 Series 4-20...
Page 109
Area of use Th is function is used to set and acquire the area where the MG40 series is to be used. If it is not set, it will not be possible to transfer from the setup mode to the measuring mode.
Page 110
3 : 16 levels (2 groups) <Target value> 0 : Current value 1 : Maximum value 2 : Minimum value 3 : Peak to peak value Target Designated axis CMM[00A]? Examples of use Transmission : Return : CMM[00A]=3 1 Compatible command None MG40 Series 4-22...
Page 111
Corresponds to output resolution digit (no output when the value has not been set). Target Designated axis CMV[00A]0101? Examples of use Transmission : Return : CMV[00A]0101=12.3335 (12.3335 is the comparator value.) CMV[00B]0101? Transmission : Return : CMV[00B]0101= (No setting) Compatible command None MG40 Series 4-23...
Page 112
Data header Off Ethernet mode (Compatible command only) The command sets the data header to “None.” None Command format Return format Execution results Target MG41 main unit Examples of use Transmission : Return : OK000 Compatible command MG40 Series 4-24...
Page 113
The command acquires the axis separator used when data is to be output. SEP? Command format Return format SEP=<Value> <Value> 0 : Space 1 : Line feed (CRLF) Target MG41 main unit SEP? Examples of use Transmission : Return : SEP=1 Compatible command None MG40 Series 4-25...
Page 114
(For a multiple number of axes, a combination list with space separators is acquired.) ADD[00A]? Examples of use Transmission : Return : ADD=[00A][00B] ADD[31A]? Transmission : Return : ADD=[31A][31D] ADD[31A]? Transmission : Return : ADD=[31A] (No settings) Compatible command None MG40 Series 4-26...
Page 115
(Acquire the confi guration information of MG42 hub unit ID05.) Return : CFG[05]=04 008 {21050A} CFG[21 Transmission : (Acquire the confi guration information of MG42 hub unit ID21.) Return : CFG[21]=04 008 {21210C} Compatible command None MG40 Series 4-27...
Page 116
(Th e entire system is initialized to the factory status.) Return : OK000 INI[03 Transmission : (Th e numerical value settings of all axes for MG42 hub unit ID03 are initialized.) Return : OK000 Compatible command None MG40 Series 4-28...
Page 117
Save setting values Ethernet CC-Link mode The command saves the setting values. Command format Return format Execution results Target Entire system Save setting values Setting values saved. Examples of use Transmission : Return : OK000 Compatible command None MG40 Series 4-29...
Page 118
[02] : MG42 hub unit ID02 [31] : MG42 hub unit ID31 <Version information> Version information Target MG41 main unit, MG42 hub unit VER[00 Examples of use Transmission : Return : VER[00]=S010000 F010100 P010000 B122 Compatible command None MG40 Series 4-30...
Page 119
Transmission : Return : ERR=28203400 [01B] 61 (A 61 error occurred in axis B for hub unit ID01 at 20 hours 34 minutes 00 seconds on 28th.) ERR? Transmission : Return : ERR= (No error) Compatible command None MG40 Series 4-31...
Page 120
The command acquires the current time of the clock inside the MG41 main unit. CLK? Command format Return format CLK=<Value> <Value> YYMMDDHHMMSS format Target MG41 main unit CLK? Examples of use Transmission : Return : CLK=090228143012 (14 hours 30 minutes 12 seconds on February 28, 2009.) Compatible command None MG40 Series 4-32...
Page 121
The command acquires whether or not the execution results are to be returned. CRP? Command format Return format CRP=<Value> <Value> 0 : No response 1 : Response Target MG41 main unit CRP? Examples of use Transmission : Return : CRP=1 Compatible command None MG40 Series 4-33...
Page 122
The command acquires the Ethernet station number. NID? Command format <Station number> 00 to 07 Return format NID=<Station number> Target MG41 main unit NID? Examples of use Transmission : Return : NID=03 Compatible command None MG40 Series 4-34...
Page 123
The command acquires the Ethernet source station IP address. NIP? Command format Return format NIP=<IP address> <IP address> 1.0.0.1 to 233.255.255.254 Target MG41 main unit NIP? Examples of use Transmission : Return : NIP=192.168.1.10 Compatible command None MG40 Series 4-35...
Page 124
NMC=<MAC address> <MAC address> xx:xx:xx:xx:xx:xx ( “x” is a number from 0 to 9 or a letter from A to F) Target MG41 main unit NMC? Examples of use Transmission : Return : NMC=00:12:44:CE:3E:F5 Compatible command None MG40 Series 4-36...
Page 125
Measurement Acquire Ethernet mode mode The command acquires the gateway address. NGW? Command format Return format NGW=<Address> <Address> 1.0.0.1 to 223.255.255.254 Target MG41 main unit NGW? Examples of use Transmission : Return : NGW=192.168.1.1 Compatible command None MG40 Series 4-37...
Page 126
Ethernet mode mode The command acquires the subnet mask. NSM? Command format Return format NIP=<Subnet mask> <Subnet mask> 0.0.0.0 to 255.255.255.255 Target MG41 main unit NSM? Examples of use Transmission : Return : NIP=255.255.255.0 Compatible command None MG40 Series 4-38...
Page 127
The command acquires the protocol which is used by the data interface. NPC? Command format Return format NPC=<Value> <Value> 0 : TCP 1 : UDP Target MG41 main unit NPC? Examples of use Transmission : Return : NPC=0 Compatible command None MG40 Series 4-39...
Page 128
However, this does not apply for a network operating inside a company so the MG40 series supports all the port numbers in the range of 1 to 65535 under the IP standards with the exception of numbers 20, 21, 23 and 80.
Page 129
AXP Designated axis =<Product code> <Production year/month/day> <Serial number> <Product code> Product code (8 characters) <Serial number> Serial number (6 characters) <Production year/month/day> YYMMDD format (6 characters) Target Designated axis AXP[00A]? Examples of use Transmission : Return : AXP[00A]=12345678 100001 090220 Compatible command None MG40 Series 4-41...
Page 130
The command acquires the user information of the measuring unit which has been connected. AXU Designated axis ? Command format Return format AXU Designated axis =<User ID> <User ID> Hexadecimal ASCII notation (2 characters) Target Designated axis AXU[00A]? Examples of use Transmission : Return : AXU[00A]=00 Compatible command None MG40 Series 4-42...
[01D] = Axis D for MG42 hub unit #01 [31A] = Axis A for MG42 hub unit #31 [31B] = Axis B for MG42 hub unit #31 [31C] = Axis C for MG42 hub unit #31 [31D] = Axis D for MG42 hub unit #31 MG40 Series...
Page 132
If the measuring result data consist of more than 7 digits, “F” is output as the highest-level digit to indicate that an overfl ow has occurred. Use in a range where an “F” will not be output. When 1000.2531 is to be displayed MG40 Series...
Hub unit ID05 data 32 Bytes In order to synchronize the data of a multiple number of units, use the latch command, and then collect the data of each unit using the memory data output command. MG40 Series...
Page 134
Reference point information: The reference point detection status : Speed alarm and level alarm are is indicated using a hexadecimal occurring. 1-digit bit pattern. 0 : Reference point not detected 1 : Wait to go past reference point 2 : Reference point detected MG40 Series...
Page 135
15 : Setting value 15 Measurement value < Setting value 16 16 : Setting value 16 Measurement value Time stamp : 1/128 s (7.8125 ms) counter value referenced to AM 0:00 of the internal clock of the MG41 main unit MG40 Series...
One or more station number setting switches or transmission speed setting switches have been set outside the range of specifi cations. Communication Error Communication has timed out. A disconnected cable, broken cable or equipment failure may be to blame. MG40 Series...
Page 138
Th e supply voltage is insuffi cient. Check the power supplies. Numbers in the C0’s: Measuring unit-related errors Communication error Measuring unit has detected an error in the communication system. System error Measuring unit has detected system trouble. MG40 Series...
Page 139
容 ( 操作、保守など ) と異なる目的で本マニュアルを使用 することを禁止します。 The material contained in this manual consists of information that is the property of Sony Manufacturing Systems Corporation and is intended solely for use by the purchasers of the equipment described in this manual.