Sample Programs For The Uss Protocol - Siemens SIMATIC S7-200 System Manual

Programmable controller
Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

Sample Programs for the USS Protocol

Example: USS Instructions Sample Program that Correctly Displays in STL
Using the USS Protocol Library to Control a MicroMaster Drive
Network 1
LD
CALL
Network 2
LD
CALL
Network 3
LD
=
LD
EU
=
LD
CALL
Network 4
LD
=
LD
EU
=
LDN
=
LD
CALL
Note: This STL code does not compile to LAD or FBD.
//Initialize USS Protocol:
//On the first scan, enable USS
//protocol for port 0 at 19200
//with drive address
//"0" active.
SM0.1
USS_INIT, 1, 19200, 16#00000001, Q0.0,
VB1
//Control parameters for Drive 0
SM0.0
USS_CTRL, I0.0, I0.1, I0.2, I0.3, I0.4, 0, 1,
100.0, M0.0, VB2, VW4, VD6, Q0.1, Q0.2,
Q0.3, Q0.4
//Read a Word parameter from Drive 0.
//Read parameter 5 index 0.
//1. Save the state of I0.5 to a
//
temporary location so that this
//
network displays in LAD.
//2. Save the rising edge pulse of I0.5
//
to a temporary L location so that
//
it can be passed to the subroutine.
I0.5
L60.0
I0.5
L63.7
L60.0
USS_RPM_W, L63.7, 0, 5, 0, &VB20, M0.1,
VB10, VW12
//Write a Word parameter to Drive 0.
//Write parameter 2000 index 0.
I0.6
L60.0
I0.6
L63.7
SM0.0
L63.6
L60.0
USS_WPM_R, L63.7, L63.6, 0, 2000, 0, 50.0,
&VB40, M0.2, VB14
Chapter 11
341

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents