- •Introduction
- •1 Quick Start
- •Overview of the Example
- •Create a Project and Adding a Drive
- •Editing the Program
- •Building and Downloading the Program
- •Monitoring Operation of the Program
- •Importing sm-Applications Lite syptLite Programs
- •Upgrading from the dpl Toolkit
- •Loading a dpl File from disk
- •Uploading a dpl File from a Target Node
- •Starting sypt
- •Configuration Editor
- •Menu Bar
- •Toolbars
- •View toolbar for the Hardware Architecture view
- •Status Bar
- •Hardware Architecture View
- •Link Architecture View
- •Cyclic Data View
- •Specifying Workbench Options
- •Dpl Editor
- •SyptLite
- •Watch Window
- •Menu Bar
- •Managing Projects
- •Creating Projects
- •Opening Projects
- •Saving Projects
- •Viewing Project Properties
- •Cloning Projects
- •Closing Projects
- •Printing Projects
- •Defining a Project Header
- •Inserting Nodes
- •Selecting Nodes
- •Editing the Properties of Nodes
- •Editing Node Descriptions
- •Deleting Nodes
- •Cutting, Copying, and Pasting Nodes
- •Rearranging Nodes
- •Networks
- •Unreachable Nodes
- •Inserting Networks
- •Selecting Networks
- •Deleting Networks
- •Editing the Properties of Networks
- •Pc Communications Settings
- •Rearranging Networks
- •Splitting Network Rails
- •Merging Network Rails
- •Cyclic Data Links
- •Inserting Data Links
- •Inserting Broadcast Links
- •Defining Cyclic Data
- •Viewing Cyclic Data
- •Selecting Links
- •Rearranging Links
- •Deleting Data Links
- •Editing Source/Destination Node Descriptions
- •Annotations
- •Inserting Annotations
- •Editing the Contents of Annotations
- •Formatting Text in Annotations
- •Deleting Annotations
- •Dpl Programs
- •Creating Programs
- •Opening and Closing Programs
- •Saving Programs
- •Editing Programs
- •Specifying the Floating-Point Model
- •Inserting Sections
- •Inserting Diagrams
- •Inserting Variables, Parameters or Numbers
- •Inserting Function Block Calls
- •Inserting Files
- •Inserting the Date and Time
- •Selecting Items in Programs
- •Cutting, Copying, and Pasting Items
- •Finding and Replacing Text
- •Go to a Source Line
- •Editing Diagram Titles
- •Editing/ Viewing the Properties of Programs
- •Printing Programs
- •Templates
- •Dpl Syntax Templates
- •Defining a Template
- •Dpl Templates Dialog
- •Defining a Template Category
- •Deleting a Template/ Changing a Template Name
- •Deleting a Category/ Changing a Category Name
- •Template Shortcut keys
- •Inserting a Template into a Program
- •Creating a Library
- •Specifying Function Block Properties
- •Library Folder Structure
- •Viewing Library Properties
- •Library Manager
- •Referencing and Using a Library
- •Removing a Reference To a Library
- •Exporting a Library
- •Importing a Library
- •Switching the Configuration Editor Online
- •Switching the Configuration Editor Offline
- •Node Detection and Indications
- •Successfully Detected Nodes
- •New Node
- •Nodes Not Found
- •Cyclic Data Mismatches
- •Cyclic Master and Trip Indications
- •Refreshing the View of Nodes While Online
- •Adding Detected Nodes
- •Deleting Target User Programs
- •Building Applications
- •Showing Build Errors
- •Downloading Node Programs
- •Uploading Node Programs
- •_______________________________________________________________________________________________ Accessing Diagnostic Information for Nodes
- •Accessing Identification Information for Nodes
- •Monitoring the Values of Variables and Parameters
- •Watching Values in the dpl Editor
- •Setting Up a Watch List
- •Opening and Closing Watch Lists
- •Saving Watch Lists
- •Adding Variables and Parameters to a Watch List
- •Selecting Watch List Items
- •Cutting, Copying, and Pasting Watch List Items
- •Removing Items from a Watch List
- •Editing the Properties of Watch List Items
- •Rearranging the Order of Watch List Items
- •Changing the Values of Variables or Parameters
- •Controlling Program Execution
- •Stopping and Starting Programs
- •Pausing and Resuming Programs
- •Stopping and Stepping Tasks
- •Running Tasks
- •Using Breakpoints
- •Switching dpl Programs to Editing Mode
- •Resetting Node Programs
- •Resetting Drives
- •Abs - Absolute
- •Ansiread - ansi Master Command
- •Ansireadn - ansi Master Command
- •Ansireply - ansi Master Command (ud70 and md29)
- •Ansireply - ansi Master Command (sm-Applications)
- •Ansiwrite - ansi Master Command
- •Ansiwriten - ansi Master Command
- •ApcSetRunMode
- •ApcReset
- •ApcGetOutputSpeed
- •ApcGetOutputSpeedRpmx10
- •ApcSelectAbsoluteMode
- •ApcSelectRelativeMode
- •ApcReadPar
- •ApcSetPositionResetOffset
- •ApcResetSourcesOnDisable
- •ApcDoNotResetSourcesOnDisable
- •ApcSetReferenceSource
- •ApcSetFeedbackSource
- •ApcSetNumOfTurnsBits
- •ApcEnableRefSourceMarker
- •ApcDisableRefSourceMarker
- •ApcEnableFbckSourceMarker
- •ApcDisableFbckSourceMarker
- •ApcResetRefSourceMarkerFlag
- •ApcResetFbckSourceMarkerFlag
- •ApcResetRefSourceFreezeFlag
- •ApcResetFbckSourceFreezeFlag
- •ApcInvertRefSource
- •ApcDoNotInvertRefSource
- •ApcInvertFbckSource
- •ApcDoNotInvertFbckSource
- •ApcSetReferencePosition
- •ApcSetFeedbackPosition
- •ApcGetReferenceStatus
- •ApcGetFeedbackStatus
- •ApcSelectReference
- •ApcSelectActionOnFreeze
- •ApcSetStopMode
- •ApcSetPositionSetPoint
- •ApcSetSpeedSetPoint
- •ApccamInitialise
- •ApccamInitialise1
- •ApccamInitialise2
- •ApccamInitialise3
- •ApcSetCamStartIndex
- •ApcSetCamSize
- •ApcSetCamDeltaSegLimit
- •ApcSetCamInterpolationMode
- •ApcSetCamOutRatioNumerator
- •ApcSetCamOutRatioDenominator
- •ApcSelectCamAbsoluteReset
- •ApcSelectCamZeroReset
- •ApcSetCamAbsResetIndex
- •ApcSetCamAbsResetPositionInSeg
- •ApcEnableCamSingleShot
- •ApcDisableCamSingleShot
- •ApcSetDigLockMode
- •ApcSetDigLockRatioNumerator
- •ApcSetDigLockRatioDenominator
- •ApcSetDigLockLockingSpeed
- •ApcSetDigLockLockingPosition
- •ApcSetSpeedOffset
- •ApcSetPositionOffset
- •ApcDisableRigidLock
- •ApcEnableProfile
- •ApcDisableProfile
- •ApcSetProfileAccelRate
- •ApcSetProfileDecelRate
- •ApcSetProfileMaxSpeedClamp
- •ApcSetPGain
- •ApcSetPGainSpeedClamp
- •ApcEnableExternalRefSpeed
- •ApcDisableExternalRefSpeed
- •ApcSetExternalRefSpeed
- •ApcEnableExternalRefPosition
- •ApcDisableExternalRefPosition
- •ApcSetExternalRefPosition
- •ApcSetOutputRatioNumerator
- •ApcSetOutputRatioDenominator
- •ApcSetupOutputChannel
- •ApcEnableOutputChannel
- •ApcDisableOutputChannel
- •ApcWriteOutputChannel
- •ApcToUserPosition
- •ApcToUserVelocity
- •ApcToUserAcceleration
- •Arrayget - Get Array Element
- •Arrayset - Set array element
- •Arraysort
- •Arraystat
- •Assram - Associate an array with a file
- •Autosync - ctNet Sync Master Redundancy
- •Autosyncerror
- •Average - Running Average
- •Bcd2bin - Binary-coded Decimal to Binary Conversion
- •Bin2bcd - Binary to Binary-coded Decimal Conversion
- •Bcd2seg - Binary-coded Decimal to Seven-segment Display Data
- •Blkdef - Block Parameter Write
- •Bridge - rs485 Serial Protocol Function
- •Cambox - cam function generator
- •Cambox2 - cam function generator
- •Cambox/cambox2 - cam information
- •Caminit - cam Table Initialise
- •CanConfigEvent
- •CanGetNodeAddr
- •CanReady
- •CanSetup
- •CanStatus
- •CanStatusAll
- •Checknode - Check Existence of Node on ctNet
- •CloseSmartCard
- •Cmodexfer
- •Cmp - Comparison Block
- •Condparw - Conditional Parameter Write
- •ConvertBackwards
- •ConvertForwards
- •Cos - Cosine Function
- •Crc16 - Cyclic Redundancy Check
- •Ctd - Down Counter
- •Ctu - Up Counter
- •Ctud - Up/ Down Counter
- •Ctnetdiagnostics
- •CtSyncDisableOutputChannel
- •CtSyncEnableOutputChannel
- •CtSyncGetSlaveReferences
- •CtSyncSetMasterReferences
- •CtSyncSetupOutputChannel
- •CtSyncWriteOutputChannel
- •Datastuff
- •Decoder4/decoder8
- •Digsel8 - Digital Select Block
- •IDMux/ fDMux / iDMux8 - De-multiplexers
- •Dterm - Differentiator Block
- •Editfastlink/editslowlink - ctNet Cyclic Link Editing
- •Egb / egb2
- •EnableCanTrips
- •Encoder4/encoder8 - Binary Encoder Blocks
- •Exp - Exponential Function
- •Filter - First-order Digital Filter
- •Float - Integer to Floating Point Conversion
- •Float32
- •Getchar - Read rs485 Port
- •GetNextSmartCardFile
- •GetParAttr
- •GetSamplesPerSec
- •GetTaskId
- •Home1 - Homing function
- •Home2 - Homing function
- •HiLoDet - Max and min value detection
- •Int - Floating Point to Integer Conversion
- •ITerm - Integrator Block
- •IWindow
- •ILimit/ fLimit
- •ILimit2/ fLimit2
- •IInvert/fInvert
- •Ln - Natural Logarithm
- •LinInt - Linear Interpolation
- •Modexfer
- •Mpot - Motorised Pot
- •Muldivrm
- •IMux / fMux / iMux2 / fMux2 / iMux8 - Multiplexers
- •Nand4 - Four-input nand Gate
- •Neg - Inverts Input
- •Netreply
- •Netstatus
- •Nor4 - Four-input nor Gate
- •OpenReadSmartCard
- •OpenWriteSmartCard
- •Or4 - Four-input or Gate
- •IOs/ fOs - Offset-Scale
- •Pfixread - Fixed Precision (3 dps) Parameter Read
- •Pfixread6 - Fixed Precision (6 dps) Parameter Read
- •Pfixwrite - Fixed Precision (3 dps) Parameter Write
- •Pfixwrite6 - Fixed Precision (6 dps) Parameter Write
- •Pid - pid Block
- •Posloop - Position Loop Controller
- •Posloop2 - Position Loop Controller
- •Precisiontimer
- •Pt - Pulse Timer
- •Ptd - Pulse Timer
- •Putblock
- •PutBottomWord
- •Putchar - Write Character to rs485 Port
- •Putkey - Write Character to Port
- •PutTopWord
- •RamLength
- •Ramp - Linear Ramp
- •Readnet
- •Readnetb
- •ReadReadOnlyBit
- •ReadSmartCardByte
- •Reg - Registration Block
- •ResetCanTimer
- •Rs/sr : Event Memory Latches
- •RtuReadRegs
- •RtuReadParas
- •RtuReadInputRegs
- •RtuPresetRegs
- •RtuPresetParas
- •RtuMasterReply
- •RtuMasterStatus
- •Runtime
- •Scheduleevent
- •SetConverterDenominator
- •SetConverterNumerator
- •SetCtnSync
- •SetRamLength
- •SetUserId
- •Shiftlr
- •SignedBottomWord
- •SignedTopWord
- •Sin - Sine Function
- •ISo/fSo : Scale-Offset
- •Splitter
- •SpGateway - ctNet to fieldbus gateway
- •Sq1int/ Sq2int - Square Interpolation
- •Sqr - Square Root Function
- •Sramp - s-Ramp Profile Generator Function
- •Ssramp - s-Ramp Profile Generator Function
- •Stuff2 / stuff4 / stuff8 - Bit Stuffers
- •Tan - Tan Function
- •Tcyclic - Cyclic Timer
- •ToffRet
- •Trl - Triggered Latch Function
- •UnAssram
- •UnsignedBottomWord
- •UnsignedTopWord
- •UserToApcAcceleration
- •UserToApcPosition
- •UserToApcVelocity
- •Vel2pos - Velocity Profile Integrator
- •Writenet
- •Writenetb
- •Wrnet - ctNet Write Command
- •Wrnetb - ctNet Block Parameter Write Command
- •WriteReadOnlyBit
- •WriteSmartCardByte
- •Xor4 - Four-input xor Gate
- •SmartCard Example Program
- •Supported Languages
- •Variables, Parameters, Constants and Data Types
- •Variables
- •Bit Access For Variables
- •Predefined Variables
- •Parameters
- •Plc Registers
- •Data Types
- •Constants
- •Numbers
- •Variable and Parameter Scope
- •Aliases
- •Program Structure
- •Subroutines
- •User-Defined Function Blocks (udfBs)
- •Calling udfBs
- •Udfb Argument Restrictions
- •Udfb Instances
- •Udfb Code Sections
- •Dpl (Drive Programming Language) Reference
- •Directives
- •Operators
- •Conditional Operators
- •Comments
- •Constructs
- •Variable Assignment
- •If ... Then
- •For Loop
- •Function Block Call
- •Ld/ fb Elements
- •Ld/ fb Coil Types
- •Ld/ fb Contact Types
- •Ld/ fb Order of Execution
- •Qld (Quick Ladder Diagram) Reference
- •Qld Elements
- •Qld Coil Types
- •Qld Contact Types
- •Advanced Position Controller
- •Programming Hints and Tips
- •Copyright
Overview of the Example
The remaining stages in the Quick Start will show how to create and execute the following program.
The program contains two tasks: Initial and Clock. These tasks will be executed automatically by the target. The Initial task will be executed once by the target when the user program starts executing. The Clock task will be periodically executed once the Initial task has completed.
The example program uses a RAMP block to generate a triangular waveform. The code in the Initial task initialises some programs variables and ensures that the target parameters are set to execute the Clock task once every 10 milliseconds. The Clock task performs a linear RAMP from the positive value of drive parameter #18.20 to its negative value. The value of #18.20 is limited to +/- 1000.
Note: |
In SYPT all parameter numbers are preceded with a # character. For example #18.20 means parameter 20 in menu 18. |
UpRate% and DownRate% are program variables. A program in SYPT can define and use as many variables as desired (up to the limit of the target RAM size). Variables with names ending in a % are 32-bit signed integers.
The next quick start stage is:
Create a Project and Adding a Drive
Create a Project and Adding a Drive
This is stage 2 of the quick start example for SYPT.
In this stage a new project will be created and a node added for which a program will be created in the next stage.
Step 1 - Start SYPT and Create a Project
Start SYPT. The SYPT startup dialog will be displayed as follows.
Ensure that the Start a New Project option is selected and that the Network Type field has been set to CT-RTU. Press OK. The SYPT Configuration Editor will then be displayed looking something like the following.
Step 2 - Add A Unidrive SP and SM-Applications option
To add a node to the project double-click the new node hotspot shown to the right of the PC. The Node Properties dialog is displayed.
Make sure that the Drive/ Target field has a Unidrive SP drive type selected. Ensure that the Node ID field has the value 1 and the On Network field has the value CT-RTU. When a Unidrive SP node is added into a project, an SM-Applications option is automatically placed in option slot 3. To verify this, select the Option 3 pane at the top of the dialog.
Ensure that the Option Type is SM-Applications and that the On Network field has the value No Network. Press OK. The Unidrive SP is added into the project with an SM-Applications option in slot 3.
Step 3 - Save the Project
From the File menu, choose Save Project. The Save Project As dialog is displayed.
In the Name field enter QuickExample and press Save. SYPT saves the project.
This is the end of stage 2 of the Quick Start example.
The next Quick Start stage is:
Editing the Program
The previous Quick Start stage was:
Overview of the Example
For more information on the editing actions performed in this section, see:
Starting SYPT
Creating Projects
Saving Projects
Inserting Nodes
Editing the Properties of Networks
Editing the Program
This is stage 3 of the quick start example for SYPT.
In this stage the example program will be created ready for building and downloading to a target in the next stage.
Step 1 - Open the DPL Editor for the SM-Application program
In the Configuration Editor, select the SM-Applications in slot 3 of the Unidrive SP. When selected the option slot goes blue as follows.
Open the DPL Editor for the node by double-clicking on the SM-Applications option OR in the Edit menu choosing the Node Program option. The DPL Editor will open showing the default program created for the option. The default program contains an empty Background task.
Step 2 - Enter the Initialisation Code
In this step initialisation code is entered. The code will initialise the variables used in the program and change the setup parameters for the option to ensure that the Clock task we will enter later runs at the correct rate. Initialisation code is best placed in the Initial task which is executed once by the target when the user program starts running.
To create the Initial task select the Background node in the tree in the Workspace on the left of the DPL editor. Right-click to display a popup menu and choose Insert Task/ Section. The Insert Task dialog is displayed.
Ensure the Initial Task is selected and press OK. An empty Initial task will be inserted into the main DPL view above the Background task.
Enter the following code inside the Initial task.
The DPL Editor should now look like:
Step 3 - Create the Clock task and remove the Background task
In this step the Clock task is created. We do this in the same way as the Initial task was created in the previous step. Select the Background node in the tree in the Workspace on the left of the DPL editor. Right-click to display the popup menu and choose Insert Task/ Section. Ensure the Clock task is selected and press OK to insert a Clock task into the program above the Background task.
To delete the Background task select the Background node in the tree in the Workspace, right-click to bring up the popup menu and choose Delete.
The DPL Editor should now look like:
Step 4 - Enter a Quick Ladder diagram to Limit the RAMP
In this step a Quick Ladder diagram is entered at the start of the Clock task. The diagram will limit the value of parameter #18.20 which is used in the program to set the requested limits of the RAMP. The limiting function does not have to be done using a Quick Ladder diagram - it could be done in DPL or function block - but doing the LIMIT in Quick Ladder serves as an example of how to use a diagram in a program.
With the mouse, left-click inside the Clock task in the main DPL view on the blank line just under the text // put your section code here. Right-click and from the popup menu choose Insert Quick LD diagram. A new window is opened allowing a QLD diagram to be entered. The menus and toolbars in the DPL editor switch to allow editing of the diagram.
Press F6 to insert a function block. The Select Function Block dialog is displayed. Scroll down the list of available blocks and select the LIMIT block.
Note: |
If the Select function block dialog was not displayed, type Ctrl+Z to undo insertion of the function block and in the Options menu choose Auto Prompt For Input. Repeat the last step to reinsert the function block. |
Press OK. A new ladder rung is inserted into the diagram containing the LIMIT block.
The inputs and output for the LIMIT block now need to be specified. Double-click the area just to the left of the IN input to the function block. The Select variable dialog is displayed allowing a variable, parameter or number to be associated with the input. The variables and parameters already entered into the Initial Task appear in the dialog. Select #18.20 and press OK.
Note: |
If the dialog does not show the variables and parameters already entered into the Initial task, press the Scan button to make the dialog refresh its displayed list of symbols. |
The diagram should now look like:
Double-click to the left of the limit input and enter 1000 into the Select variable box then press OK. Double-click to the right of the Q output and select #18.20 in the Select variable dialog then press OK. The diagram should now look like:
Right-click the mouse inside the diagram and from the popup menu choose Goto Preview. The main DPL view will be displayed.
Step 4 - Enter the call to the RAMP function block
Click the mouse inside the Clock task under the Quick Ladder diagram. Enter the text RampOutput% = so that the Clock task looks like:
Press F7 to display the Select function block dialog. Scroll down the list of available blocks and select the RAMP block. Press OK to insert a template function block call into the Clock task.
Change the values being passed into the RAMP block to match those below
Finally, enter the following code which swaps the RAMP limits when a limit is reached.
The program is now complete. Save the program by choosing Save from the File menu.
This is the end of stage 3 of the Quick Start example.
The next Quick Start stage is:
Building and Downloading the Program
The previous Quick Start stage was:
Create a Project and Adding a Drive
For more information on the editing actions performed in this section, see:
Opening and Closing Programs
Editing Programs