Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
289 views

SPiiPlus Modbus Setup Guide

ACS modbus setup

Uploaded by

pin cheng
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
289 views

SPiiPlus Modbus Setup Guide

ACS modbus setup

Uploaded by

pin cheng
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

SPiiPlus Modbus

Setup Guide
April 2021
Document Revision: 3.10
SPiiPlus Modbus Setup Guide

SPiiPlus Modbus

Release Date: April 2021

COPYRIGHT

© ACS Motion Control Ltd., 2021. All rights reserved.

Changes are periodically made to the information in this document. Changes are published as release notes and later
incorporated into revisions of this document.

No part of this document may be reproduced in any form without prior written permission from ACS Motion Control.

TRADEMARKS

ACS Motion Control, SPiiPlus, PEG, MARK, ServoBoost, NetworkBoost and NanoPWN are trademarks of ACS Motion Control Ltd.

EtherCAT is registered trademark and patented technology, licensed by Beckhoff Automation GmbH, Germany.

Any other companies and product names mentioned herein may be the trademarks of their respective owners.

www.acsmotioncontrol.com

support@acsmotioncontrol.com

sales@acsmotioncontrol.com

NOTICE

The information in this document is deemed to be correct at the time of publishing. ACS Motion Control reserves the right to
change specifications without notice. ACS Motion Control is not responsible for incidental, consequential, or special damages of
any kind in connection with using this document.

Version 3.10 2
SPiiPlus Modbus Setup Guide

Revision History
Date Revisions Description

September
3.02 New Release
2020

July 2020 3.01 ADK Update

May 2020 3.00 New Release number

July 2019 2.70 SLCPA is obsolete, removed from documentation

November 2018 2.60.10 Updated the SPiiPlus MODbus Addressing table

Update the SPiiPlus MODbus Addresses for ACSPL+


July 2018 2.60
Standard Variables

Reformatted with new template for SPiiPlus


June 2017 2.40
AKD Suite 2.40

Updated for SPiiPlus AKD Suite 2.30


August 2016 2.30
Removed PLCFLG and LOCALST

September
01 First Release
2014

Version 3.10 3
SPiiPlus Modbus Setup Guide

Conventions Used in this Guide


Text Formats

Format Description

Bold Names of GUI objects or commands

BOLD + UPPERCASE ACSPL+ variables and commands

Monospace + grey background Code example

Italic Names of other documents

Blue Hyperlink

[] In commands indicates optional item(s)

| In commands indicates either/or items

Flagged Text

Note - includes additional information or programming tips.

Caution - describes a condition that may result in damage to equipment.

Warning - describes a condition that may result in serious bodily injury or


death.

Model - highlights a specification, procedure, condition, or statement that


depends on the product model

Advanced - indicates a topic for advanced users.

Version 3.10 4
SPiiPlus Modbus Setup Guide

Related Documents
Documents listed in the following table provide additional information related to this document.
The most updated version of the documents can be downloaded by authorized users from
www.acsmotioncontrol.com/downloads.

Document Description

HSSI Expansion Modules High-Speed Synchronous Serial Interface (HSSI) for expanded
Guide I/O, distributed axes, and nonstandard devices.

Provides information concerning the host protocol. This


Low Level Host
information is relevant in case the host application runs on a
Communication
non-Windows operating system.

MC4U Control Module Detailed hardware information concerning the MC4U Control
Hardware Guide Module and its associated components.

SPiiPlus 3U-LT and SPiiPlus


Installation and hardware connection with the SPiiPlus 3U-LT
3U-HP Motion Controller
and SPiiPlus 3U-HP Motion Controllers.
Hardware Guide

SPiiPlus C Library C++ and Visual Basic® libraries for host PC applications. This
Reference guide is applicable for all the SPiiPlus motion control products.

SPiiPlus CM Hardware Installation and hardware connection with the SPiiPlus Control
Guide Module

SPiiPlus COM Library COM Methods, Properties, and Events for Communication with
Reference Guide the Controller.

Complete reference to the command and variables of the


SPiiPlus Command &
ACSPL+ high level language for programming SPiiPlus
Variable Reference Guide
controllers.

Guide for using the SPiiPlus FRF (Frequency Response


SPiiPlus FRF Analyzer
Function) Analyzerä for servo analysis of SPiiPlus motion
User’s Guide
controllers.

SPiiPlus Getting Started


Hardware and Software A guide for using the SPiiPlus MMI (Motion Machine Interface).
Guide

SPiiPlus LF Motion Detailed hardware information concerning the SPiiPlus LF


Controller motion controller.

SPiiPlus LF-CM Motion Detailed hardware information concerning the SPiiPlus LF-CM
Controller motion controller.

Version 3.10 5
SPiiPlus Modbus Setup Guide

Document Description

SPiiPlus PCI-4-8 Hardware Installation and hardware connection with the SPiiPlus PCI 4 or
Guide 8 axes

SPiiPlus Programmer's
An overview for programming SPiiPlus controllers.
Guide

SPiiPlus SAR and SAR-LT Installation and hardware connection with the SPiiPlus SAR and
Hardware Guide SAR-LT Controllers

Provides guidance on how to configure and adjust the SPiiPlus


SPiiPlus Setup Guide systems to work with supported types of motors and feedback
devices.

Describes the SPiiPlus User Mode Driver (UMD), and firmware


SPiiPlus Utilities User Guide management applications included in the SPiiPlus Tools
package.

Version 3.10 6
SPiiPlus Modbus Setup Guide

Table of Contents
1. Introduction 10
1.1 Document Scope 10
1.2 Related SPiiPlus Tools 10
2. Overview 11
2.1 References 11
2.2 SPiiPlus Modbus Functionality 11
3. SPiiPlus Modbus Slave Functionality 12
3.1 Transmission Modes 12
3.2 Data Format 12
3.3 Data Encoding 12
3.4 Data Addressing 12
4. SPiiPlus Modbus Supported Function Codes 13
4.1 SPiiPlus Modbus Addressing 13
4.2 ACSPL+ Standard Variables as Holding Registers 14
4.3 ACSPL+ Standard Variables as Coils 37
4.4 User-defined Variables as Holding Registers 38
5. ACSPL+ Commands 39
6. Word Order Configuration 43
7. SPiiPlus Modbus Communication Configuration 44
7.1 Serial RS232/RS422 44
7.2 SPiiPlus Modbus Slave Address 44
7.3 COM Port 44
7.4 Baud Rate 45
7.5 Parity, Stop Bit 46
7.6 SPiiPlus Modbus TCP/IP 46
7.7 SPiiPlus Modbus Unit Identifier 47
7.8 IP Address 47
8. SPiiPlus Modbus Master Functionality Support 48
8.1 Sending SPiiPlus Modbus Request 48
8.2 SPiiPlus Modbus Protocol Mode 48
8.3 32-bit Integer Registers 49
8.4 32-bit Floating Point Registers 50

Version 3.10 7
SPiiPlus Modbus Setup Guide

8.5 Receiving SPiiPlus Modbus Response 51


8.6 Reading of 32-Bit Integer Registers 52
8.7 Reading of 32-bit Floating Point Registers 53
8.8 Establishing/Closing SPiiPlus Modbus TCP Connection 53
9. SPiiPlus Modbus Setup Example 54
9.0.1 Slave side 54
9.0.2 Master side 54

Version 3.10 8
SPiiPlus Modbus Setup Guide

List of Tables
Table 4-1. SPiiPlus Modbus Addressing 13
Table 4-2. SPiiPlus MODbus Addresses of all ACSPL+ Standard Variables 14
Table 4-3. SPiiPlus MODbus Representation of Variables as Coils 37
Table 5-1. SPiiPlus MODbus Representation of ACSPL+ Command as Coils 39
Table 5-2. SPiiPlus Modbus Representation of Some Auxiliary Holding Register 42

Version 3.10 9
SPiiPlus Modbus Setup Guide
1.   Introduction

1. Introduction
1.1 Document Scope
This document describes how to setup the for SPiiPlus motion controllers.
This document is intended for the use of software engineers.
SPiiPlus Modbus is supported by ACS Motion Control's firmware SPiiPlusNT-SC Ver. 2.27 and higher.

1.2 Related SPiiPlus Tools


Tool Description

A multipurpose user interface with the controller including: Program


management, Motion management, Communication terminal, Four channel
SPiiPlus
digital oscilloscope, Safety and I/O signals monitor, Signal tuning and
MMI
adjustment, and a fully interactive simulator. Program and SPii debugging
tools and FRF are also included.

A DLL (Dynamic Link Library) that supports host application programming in a


variety of languages including C/C++. The library introduces a new level of
SPiiPlus C
application support with a built-in controller simulator and it also provides
Library
outstanding debugging capabilities. All tools are provided with a full simulator
of the controller.

A DLL (Dynamic Link Library) that supports host application programming in a


variety of languages including Visual Basic, LabView, and more. The library
SPiiPlus
introduces a new level of application support with a built-in controller
COM Library
simulator and it also provides outstanding debugging capabilities. All tools are
provided with a full simulator of the controller.

Version 3.10 10
SPiiPlus Modbus Setup Guide
2.   Overview

2. Overview
The SPiiPlus Modbus protocol has became the primary protocol for connection with OIT (Operator
Interface Terminal) devices, and in turn, the OIT is now very popular in the motion control industry.
SPiiPlus Modbus and OIT are used in machines for operator display or console applications. SPiiPlus
motion controllers support the SPiiPlus Modbus protocol and allow connecting different OIT devices
to SPiiPlus controllers.
Currently, the SPiiPlus Modbus protocol is supported over serial RS232 connection or over an
Ethernet TCP/IP link.
HMI terminals from the following suppliers were used with SPiiPlus during SPiiPlus Modbus testing:
> Maple Systems
> Parker Motion
> Eason Technologies

2.1 References
The SPiiPlus Modbus protocol implements a Master-Slave (Client-Server) model. The SPiiPlus
controller provides Slave (Server) functionality according to SPiiPlus Modbus community standards
as described in the following publications:
SPiiPlus Modbus Application Protocol Specification v1.1, December 2002. [1]
SPiiPlus Modbus over Serial Line Specification and Implementation v1.0, December 2002. [2]
SPiiPlus Modbus Messaging Implementation Guide v1.0, May 2002. [3]
In addition, the following documents provide relevant information concerning SPiiPlus Modbus
implementation:
SPiiPlus ACSPL+ Programmers Guide
SPiiPlus Setup Guide

2.2 SPiiPlus Modbus Functionality


The SPiiPlus Modbus protocol supports the following functionality:
> The SPiiPlus controller can work as Slave or as Master device
> RTU data format, ASCII format is not supported
> Modicon protocol, addressing starts from 1
> SPiiPlus Modbus over serial line (RS232)
> SPiiPlus Modbus messaging on TCP/IP
> Read/write all ACSPL+ standard and user-defined variables
> Most important and useful controller functions like motor enable/disable, motion
start/stop, program start/stop, etc.
> Configurable word order of 32-bit integer and 32-bit floating registers

Version 3.10 11
SPiiPlus Modbus Setup Guide
3.   SPiiPlus Modbus Slave Functionality

3. SPiiPlus Modbus Slave Functionality


The SPiiPlus Modbus protocol is a master-slave protocol where a single master and from one to
several slave nodes are connected to the bus. Communication is always initiated by the master. The
slave nodes never transmit data without a request from the Master.
If the SPiiPlus controller is configured to a SPiiPlus Modbus Slave mode, the controller functions as a
slave device in the SPiiPlus Modbus network. In this mode, the controller just replies to master
requests.

3.1 Transmission Modes


The SPiiPlus controller only supports the RTU mode, where each 8-bit byte in a message contains
two 4-bit hexadecimal characters.

The ACSII mode is optional in the SPiiPlus Modbus protocol and is not supported by the
SPiiPlus controller

3.2 Data Format


The SPiiPlus controller ACSPL+ interface uses two types of variables:
> 32-bit integer
> Double precision 64-bit real
Most OIT devices support single precision real numbers and only a few of them support double
precision 64-bit real numbers.
To ensure compatibility with as many OIT devices as possible, the SPiiPlus Modbus interface
converts all double precision 64-bit real ACSPL+ variables to single-precision 32-bit real numbers. In
this manner, both integer and real numbers are represented as 32-bit numbers.

3.3 Data Encoding


The SPiiPlus Modbus protocol uses a big-Endian representation for addresses and data. That means
that numbers larger than a single byte are transmitted with the MSB first. For example, the 32-bit
value 0x12345678 is transmitted as follows:
1. The first byte 0x12 is sent
2. Then 0x34
3. Then 0x56
4. Then 0x78

3.4 Data Addressing


All data addresses in SPiiPlus Modbus messages are referenced to zero. The first occurrence of a
data item is addressed as item number zero. For example, the 'coil 1' is addressed as coil 0000 in
the data address field of a SPiiPlus Modbus message, the holding register 40001 is addressed as
register 0000 in the data address field of the message.

Version 3.10 12
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

4. SPiiPlus Modbus Supported Function Codes


The SPiiPlus Modbus protocol supports the following SPiiPlus Modbus function codes:
> Read Coils (01)
> Write Single Coil (05)
> Write Multiple Coils (15)
> Read Holding Register (03)
> Write Multiple Registers (16)
> Read Device Identification (43)

4.1 SPiiPlus Modbus Addressing


All ACSPL+ standard variables are exposed through the SPiiPlus SPiiPlus Modbus interface as
holding registers and coils.
The ACSPL+ standard variables can be divided on numeric and bit-wise variables.
The following table shows how the ACSPL+ standard variables, user-defined variables and ACSPL+
commands are represented in the SPiiPlus Modbus interface:
Table 4-1. SPiiPlus Modbus Addressing

SPiiPlus Modbus SPiiPlus Modbus SPiiPlus Modbus


SPiiPlus Group
Group Registers Range Function Codes

Standard (bit-wise)
Coils 1 - 9600 01, 05, 15
variables

ACSPL+ commands Coils 9601 - 10000 01, 05, 15

Standard (numeric)
Holding Registers 40001 - 48000 03, 16
variables

User-defined
Holding Registers 48001 - 49800 03, 16
variables

ACSPL+ commands Holding Registers 49801 - 50000 16

Standard (numeric)
Holding Registers 50001 - 60000 03, 16
variables

Version 3.10 13
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

4.2 ACSPL+ Standard Variables as Holding Registers


Both integer and real ACSPL+ standard variables are represented as two 16-bit holding registers. Therefore, read/write holding register functions (03, 16)
should only use multiple register access with even address and an even quantity of registers.
The standard variable can be either 32-bit scalar (integer or real) or an array of 32-bit elements. Array elements are located sequentially. A Start Address in
the table points to the fist element in the array.

Address = Register Number + 2 * <Axis/Buffer index>

For example, to read the ACC variable of axis Z (index 2), you need to specify address 40005 in function 03 (read holding register).
The following table specifies SPiiPlus Modbus addresses of all ACSPL+ standard variables.
Table 4-2. SPiiPlus MODbus Addresses of all ACSPL+ Standard Variables

SPiiPlus SPiiPlus
ACSPL+
Modbus SPiiPlus Modbus Variable Access Modbus Variable Tag
Standard Array Length
Register Address Field Type Rights Function Number
Variable
Number Code

ACC 40001 0000 Real 8 RW 03,16 1

AERR 40033 0032 Int 8 RO 03 2

AFLAGS 40065 0064 Int 8 RW 03,16 3

Controller
AIN 40097 0096 Int RO 03 4
dependent

Controller
AOUT 40129 0128 Int RW 03,16 5
dependent

Version 3.10 14
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

SPiiPlus SPiiPlus
ACSPL+
Modbus SPiiPlus Modbus Variable Access Modbus Variable Tag
Standard Array Length
Register Address Field Type Rights Function Number
Variable
Number Code

APOS 40161 0160 Real 8 RO 03 6

AST 40193 0192 Int 8 RO 03 7

BAUD 40225 0224 Int Scalar RW 03,16 8

BOFFTIME 40257 0256 Real 8 RW 03,16 9

BONTIME 40289 0288 Real 8 RW 03,16 10

CERRA 40321 0320 Real 8 RW 03,16 11

CERRI 40353 0352 Real 8 RW 03,16 12

CERRV 40385 0384 Real 8 RW 03,16 13

CFG 40417 0416 Int Scalar RO 03 14

COMMCH 40449 0448 Int Scalar RO 03,16 15

COMMFL 40481 0480 Int Scalar RW 03,16 16

CTIME 40513 0512 Real Scalar RW 03,16 17

DAPOS 40545 0544 Real 8 RO 03 18

DCN 40577 0576 Int 8 RO 03 19

Version 3.10 15
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

SPiiPlus SPiiPlus
ACSPL+
Modbus SPiiPlus Modbus Variable Access Modbus Variable Tag
Standard Array Length
Register Address Field Type Rights Function Number
Variable
Number Code

DCOM 40609 0608 Real 8 RW 03,16 20

DCP 40641 0640 Real 8 RO 03 21

DEC 40673 0672 Real 8 RW 03,16 22

DELI 40705 0704 Real 8 RW 03,16 23

DELV 40737 0736 Real 8 RW 03,16 24

DISPCH 40769 0768 Int Scalar RW 03,16 25

DOUT 40801 0800 Real 8 RO 03 26

E_FREQ 40833 0832 Int 8 RW 03,16 27

E_SCMUL 40865 0864 Int 8 RW 03,16 28

E_TYPE 40897 0896 Int 8 RW 03,16 29

E2_SCMUL 40929 0928 Int 8 RW 03,16 30

E2_TYPE 40961 0960 Int 8 RW 03, 16 31

E2FAC 40993 0992 Real 8 RW 03,16 32

E2OFFS 41057 1056 Real 8 RO 03 34

Version 3.10 16
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

SPiiPlus SPiiPlus
ACSPL+
Modbus SPiiPlus Modbus Variable Access Modbus Variable Tag
Standard Array Length
Register Address Field Type Rights Function Number
Variable
Number Code

ECHO 41089 1088 Int Scalar RW 03,16 35

EFAC 41121 1120 Real 8 RW 03,16 36

ENTIME 41153 1152 Real 8 RW 03,16 37

EOFFS 41185 1184 Real 8 RO 03 38

ERRA 41217 1216 Real 8 RW 03,16 39

ERRI 41249 1248 Real 8 RW 03,16 40

ERRV 41281 1280 Real 8 RW 03,16 41

Controller
EXTIN 41313 1312 Int RO 03 42
dependent

Controller
EXTOUT 41345 1344 Int RW 03,16 43
dependent

F2POS 41377 1376 Real 8 RO 03 44

F2VEL 41409 1408 Real 8 RO 03 45

FACC 41441 1440 Real 8 RO 03 46

Version 3.10 17
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

SPiiPlus SPiiPlus
ACSPL+
Modbus SPiiPlus Modbus Variable Access Modbus Variable Tag
Standard Array Length
Register Address Field Type Rights Function Number
Variable
Number Code

FAULT 41473 1472 Int 8 RO 03 47

FDEF 41505 1504 Int 8 RW 03,16 48

FK 41569 1568 Int Scalar RO 03 50

FMASK 41601 1600 Int 8 RW 03,16 51

FPOS 41633 1632 Real 8 RO 03 52

FVEL 41665 1664 Real 8 RO 03 53

FVFIL 41697 1696 Real 8 RW 03,16 54

GACC 41729 1728 Real 8 RO 03,16 55

GJERK 41793 1792 Real 8 RO 03,16 57

GMOT 41825 1824 Int 8 RO 03 58

GMQU 41857 1856 Int 8 RO 03 59

GMTYPE 41889 1888 Int 8 RO 03 60

GPATH 41921 1920 Real 8 RO 03 61

GPHASE 41953 1952 Real 8 RO 03 62

Version 3.10 18
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

SPiiPlus SPiiPlus
ACSPL+
Modbus SPiiPlus Modbus Variable Access Modbus Variable Tag
Standard Array Length
Register Address Field Type Rights Function Number
Variable
Number Code

GRTIME 41985 1984 Real 8 RO 03 63

GSEG 42017 2016 Int 8 RO 03 64

GSFREE 42049 2048 Int 8 RO 03 65

GVEC 42081 2080 Real 8 RO 03 66

GVEL 42113 2112 Real 8 RO 03 67

IENA 42177 2176 Int Scalar RW 03,16 69

IMASK 42209 2208 Int 8 RW 03,16 70

Controller
IN 42241 2240 Int RO 03 71
dependent

IND 42273 2272 Real 8 RO 03 72

Controller
ISENA 42465 2464 Int RW 03,16 78
dependent

IST 42497 2496 Int 8 RW 03,16 79

JERK 42529 2528 Real 8 RW 03,16 80

Version 3.10 19
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

SPiiPlus SPiiPlus
ACSPL+
Modbus SPiiPlus Modbus Variable Access Modbus Variable Tag
Standard Array Length
Register Address Field Type Rights Function Number
Variable
Number Code

KDEC 42561 2560 Real 8 RW 03,16 81

M2ARK 42657 2656 Real 8 RO 03 84

MARK 42689 2688 Real 8 RO 03 85

MERR 42721 2720 Int 8 RO 03 86

MFF 42753 2752 Real 8 RW 03,16 87

MFLAGS 42785 2784 Int 8 RW 03,16 88

MPOS 42817 2816 Real 8 RO 03 89

MST 42849 2848 Int 8 RO 03 90

NVEL 42881 2880 Real 8 RW 03,16 91

ONRATE 42945 2944 Int 10 RW 03,16 93

Controller
OUT 42977 2976 Int RW 03,16 94
dependent

PCHARS 43009 3008 Int 10 RO 03 95

PE 43105 3104 Real 8 RO 03 98

Version 3.10 20
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

SPiiPlus SPiiPlus
ACSPL+
Modbus SPiiPlus Modbus Variable Access Modbus Variable Tag
Standard Array Length
Register Address Field Type Rights Function Number
Variable
Number Code

PERL 43137 3136 Int 10 RO 03 99

PERR 43169 3168 Int 10 RO 03 100

PEXL 43201 3200 Int 10 RO 03 101

PFLAGS 43233 3232 Int 10 RW 03,16 102

PLINES 43265 3264 Int 10 RO 03 103

PRATE 43297 3296 Int 10 RW 03,16 104

PST 43329 3328 Int 10 RO 03 105

RACC 43361 3360 Real 8 RO 03 106

ROFFS 43393 3392 Real 8 RO 03 107

RPOS 43425 3424 Real 8 RO 03 108

RVEL 43457 3456 Real 8 RO 03 109

RVFIL 43489 3488 Real 8 RW 03,16 110

S_DCN 43521 3520 Int Scalar RO 03 111

S_DCP 43553 3552 Real Scalar RO 03 112

Version 3.10 21
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

SPiiPlus SPiiPlus
ACSPL+
Modbus SPiiPlus Modbus Variable Access Modbus Variable Tag
Standard Array Length
Register Address Field Type Rights Function Number
Variable
Number Code

S_ERR 43585 3584 Int Scalar RO 03 113

S_FAULT 43617 3616 Int Scalar RO 03 114

S_FDEF 43649 3648 Int Scalar RW 03,16 115

S_FLAGS 43681 3680 Int Scalar RW 03,16 116

S_FMASK 43713 3712 Int Scalar RW 03,16 117

S_SAFIN 43745 3744 Int Scalar RO 03 118

S_SAFINI 43777 3776 Int Scalar RW 03,16 119

S_ST 43809 3808 Int Scalar RO 03 120

SAFIN 43841 3840 Int 8 RO 03 121

SAFINI 43873 3872 Int 8 RW 03,16 122

SETTLE 43905 3904 Real 8 RW 03,16 123

SLLIMIT 43937 3936 Real 8 RW 03,16 124

SRLIMIT 44065 4064 Real 8 RW 03,16 128

STEPF 44097 4096 Real 8 RW 03,16 129

Version 3.10 22
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

SPiiPlus SPiiPlus
ACSPL+
Modbus SPiiPlus Modbus Variable Access Modbus Variable Tag
Standard Array Length
Register Address Field Type Rights Function Number
Variable
Number Code

STEPW 44129 4128 Real 8 RW 03,16 130

TARGRAD 44193 4192 Real 8 RW 03,16 132

TCPIP 44225 4224 Int Scalar RW 03,16 133

TIME 44257 4256 Real Scalar RO 03 134

TPOS 44289 4288 Real 8 RW 03,16 135

USAGE 44353 4352 Real Scalar RO 03 137

VEL 44417 4416 Real 8 RW 03,16 139

VELBRK 44449 4448 Real 8 RW 03,16 140

XACC 44481 4480 Real 8 RW 03,16 141

XCURI 44513 4512 Real 8 RW 03,16 142

XCURV 44545 4544 Real 8 RW 03,16 143

XRMS 44577 4576 Real 8 RW 03,16 144

XRMST 44609 4608 Real 8 RW 03,16 145

XSACC 44641 4640 Real 8 RW 03,16 146

Version 3.10 23
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

SPiiPlus SPiiPlus
ACSPL+
Modbus SPiiPlus Modbus Variable Access Modbus Variable Tag
Standard Array Length
Register Address Field Type Rights Function Number
Variable
Number Code

XVEL 44673 4672 Real 8 RW 03,16 147

SLAFF 44705 4704 Real 8 RW 03,16 148

SLBIASA 44737 4736 Real 8 RW/RO 03,16/03 149

SLBIASB 44769 4768 Real 8 RW/RO 03,16/03 150

SLCNP 44833 4832 Int 8 RW 03,16 152

SLCOFFS 44865 4864 Real 8 RW 03,16 153

SLCORG 44961 4960 Real 8 RW 03,16 156

SLCPRD 45025 5024 Real 8 RW 03,16 158

SLCROUT 45057 5056 Int 8 RW 03,16 159

SLDZMIN 45153 5152 Real 8 RW 03,16 162

SLDZMAX 45185 5184 Real 8 RW 03,16 163

SLEBIASA 45217 5216 Int 8 RW 03,16 164

SLEBIASB 45249 5248 Int 8 RW 03,16 165

SLFRC 45313 5312 Real 8 RW 03,16 167

Version 3.10 24
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

SPiiPlus SPiiPlus
ACSPL+
Modbus SPiiPlus Modbus Variable Access Modbus Variable Tag
Standard Array Length
Register Address Field Type Rights Function Number
Variable
Number Code

SLFRCD 45345 5344 Real 8 RW 03,16 168

SLHRS 45377 5376 Real 8 RW 03, 16 169

SLIKI 45409 5408 Real 8 RW 03,16 170

SLIKP 45441 5440 Real 8 RW 03,16 171

SLIOFFS 45473 5472 Real 8 RW 03,16 172

SLPKI 45537 5536 Real 8 RW 03,16 174

SLPKP 45569 5568 Real 8 RW 03,16 175

SLPLI 45601 5600 Real 8 RW 03,16 176

SLPROUT 45633 5632 Int 8 RW 03,16 177

SLVKI 45697 5696 Real 8 RW 03,16 179

SLVKP 45729 5728 Real 8 RW 03,16 180

SLVLI 45761 5760 Real 8 RW 03,16 181

SLVNFRQ 45793 5792 Real 8 RW 03,16 182

SLVNWID 45825 5824 Real 8 RW 03,16 183

Version 3.10 25
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

SPiiPlus SPiiPlus
ACSPL+
Modbus SPiiPlus Modbus Variable Access Modbus Variable Tag
Standard Array Length
Register Address Field Type Rights Function Number
Variable
Number Code

SLVNATT 45857 5856 Real 8 RW 03,16 184

SLVSOF 45889 5888 Real 8 RW 03,16 185

SLVSOFD 45921 5920 Real 8 RW 03,16 186

SLVRAT 45953 5952 Real 8 RW 03,16 187

SLVROUT 45985 5984 Int 8 RW 03,16 188

SLZFF 46017 6016 Real 8 RW 03,16 189

SLCHALL 46113 6112 Int 8 RW 03,16 192

CONID 46145 6144 Int Scalar RW 03,16 193

SLPMAX 46177 6176 Real 8 RW 03, 16 194

SLPMIN 46209 6208 Real 8 RW 03,16 195

SLSTHALL 46241 6240 Int 8 RO 03 196

MAXPLCU 46273 6272 Int 8 RW 03,16 197

TCPIP2 46305 6304 Int 8 RW 03,16 198

TCPPORT 46369 6368 Int Scalar RW 03,16 200

Version 3.10 26
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

SPiiPlus SPiiPlus
ACSPL+
Modbus SPiiPlus Modbus Variable Access Modbus Variable Tag
Standard Array Length
Register Address Field Type Rights Function Number
Variable
Number Code

UDPPORT 46401 6400 Int Scalar RW 03,16 201

SCSOFF 46433 6432 Real 8 RW 03,16 202

SCCOFFS 46465 6464 Real 8 RW 03,16 203

SCGAIN 46497 6496 Real 8 RW 03,16 204

SCPHASE 46529 6528 Real 8 RW 03,16 205

SLDRA 46561 6560 Real 8 RW 03,16 206

SLDRX 46593 6592 Real 8 RW 03,16 207

SLVB0DD 46625 6624 Real 8 RW 03,16 208

SLVB0DF 46657 6656 Real 8 RW 03,16 209

SLVB0ND 46689 6688 Real 8 RW 03,16 210

SLVB0NF 46721 6720 Real 8 RW 03,16 211

SLCFIELD 46913 6912 Real 8 RW 03,16 217

SLCSLIP 46945 6944 Real 8 RW 03,16 218

XARRSIZE 46977 6976 Int Scalar RW 03,16 219

Version 3.10 27
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

SPiiPlus SPiiPlus
ACSPL+
Modbus SPiiPlus Modbus Variable Access Modbus Variable Tag
Standard Array Length
Register Address Field Type Rights Function Number
Variable
Number Code

SLABITS 47009 7008 Int 8 RW 03,16 220

SLILI 47041 7040 Real 8 RW 03,16 221

Controller
SYNC 47073 7072 Int RO 03 222
dependent

RMS 47105 7104 Real 8 RO 03 223

JITTER 47137 7136 Real Scalar RO 03 224

MSSYNC 47169 7168 Real Scalar RO 03 225

SLIFILT 47201 7200 Real 8 RW 03,16 226

GATEWAY 47233 7232 Int Scalar RW 03,16 227

SUBNET 47265 7264 Int Scalar RW 03,16 228

Controller
NST 47297 7296 Int RO 03 229
dependent

SLDRAIF 47329 7328 Real 8 RW 03,16 230

SLPKPIF 47361 7360 Real 8 RW 03,16 231

Version 3.10 28
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

SPiiPlus SPiiPlus
ACSPL+
Modbus SPiiPlus Modbus Variable Access Modbus Variable Tag
Standard Array Length
Register Address Field Type Rights Function Number
Variable
Number Code

SLPKPSF 47393 7392 Real 8 RW 03,16 232

SLVKIIF 47425 7424 Real 8 RW 03,16 233

SLVKISF 47457 7456 Real 8 RW 03,16 234

SLVKPIF 47489 7488 Real 8 RW 03,16 235

SLVKPSF 47521 7520 Real 8 RW 03,16 236

ECST 47585 7584 Int Scalar RO 03 238

ECERR 47617 7616 Int Scalar RO 03 239

S_SETUP 47649 7648 Int Scalar RW 03,16 240

USGTRACE 47809 7808 Real 10 RO 03 245

USGBUF 47841 7840 Real 10 RO 03 246

E_PAR_A 47905 7904 Int 8 RW 03,16 248

E_PAR_B 47937 7936 Int 8 RW 03,16 249

SLFRCN 50001 10000 Real 8 RW 03,16 250

SLDZTIME 50033 10032 Real 8 RW 03,16 251

Version 3.10 29
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

SPiiPlus SPiiPlus
ACSPL+
Modbus SPiiPlus Modbus Variable Access Modbus Variable Tag
Standard Array Length
Register Address Field Type Rights Function Number
Variable
Number Code

SLVKPDCF 50065 10064 Real 8 RW 03,16 252

SLPKPDCF 50097 10096 Real 8 RW 03,16 253

SLVKIDCF 50129 10128 Real 8 RW 03,16 254

Controller
SOFTIME 50161 10160 Real RO 03 255
dependent

SLGCAXN 50193 10192 Int 8 RO 03 256

E_PAR_C 50257 10256 Int 8 RW 03, 16 258

RJERK 50289 10288 Real 8 RO 03 259

SLPKIIF 50321 10320 Real 8 RW 03,16 260

SLPKISF 50353 10352 Real 8 RW 03,16 261

XSEGAMAX 50385 10384 Real Scalar RW 03,16 262

XSEGAMIN 50417 10416 Real Scalar RW 03,16 263

XSEGRMAX 50449 10448 Real Scalar RW 03,16 264

XSEGRMIN 50481 10480 Real Scalar RW 03,16 265

Version 3.10 30
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

SPiiPlus SPiiPlus
ACSPL+
Modbus SPiiPlus Modbus Variable Access Modbus Variable Tag
Standard Array Length
Register Address Field Type Rights Function Number
Variable
Number Code

E_PAR_D 50513 10512 Int 8 RW 03,16 266

E_PAR_E 50545 10544 Int 8 RW 03,16 267

E_FLAGS 50577 10576 Int 8 RW 03,16 268

SLPKITF 50609 10608 Real 8 RW 03,16 269

SLPKPTF 50641 10640 Real 8 RW 03,16 270

SLVKITF 50673 10672 Real 8 RW 03,16 271

SLVKPTF 50705 10704 Real 8 RW 03,16 272

SLTFWID 50737 10736 Real 8 RW 03,16 273

SLJFF 50769 10768 Real 8 RW 03,16 274

SLSBBW 50801 10800 Real 8 RW 03,16 275

SLSBF 50833 10832 Real 8 RW 03,16 276

SLSBORD 50865 10864 Int 8 RW 03,16 277

SLMKE 50897 10896 Real 8 RW 03,16 278

SLML 50929 10928 Real 8 RW 03,16 279

Version 3.10 31
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

SPiiPlus SPiiPlus
ACSPL+
Modbus SPiiPlus Modbus Variable Access Modbus Variable Tag
Standard Array Length
Register Address Field Type Rights Function Number
Variable
Number Code

SLMR 50961 10960 Real 8 RW 03,16 280

SLMPITCH 50993 10992 Real 8 RW 03,16 281

SLIPEAK 51025 11024 Real 8 RW 03,16 282

SLVBUS 51057 11056 Real 8 RW 03,16 283

G_01WCS 51089 11088 Real 8 RO 03 284

G_02WCS 51121 11120 Real 8 RO 03 285

G_03WCS 51153 11152 Real 8 RO 03 286

G_04WCS 51185 11184 Real 8 RO 03 287

G_05WCS 51217 11216 Real 8 RO 03 288

G_06WCS 51249 11248 Real 8 RO 03 289

G_07WCS 51281 11280 Real 8 RO 03 290

G_08WCS 51313 11312 Real 8 RO 03 291

G_09WCS 51345 11344 Real 8 RO 03 292

G_10WCS 51377 11376 Real 8 RO 03 293

Version 3.10 32
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

SPiiPlus SPiiPlus
ACSPL+
Modbus SPiiPlus Modbus Variable Access Modbus Variable Tag
Standard Array Length
Register Address Field Type Rights Function Number
Variable
Number Code

G_11WCS 51409 11408 Real 8 RO 03 294

G_12WCS 51441 11440 Real 8 RO 03 295

GPEXL 51473 11472 Real 8 RO 03 296

GUFAC 51537 11536 Real 8 RW 03,16 298

EPOS 51569 11568 Real 8 RO 03 299

E_AOFFS 51601 11600 Int 8 RW 03,16 300

SLP2ROUT 51633 11632 Int 8 RW 03,16 301

SLHROUT 51665 11664 Int 8 RW 03,16 302

E2_FREQ 51697 11969 Int 8 RW 03,16 303

E2_PAR_A 51729 1128 Int 8 RW 03,16 304

E2_PAR_B 51761 11760 Int 8 RW 03,16 305

E2_PAR_C 51793 11792 Int 8 RW 03,16 306

E2_PAR_D 51825 11824 Int 8 RW 03,16 307

E2_PAR_E 51857 11856 Int 8 RW 03,16 308

Version 3.10 33
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

SPiiPlus SPiiPlus
ACSPL+
Modbus SPiiPlus Modbus Variable Access Modbus Variable Tag
Standard Array Length
Register Address Field Type Rights Function Number
Variable
Number Code

S2LABITS 51921 11920 Int 8 RW 03,16 310

SC2COFFS 51953 11952 Real 8 RW 03,16 311

SC2GAIN 52985 11984 Real 8 RW 03,16 312

SC2PHASE 52017 12016 Real 8 RW 03,16 313

SC2SOFFS 52049 12048 Real 8 RW 03,16 314

SLEBIASC 52081 12080 Real 8 RW 03,16 315

SLEBIASD 52113 12112 Real 8 RW 03,16 316

F2ACC 52145 12144 Real 8 RO 03 317

SLLROUT 52177 12176 Int 8 RW 03,16 318

STODELAY 52209 12208 Real 8 RW 03,16 319

ECEXTST 52241 12240 Int Scalar RO 03 320

ECEXTERR 52273 12272 Int Scalar RO 03 321

ECALERR 52497 12496 Int Scalar RO 03 328

TARGRADA 52721 12720 Real 8 RW 03,16 335

Version 3.10 34
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

SPiiPlus SPiiPlus
ACSPL+
Modbus SPiiPlus Modbus Variable Access Modbus Variable Tag
Standard Array Length
Register Address Field Type Rights Function Number
Variable
Number Code

TARDRADB 52753 12752 Real 8 RW 03,16 336

TARDRADC 52785 12784 Real 8 RW 03,16 337

SETTLEA 52817 12816 Real 8 RW 03,16 338

SETTLB 52849 12848 Real 8 RW 03,16 339

SETTLEC 52881 12880 Real 8 RW 03,16 340

MSTIMEA 52913 12912 Real 8 RW 03,16 341

MSTIMEB 52945 12944 Real 8 RW 03,16 342

MSTIMEC 52977 12976 Real 8 RW 03,16 343

DECOMP 53009 13008 Real 8 RO 03 344

XRMSD 53041 13040 Real 8 RW 03,16 345

XRMSTD 53073 13072 Real 8 RW 03,16 346

CERRK 53105 13104 Real 8 RW 03,16 347

RPOSCOMP 53137 13136 Real 8 RO 03 348

GSPEXL 53169 13168 Int 8 RO 03 349

Version 3.10 35
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

SPiiPlus SPiiPlus
ACSPL+
Modbus SPiiPlus Modbus Variable Access Modbus Variable Tag
Standard Array Length
Register Address Field Type Rights Function Number
Variable
Number Code

DELK 53201 13200 Real 8 RW 03,16 350

XRMSM 53233 13232 Real 8 RW 03,16 351

XRMSTM 53265 13264 Real 8 RW 03,16 352

Version 3.10 36
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

4.3 ACSPL+ Standard Variables as Coils


The several ACSPL+ standard variables show status, mask or flag. A better representation of these
variables is as 32-bit bit-wise values.
The variable can be either 32-bit scalar or array of 32-bit elements. The LSB of the variable or
element is located on the low address. For example, AST(0) is represented as coils 0001-0032. The
AST(0).0 - coil 0001, AST(0).31 - coil 0032. AST(1) is represented as coils 0033-0064, and so on.
Every bit of the ACSPL+ variable is accessible through the address that is calculated as:

Address = Coil Number + 32 * <Axis/Buffer index> + <Bit Number>

For example, to read AST bit 5 of axis Z (index 2), you need to specify address 0069 in function 01
(read coil).
The following table shows the SPiiPlus Modbus representation of such variables as coils:
Table 4-3. SPiiPlus MODbus Representation of Variables as Coils

SPiiPlus SPiiPlus SPiiPlus


Variable Modbus Modbus Variable Array Access Modbus
Name Coil Address Type Length Rights Function
Number Field Code

AST 0001 0000 Bit 256 RO 01

IST 0513 0512 Bit 256 RW 01,05,15

MST 1025 1024 Bit 256 RO 01

PST 1537 1536 Bit 320 RO 01

FAULT 2561 2560 Bit 256 RO 01

FDEF 3073 3072 Bit 256 RW 01,05,15

FMASK 3585 3584 Bit 256 RW 01,05,15

SAFIN 4097 4680 Bit 256 RO 01

SAFINI 4609 4608 Bit 256 RW 01,05,15

Controller
EXTIN 5121 5120 Bit RO 01
Dependent

Controller
EXTOUT 5633 5632 Bit RW 01,05,15
Dependent

Controller
IN 6145 6144 Bit RO 01
Dependent

Version 3.10 37
SPiiPlus Modbus Setup Guide
4.   SPiiPlus Modbus Supported Function Codes

SPiiPlus SPiiPlus SPiiPlus


Variable Modbus Modbus Variable Array Access Modbus
Name Coil Address Type Length Rights Function
Number Field Code

Controller
OUT 6657 6656 Bit RW 01,05,15
Dependent

S_FAULT 9217 9216 Bit 032 RO 01

S_FDEF 9249 9248 Bit 032 RW 01,05,15

S_
9281 9280 Bit 032 RW 01,05,15
FMASK

S_SAFIN 9313 9312 Bit 032 RO 01

S_SAFINI 9345 9344 Bit 032 RW 01,05,15

4.4 User-defined Variables as Holding Registers


The user can define integer or real variable(s) with the ACSPL+. Only scalar variables can be
accessible through the SPiiPlus Modbus interface. To use these variables through the SPiiPlus
Modbus interface, they must be declared in one of the controller program buffers using the
following format (see SPiiPlus ACSPL+ Command & Variable Reference Guide for details):

globaltypetagnumber variable_name

where:
type - real or int keyword
number - A value greater then 1000 and less than 1900
variable_name - Unique name identifying a variable
The SPiiPlus Modbus address of a user variable is calculated as:

Address = (tag_number - 1000)*2 + 48001

To access user-defined variables, the Modbus functions 03, 16 should be used.

Version 3.10 38
SPiiPlus Modbus Setup Guide
5.   ACSPL+ Commands

5. ACSPL+ Commands
In order to execute some of the ACSPL+ commands specified below, simply write 1 to the address that corresponds to the specified axis or buffer.
The ACSPL+ command is applied to any axis/buffer using the following formula:

Address = Coil Number + Axis/Buffer index

For example, to enable motor Z (index 2), write 1 to the address 9603 in functions 05 or 15.
Reading these coils is allowed, but makes no sense. The controller always returns a zero value.
The following table shows the SPiiPlus Modbus representation of ACSPL+ command as coils
Table 5-1. SPiiPlus MODbus Representation of ACSPL+ Command as Coils

SPiiPlus
SPiiPlus SPiiPlus
ACSPL+ Modbus
Modbus Coil Modbus Field Type Array Length Access Rights Description
Command Function
Number Address
Code

ENABLE 9601 9600 Bit 8 RW 01, 05, 15 Enable motor

DISABLE 9617 9616 Bit 8 RW 01, 05, 15 Disable motor

Commutate
COMMUT 9633 9632 Bit 8 RW 01, 05, 15
motor

Stop motion
HALT 9681 9680 Bit 8 RW 01, 05, 15
smoothly

Version 3.10 39
SPiiPlus Modbus Setup Guide
5.   ACSPL+ Commands

SPiiPlus
SPiiPlus SPiiPlus
ACSPL+ Modbus
Modbus Coil Modbus Field Type Array Length Access Rights Description
Command Function
Number Address
Code

Kill motion
KILL 9697 9696 Bit 8 RW 01, 05, 15
abruptly

Set current
ZERO 9713 9712 Bit 8 RW 01, 05, 15
position to zero

START 9729 9728 Bit 10 RW 01, 05, 15 Program start

STOP 9745 9744 Bit 10 RW 01, 05, 15 Program stop

PAUSE 9761 9760 Bit 10 RW 01, 05, 15 Program pause

Program
RESUME 9777 9776 Bit 10 RW 01, 05, 15 resume (after
pause)

Jog motion in
JOG positive 9809 9808 Bit 8 RW 01, 05, 15 positive
direction

Jog motion in
JOG negative 9825 9824 Bit 8 RW 01, 05, 15 negative
direction

Version 3.10 40
SPiiPlus Modbus Setup Guide
5.   ACSPL+ Commands

SPiiPlus
SPiiPlus SPiiPlus
ACSPL+ Modbus
Modbus Coil Modbus Field Type Array Length Access Rights Description
Command Function
Number Address
Code

Move to
PTP 9841 9840 Bit 8 RW 01, 05, 15 absolute
position

Multi-axes
PTP multi- move to
9857 9856 Bit 8 RW 01, 15
axes absolute
position

PTP/r 9873 9872 Bit 8 RW 01, 05, 15 Relative move

PTP/r multi- Multi-axis


9889 9888 Bit 8 RW 01, 15
axes relative move

The table below shows the SPiiPlus Modbus representation of some auxiliary holding registers, which are used to specify target positions for PTP motion.
The address that is calculated as:

Address = Register number + 2 * <Axis index>

For example, to set Absolute position for Z axis (index 2), you need to specify address 49805 in function 16 (write holding register).

Version 3.10 41
SPiiPlus Modbus Setup Guide
5.   ACSPL+ Commands

Table 5-2. SPiiPlus Modbus Representation of Some Auxiliary Holding Register

SPiiPlus SPiiPlus
SPiiPlus
Variable Modbus Modbus
Modbus Field Type Array Length Access Rights Description
Name Register Function
Address
number Code

Absolute
target position.
Absolute Used in PTP
49801 9800 Real 8 RW 03, 16
position and PTP multi-
axes
commands

Relative target
position. Used
Relative in PTP/r and
49833 9832 Real 8 RW 03, 16
position PTP/r multi-
axes
commands

Version 3.10 42
SPiiPlus Modbus Setup Guide
6.   Word Order Configuration

6. Word Order Configuration


The SPiiPlus controller exposes all standard and user variables as 32-bit integer or 32-bit floating
numbers. The SPiiPlus Moldbus protocol does not specify in which order the 16-bit registers should
follow to represent one 32-bit number. For that, the controller provides a special setconf function
with key 309 that defines in what order the 16-bit registers will be interpreted by the controller, as
follows:

setconf(309, channel, value)

Parameters

Parameters Description

channel Not used. This configuration applies to all channels.

The value defines the word order:


value > 0 = hi-word first order (default configuration)
> 1 = low word first order

Version 3.10 43
SPiiPlus Modbus Setup Guide
7.   SPiiPlus Modbus Communication Configuration

7. SPiiPlus Modbus Communication Configuration


The SPiiPlus supports the SPiiPlus Modbus protocol through serial RS232/RS422 or Ethernet TCP/IP
link. For both links, the same variable address map is used and the same functionality is provided.

7.1 Serial RS232/RS422


To initialize serial RS232/RS422 SPiiPlus Modbus communication, the following settings must be
configured in the SPiiPlus Modbus controller:
> SPiiPlus Modbus Slave Address
> COM port
> Baud rate
> Additional COM port parameters (Parity, Stop Bit, etc.)
The sections below describe in detail how to configure these parameters.

7.2 SPiiPlus Modbus Slave Address


According to the SPiiPlus Modbus specification, the controller must have an individual address from
1 to 247. In order to specify the SPiiPlus Modbus Slave address, the controller standard variable
CONID should be initialized to the SPiiPlus Modbus Slave address value.

CONID Controller ID

Type Integer

Size Scalar

Accessibility Read-write

The variable contains the controller identification. The controller


identification can be used for many different purposes like SPiiPlus
Comments Modbus Slave ID, CAN Slave ID or user-defined unique ID within the user
network.
By default, the variable has zero value.

7.3 COM Port


The setconf function with key 302 assigns a communication channel for protocol processing.

setconf(302, channel, value)

Paramters

channel Indicates the assigned channel (1 - COM1, 2 - COM2).

Value defines what communication mode is assign to the specified


value
channel:

Version 3.10 44
SPiiPlus Modbus Setup Guide
7.   SPiiPlus Modbus Communication Configuration

Paramters

> 0 - Set the channel to regular command processing mode


(default channel mode).
> 1 - Set the channel to special communication mode (without any
special protocol support).
> 2 - Set the channel to SPiiPlus Modbus Slave mode, i.e. the
controller works as SPiiPlus Modbus Slave device.
> 3 - Set the channel to SPiiPlus Modbus Master mode, i.e. the
controller works as SPiiPlus Modbus Master.

getconf(302, channel)

Parameters Description

The function returns current state:


> 0 -If the channel is in regular command
processing mode.
> 1 - If the channel is in special communication
channel mode.
> 2 - If the channel is in SPiiPlus Modbus Slave
mode.
> 3 - If the channel is in SPiiPlus Modbus Master
mode.

7.4 Baud Rate


The setconf function with key 303 configures communication baud rates for the specified channel.

setconf(303, channel, baud)

Parameters Definition

channel Channel specifies the channel (1- COM1, 2 - COM2),

Baud specifies the communication rate in the channel.


The following baud rates are supported (Bit/sec.):
> 115200 (default)
> 57600
> 19200
baud
> 9600
> 4800
> 2400
> 1200
> 600
> 300

Version 3.10 45
SPiiPlus Modbus Setup Guide
7.   SPiiPlus Modbus Communication Configuration

Function GETCONF with key 303 retrieves communication rates of the specified channel:

getconf(303, channel, baud)

7.5 Parity, Stop Bit


The setconf function with key 304 set communication options for the channel.

setconf(304, channel, options)

Parameters Description

channel Channel specifies the channel (1- COM1, 2 - COM2)

Option is bit mask of the communication options. The bits are interpreted
as follows:
options > Bit 2: 0 - normal stop bit, 1 - extended stop bit
> Bit 3: 0 - no parity, 1 - check parity
> Bit 4: 0 - odd parity, 1 - even parity

Example
In order to save the specified setting in the controller, the following ACSPL+ program should be
prepared and saved in one of the available buffers.

The program has an AUTOEXEC label that means that it will automatically start after the
controller power-up.

AUTOEXEC:
CONID = 32 ! Set Slave address 32
setconf(302, 2, 2) ! Set COM2 for MODbus
communication
setconf(303, 2, 19200) ! Set baud rate 19200
setconf(304, 2, 0x18) ! Set even parity
STOP

7.6 SPiiPlus Modbus TCP/IP


To initialize SPiiPlus Modbus communication through Ethernet TCP/IP, the following settings must
be configured in the SPiiPlus controller:
> SPiiPlus Modbus Unit identifier (like Slave address on serial line)
> SPiiPlus controller IP address
The sections below describe in detail how to configure these parameters.
Once these parameters are configured, the SPiiPlus Modbus Master can communicate with the
controller by using the standard TCP/IP stack API. Use the specified IP address and port 502.

Version 3.10 46
SPiiPlus Modbus Setup Guide
7.   SPiiPlus Modbus Communication Configuration

The SPiiPlus Modbus interface provides only one TCP/IP connection socket. However, several
SPiiPlus Modbus transactions can be activated simultaneously on the same TCP connection. In this
case, the SPiiPlus Modbus transaction identifier specifies the corresponding transaction.

7.7 SPiiPlus Modbus Unit Identifier


The unit identifier is configured in the same way as SPiiPlus Modbus Slave address on serial line.
According to the SPiiPlus Modbus specification, the controller must have an individual address from
1 to 247. In order to specify the SPiiPlus Modbus Slave address, initialize the controller standard
variable CONID to the SPiiPlus Modbus Slave address value.

7.8 IP Address
The IP address of the controller is configured in the SPiiPlus MMI communication parameters
configuration window.

Two controllers which communicate using the modbus protocol must have the same
subnet. FOr information on the communication variable SUBNET, see SPiiPlus Command
& Variable Reference Guide.

Version 3.10 47
SPiiPlus Modbus Setup Guide
8.   SPiiPlus Modbus Master Functionality Support

8. SPiiPlus Modbus Master Functionality Support


The SPiiPlus controller can also work as SPiiPlus Modbus Master. In order to implement Master
functionality, the controller provides the following ACSPL+ commands:
> Function outp sends a SPiiPlus Modbus command to a Slave through the specified
communication channel.
> Function inp receives from the specified communication channel a SPiiPlus Modbus Slave
response.
> Functions setconf (308, channel, SlaveIP) establishes the TCP connection with SPiiPlus
Modbus Slave with SlaveIP address. The same function setconf (308, channel, 0) with zero
IP address closes the TCP connection with SPiiPlus Modbus Slave.

8.1 Sending SPiiPlus Modbus Request


The outp function sends data to the specified communication channel.

int outp(channel, variable, start-index, number)

Parameters Description

channel Number of communication channel

variable Name of user-defined integer array (the array must be declared as local)

start index Index in the array (optional)

number Number of elements to be transmitted (optional)

Return Value - The function returns the number of actually transmitted characters, if succeeds. If
the function fails, a run-time error is generated.
Remarks - The function transmits to the specified channel a number element of the specified
variable, starting from the start-index element.
If start-index and number are omitted, the function transmits all elements of the specified variable.
If number is omitted, the function transmits elements of the specified variable, starting from the
start-index element up to the last element.
The variable can be either integer or real array, depending on what type of Slave's register to be
written to.

8.2 SPiiPlus Modbus Protocol Mode


If the specified channel is defined for the SPiiPlus Modbus protocol, the function treats the variable
array as follows:
> Element 0: Slave Address
> Element 1: Function Code
> Elements 2..N: Data according to SPiiPlus Modbus RTU request:

Version 3.10 48
SPiiPlus Modbus Setup Guide
8.   SPiiPlus Modbus Master Functionality Support

> Function Code = 01 (Read Coils):


> Element 2: Starting Coil Address
> Element 3: Quantity of Coils
> Function Code = 03 (Read Registers):
> Element 2: Starting Register Address
> Element 3: Quantity of Registers
> Function Code = 05 (Write Single Coil):
> Element 2: Coil Address
> Element 3: Output Value
> Function Code = 15 (Write Multiple Coils):
> Element 2: Starting Output Address
> Element 3: Quantity of Outputs
> Element 4: Byte Count = N
> Elements 5..N+4: Outputs Value as Bytes
> Function Code = 16 (Write Multiple Registers):
> Element 2: Starting Address
> Element 3: Quantity of Registers = N
> Element 4: Byte Count = N*2
> Element 5..N+4: Register Value.
The Register Value is 16-bit integer value that should be written to the SPiiPlus Modbus register.

8.3 32-bit Integer Registers


The controller writes the 32-bit registers as two 16-bit registers. For that user needs to put each 16-
bit registers in separate variable element. Order of 16-bit registers should be the same as order in
Slave. In order to interpret the values as 32-bit integer number, Slave needs to combine two 16-bit
elements in to one 32-bit.
For example, if controller writes 32-bit registers as two 16-bit registers where first sent word is hi-
part and then low part, then ACSPL+ program has the following look:

int i_rqst(100) !Request array


int i_rspn(100) !Response array
int reg !Slave 32-bit register
int result !Function result
int slave_IP
int slave_channel
int slave_id
int Timeout
Timeout = 1500
slave_channel = 17 !can be 17, 18, or 19
slave_IP = 10 + 0 *pow(2, 8) + 0 * pow(2,16) + 102 *pow(2,24) ! =

Version 3.10 49
SPiiPlus Modbus Setup Guide
8.   SPiiPlus Modbus Master Functionality Support

10.0.0.102
slave_id = 10 !1 to 247 for Modbus Slave IDs
!open the Modbus TCP connection with slave device
setconf(308, slave_channel, 0) !close
setconf(308, slave_channel, slave_IP) !open
setconf(309,slave_channel,0) ! hi-word first order (default
configuration)
inp(slave_channel) ! purges off all characters received before in the
channel
reg = 0x10000 !Value to be written
i_rqst(0)=10 !Slave ID
i_rqst(1)=16 !Write Holding Register
i_rqst(2)=64 !Starting Address
i_rqst(3)=2 !Quantity of Registers
i_rqst(4)=4 !Byte Count
if (reg < 0)
i_rqst(5 )= (0xFFFF - floor((reg&0x7FFFFFFF)/256/256)) | 0x8000
else i_rqst(5)=floor(reg/256/256)
end
i_rqst(6)=reg&0x0000FFFF
result = outp(17, i_rqst, 0, 7) !send request through channel 17
result = inp(slave_channel, i_rspn, 0, 4, Timeout) !receive Slave
response
i_rqst(0)=10 ; i_rqst(1) = 3 ; i_rqst(2) = 64 ; i_rqst(3) = 2
result = outp(slave_channel, i_rqst, 0, 4) !send request to Slave
result = inp(slave_channel, i_rspn, 0, 5, Timeout) !receive Slave
response
stop

8.4 32-bit Floating Point Registers


In order to write one 32-bit floating point Slave's register, the user needs to put into variable a
Register Value as 32-bit floating number. The controller will send the value as two sequential 16-bit
words. The order of words is configured by the setconf (309,…) function. In this case, the Slave
should interprets these two sent 16-bit words as one 32-bit floating number.

real r_rqst(100) !Request array


real r_rspn(100) !Response array
real reg !Slave 32-bit register
int result !Function result
int slave_IP
int slave_channel
int slave_id
int Timeout
Timeout = 1500
slave_channel = 17 !can be 17, 18, or 19
slave_IP = 10 + 0 *pow(2, 8) + 0 * pow(2,16) + 102 *pow(2,24) ! =
10.0.0.102
slave_id = 10 !1 to 247 for Modbus Slave IDs
!open the Modbus TCP connection with slave device

Version 3.10 50
SPiiPlus Modbus Setup Guide
8.   SPiiPlus Modbus Master Functionality Support

setconf(308, slave_channel, 0) !close


setconf(308, slave_channel, slave_IP) !open
setconf(309,slave_channel,0) ! hi-word first order (default
configuration)
inp(slave_channel) ! purges off all characters received before in the
channel
r_rqst(0)=10 !Slave ID
r_rqst(1)=16 !Write Holding Register
r_rqst(2)=0 !Starting Address
r_rqst(3)=2 !Quantity of Registers
r_rqst(4)=4 !Byte Count
r_rqst(5)=1234567.89 !Value to be written
result = outp(17, r_rqst, 0, 6) !send request through channel 17
result = inp(slave_channel, r_rspn, 0, 4, Timeout) !receive Slave
response
r_rqst(0)=10 ; r_rqst(1) = 3 ; r_rqst(2) = 0 ; r_rqst(3) = 2
result = outp(slave_channel, r_rqst, 0, 4) !send request to Slave
result = inp(slave_channel, r_rspn, 0, 5, Timeout) !receive Slave
response
stop

8.5 Receiving SPiiPlus Modbus Response


The inp function receives data from the specified communication channel.

int inp(channel, variable, start-index, number, timeout)

Parameters Description

Channel Number of communication channel

Name of user-defined integer array (optional) - the array must be


Variable
declared as LOCAL

Start Index Index in the array (optional)

Number The requested number of characters (optional)

Timeout Timeout in milliseconds (optional)

Return Value - The function returns the number of actually filled array elements, if succeeds.
If timeout occurs, the function returns zero.
If the function fails, a run-time error is generated.
Remarks - If the variable argument is omitted, the function purges off all characters received
before in the channel.
If the variable argument is specified, the function accepts one or more characters from the
specified channel and assigns them to the sequential elements of the variable array.

Version 3.10 51
SPiiPlus Modbus Setup Guide
8.   SPiiPlus Modbus Master Functionality Support

Each ASCII character is represented by its numerical value and is stored in a separate element of the
array.
If start-index is specified, the first received character is assigned to the array element with the
specified index. If start-index is omitted, the assignment starts from the first element of the array.
If number is specified, the function does not return until the exact number of characters is
received. Any received character, including carriage return and other non-printable characters, is
stored in the array. In this case the function return value is strictly equal to number.
If number is omitted, the function continues receiving characters until the last element of array is
assigned or the carriage return character is received. The received carriage return is not stored in
the array. The function return indicates the number of assigned array elements.
If timeout is specified, the function waits for data not more then timeout milliseconds. If no data
within timeout, the function returns zero.
If timeout is omitted, the function checks for data for infinity, meaning that an infinite timeout is
specified.
SPiiPlus Modbus Protocol Mode
If the specified channel is defined for SPiiPlus Modbus protocol, the function retrieves data in the
variable array as follows:
> Element 0: Slave Address
> Element 1: Function Code
> Elements 2..N: Data according to SPiiPlus Modbus RTU response:
> Function Code = 01 (Read Coils), 02 (Read Inputs) - Response:
> ELEMENT 2: Byte Count = N
> Element 3..N+2: Coils Status as Bytes
> Function Code = 03 (Read Registers), 04 (Read Input Registers) - Response:
> Element 2: Byte Count = N*2
> Element 3..N+2: Registers Value
The function is for each SPiiPlus Modbus register in separate array element as 16-bit integer value.

8.6 Reading of 32-Bit Integer Registers


The controller returns the 32-bit registers as two 16-bit registers and puts each 16-bit registers in
separate variable element. In order to interpret the values as 32-bit integer number, the user
needs to combine two 16-bit elements in to one 32-bit. Order of 16-bit registers should be the
same as order in Slave.
For example if Slave sends its 32-bit registers as two 16-bit registers where first sent word is hi-part
and then low part, then ACSPL+ program that combines these two registers into one 32-bit has the
following look:

int i_rqst(100) !Request array


int i_rspn(100) !Response array
int reg !Slave 32-bit register
i_rqst(0)=10 !Slave ID

Version 3.10 52
SPiiPlus Modbus Setup Guide
8.   SPiiPlus Modbus Master Functionality Support

i_rqst(1)=3 !Read Holding Register


i_rqst(2)=60 !Starting Address
i_rqst(3)=2 !Quantity of Registers
outp(17, i_rqst, 0, 4) !send request to Slave
reg = inp(17, i_rspn, 0, 5, 500) !receive Slave response
if reg > 0
if i_rspn(3)&0x8000; i_rspn(3)=i_rspn(3)|0xFFFF0000; end
reg=i_rspn(3)*256*256 + i_rspn(4)
end

8.7 Reading of 32-bit Floating Point Registers


The controller returns each 32-bit floating number into separate Array’s element.
> Function Code = 05 (Write Single Coil), 06 (Write Single Register) - Response:
> Element 2: Address
> Element 3: Coil or Register Value
> Function Code = 15 (Write Multiple Coils), 16 (Write Multiple Registers) - Response:
> Element 2: Starting Address
> Element 3: Quantity of Coils or Registers

8.8 Establishing/Closing SPiiPlus Modbus TCP Connection


The setconf function with key 308 establishes or closes the TCP connection with the Slave device
with the specified Slave IP address.

setconf(308, channel, slaveIP)

Parameters Description

Specifies the SPiiPlus Modbus TCP channel. Available channels are 17, 18
channel and 19. So, the controller can communicate with up to three SPiiPlus
Modbus Slave devices at the same time.

slaveIP specifies the SPiiPlus Modbus Slave device IP address. The slaveIP
slaveIP address is an unsigned 32-bit integer, where each byte represents the
corresponding part of dotted IP address.

Remarks - If Slave has the following address: 192.168.1.10, the slaveIP parameter should be 10*2^24
+ 1*2^16 + 168*2^8 + 192 = 167880896 (0x0A01A8C0).
If the specified channel is already open, the function closes the opened channel and then opens a
new one.
If slaveIP is zero, the function closes the TCP connection.

Version 3.10 53
SPiiPlus Modbus Setup Guide
9.   SPiiPlus Modbus Setup Example

9. SPiiPlus Modbus Setup Example


The following example shows how to set up a SPiiPlus Modbus system containing:
> SPiiPlus controller as SPiiPlus Modbus Master
> SPiiPlus controller as SPiiPlus Modbus Slave
> TCP/IP communication between master and slave.
This example also shows how to enable axis 0.

9.0.1 Slave side


Slave should be assigned a “slave Modbus address” using CONID.
The following code can be executed during power up of the controller:

CONID=1
setconf(309,1,1) !Low word first, then Hi word
STOP

In addition, the following lines must be uncommented in D-Buffer:

axisdef X=0,Y=1,Z=2,T=3,A=4,B=5,C=6,D=7
axisdef x=0,y=1,z=2,t=3,a=4,b=5,c=6,d=7

9.0.2 Master side


On the master side, it's important to open interface with the Slave.
The following code opens TCP/IP communication with the Slave.

INT i_rqst(100) ! Request array


INT i_rspn(100) ! Response array
INT result1, result2 ! Function result
INT slave_IP, slave_channel, slave_id, Timeout
Timeout = 1500
slave_channel = 17 ! Can be 17, 18, or 19
slave_IP = 10 + 0*POW(2, 8) + 0*POW(2,16) + 100*POW(2,24) ! = 10.0.0.100
slave_id = 1 ! 1 to 247 for MODBUS Slave IDs
! Open the Modbus TCP connection with slave device
SETCONF(308, slave_channel, 0) ! Close
SETCONF(308, slave_channel, slave_IP) ! Open
INP(slave_channel) ! Purges off all characters received before in the
channel
i_rqst(0) = slave_id
i_rqst(1) = 5 ! Write Single Coil
i_rqst(2) = 9600 ! Coil address for axis 0 enable
i_rqst(3) = 0xFF00! Set bit high by sending 0xFF00
result1 = OUTP(slave_channel, i_rqst, 0, 4) ! Send request through
channel 17
result2 = INP(slave_channel, i_rspn, 0, 10, Timeout) ! Receive Slave

Version 3.10 54
SPiiPlus Modbus Setup Guide
9.   SPiiPlus Modbus Setup Example

response
STOP

Version 3.10 55
5 HaTnufa St.
Yokne'am Illit 2066717
Israel
Tel: (+972) (4) 654 6440 Fax: (+972) (4) 654 6443

Contact us: sales@acsmotioncontrol.com | www.acsmotioncontrol.com

You might also like