paradym-31 getting started - advantechdownloadt.advantech.com/productfile/downloadfile3/1-11... ·...

21
Paradym-31 Getting Started 1. Create a file Before you begin it is important that you must understand the file structure of Paradym-31. The file structure bases on the hierarchal construction, as you see in the following diagram, there are three levels of this hierarchy, the highest level is Project, the next level is Resource, and the last one is Program. You can regard Project as a directory, Resource is a sub-directory of Project and Program is a file of Resource. Therefore, a Project may consist of many Resources, each Resource also can contain many Programs. The below diagram illustrates the relationship between these three levels. File structure of Paradym-31 ( Hierarchy ) Now you can follow the steps to create your Project, Resource and Program: Step1: [File] L [New] L [Project] P Pr ro oj j e ec ct t R Re es s o o u ur rc ce e 1 1 R Re es s o o u ur rc ce e 2 2 P P r ro og gr r a am m 1 1 P P r ro og gr r a am m 2 2 P P r ro og gr r a am m 3 3 P P r ro og gr r a am m 1 1 P P r ro og gr r a am m 2 2 P P r ro og gr r a am m 3 3

Upload: others

Post on 08-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Paradym-31 Getting Started - Advantechdownloadt.advantech.com/ProductFile/Downloadfile3/1-11... · 2017-07-31 · Paradym-31 Getting Started 1. Create a file Before you begin it is

Paradym-31 Getting Started

1. Create a fileBefore you begin it is important that you must understand the file structure of

Paradym-31. The file structure bases on the hierarchal construction, as you see in

the following diagram, there are three levels of this hierarchy, the highest level is

Project, the next level is Resource, and the last one is Program. You can regard

Project as a directory, Resource is a sub-directory of Project and Program is a file

of Resource. Therefore, a Project may consist of many Resources, each Resource

also can contain many Programs. The below diagram illustrates the relationship

between these three levels.

File structure of Paradym-31 ( Hierarchy )

Now you can follow the steps to create your Project, Resource and Program:

Step1: [File] è [New] è [Project]

PPrroojjeecctt

RReessoouurrccee 11 RReessoouurrccee 22

PPrrooggrraamm 11PPrrooggrraamm 22PPrrooggrraamm 33

PPrrooggrraamm 11PPrrooggrraamm 22PPrrooggrraamm 33

Page 2: Paradym-31 Getting Started - Advantechdownloadt.advantech.com/ProductFile/Downloadfile3/1-11... · 2017-07-31 · Paradym-31 Getting Started 1. Create a file Before you begin it is

Step2 : Type the name of your Project and select the location to create it

Step3: Type the name of your Resource and select correct target environment

M Remark:

DOS_PC è This resource runs on a standard computer with MS-DOS

version 3.1 or higher. P-31 communicates with this computer serially

using the RS-232 serial ports. ( Ex: ADAM-5510 )

WindowRealTimeKernal è This resource runs on the same computer as

P-31 with Windows 3.1 for Workgroup or Windows 95. Thus

eliminating the need for setting up a communications protocol since

both P-31 and your programs are running on the same computer.

WinNTRealTimeServer è This resource will acts as a virtual machine and

runs on a computer with Windows NT workstation version 4.0. In

order to communicate with WinNTRealTimeServer, P-31 must also be

running on a Windows NT 4.0 workstation. But if P-31 and the

Page 3: Paradym-31 Getting Started - Advantechdownloadt.advantech.com/ProductFile/Downloadfile3/1-11... · 2017-07-31 · Paradym-31 Getting Started 1. Create a file Before you begin it is

WinNTRealTimeServer are running on separate computers, they will

need to communicate via TCP/IP address over a LAN.

( Please refer to the manual of P-31 to get detailed information )

Step4: Select Com port of DOS PC ( ADAM-5510 ) to communicate with P-31

Step5 : Select proper Com port of the computer with P-31

M Remark: If you choose DOS_PC as resource, you must use serial port to

communicate with each other. So you should set the correct Com

ports in P-31 software package. Keep one more thing in your mind,

the wiring between DOS_PC and P-31 is not pin to pin, that is to

say, you need to exchange some pins as follows:

DOS_PC Paradym-31

TX çè RX

RX çè TX

GND çè GND

Step6: Type the name of your Program

Page 4: Paradym-31 Getting Started - Advantechdownloadt.advantech.com/ProductFile/Downloadfile3/1-11... · 2017-07-31 · Paradym-31 Getting Started 1. Create a file Before you begin it is

Step7: Creating a file is successful and you’ll enter the developing environment

M Remark: You can follow the below statements to create, open, close, delete or

backup your Project / Resource / Program.

Create : [File] è [New] è [Project] / [Resource] / [Program]

Open : [File] è [Open] è [Project] / [Resource] / [Program]

Close : [File] è [Close] è [Project] / [Resource] / [Program]

Delete : [File] è [Delete] è [Project] / [Resource] / [Program]

Backup : [File] è [Backup] è [Project] / [Resource] / [Program]

Page 5: Paradym-31 Getting Started - Advantechdownloadt.advantech.com/ProductFile/Downloadfile3/1-11... · 2017-07-31 · Paradym-31 Getting Started 1. Create a file Before you begin it is

2. Select tool languageThere are three tool languages in Paradym-31, that includes SFC ( Sequential

Function Charts ), LD ( Ladder Diagram ) and FBD ( Function Block Diagram ).

Before you develop your application, you should select proper tool language.

SFC ( Sequential Function Charts ) :

SFC is a graphical language using simple graphical objects to diagram any

sequential process. It provides a clear graphical representation of the process state

machine.

LD ( Ladder Diagrams ) :

LD is an outgrowth of the “Relay Ladder” commonly used in the programming of

PLCs. This offers you a visual method of creating Boolean expressions. By

Tasks you want to do in the step

Conditions, flow control

Step

Page 6: Paradym-31 Getting Started - Advantechdownloadt.advantech.com/ProductFile/Downloadfile3/1-11... · 2017-07-31 · Paradym-31 Getting Started 1. Create a file Before you begin it is

satisfying the elements of the expression power flows through a coil at the output

of a rung. The ladder logic executes from top to bottom and from left to right.

FBD ( Function Block Diagrams ) :

FBD is also a graphical programming language and allows you to simply create

and edit complex programs using a powerful set of tools.

M Remark: Actually, it is allowed to use these three tool languages at the same

time. In SFC, you can use LD and FBD in the actions, just like the

following figure. Besides, you also can insert any FBD in LD.

AND

OR

Multi-Output

Page 7: Paradym-31 Getting Started - Advantechdownloadt.advantech.com/ProductFile/Downloadfile3/1-11... · 2017-07-31 · Paradym-31 Getting Started 1. Create a file Before you begin it is
Page 8: Paradym-31 Getting Started - Advantechdownloadt.advantech.com/ProductFile/Downloadfile3/1-11... · 2017-07-31 · Paradym-31 Getting Started 1. Create a file Before you begin it is

3. Develop your programAfter selecting proper tool language, you can refer to the following steps to

develop your application. Here we use LD as our tool language.

Step1: Draw the script of your system with LD

According to your application, you can decide how many inputs and outputs

you want to use, and define the relationship between them in advance. After

that, use some build-in icons from toolbox to implement your application.

Step2: Add and define variables

A P-31 variable is the tag used by various execution elements of the program.

That is to say, you can define variables to represent physical I/O or internal

data, and use these variables to assign each element of your program. Actually,

there are several types of variables, including

Project variables è Available to all elements in this Project

Resource variables è Available to all elements in this Resource

Program variables è Available to all elements in this Program

The relationship between them is shown as below:

PPrrooggrraammvvaarriiaabbllee

PPrroojjeecctt vvaarriiaabbllee

RReessoouurrccee vvaarriiaabbllee

Page 9: Paradym-31 Getting Started - Advantechdownloadt.advantech.com/ProductFile/Downloadfile3/1-11... · 2017-07-31 · Paradym-31 Getting Started 1. Create a file Before you begin it is

Please click the proper variable icon from top toolbar to add some variables

After that, you’ll see the following figure

Please click [Add] button to add variables and the folllowing dialog box is

appeared.

Don’t forget variables can be represented as internal data or physical I/O. If

you want to add an internal variable, just fill out items of Name and Type. But

for physical I/O, you should select Input or Output button, then you’ll see IO

Project variable Resource variable Program variable

Page 10: Paradym-31 Getting Started - Advantechdownloadt.advantech.com/ProductFile/Downloadfile3/1-11... · 2017-07-31 · Paradym-31 Getting Started 1. Create a file Before you begin it is

Driver, With IO Size of and IO Physical Address are active. So you can

accord to your request to select the relative IO driver and IO size to define

your physical I/O variable. Please refer to the below remarks to set IO

Physical Address.

M Remark: The following list shows the I/O drivers of ADAM-5510:

I/O Module I/O Type I/O Driver Name Bits/Channels

DIP Switch Digital Input ADAMDIP 8

ADAM5017 Analoge Input ADAM501718 8

ADAM5018 Analoge Input ADAM501718 7

ADAM5024 Analoge Output ADAM5024 4

ADAM5050 Digital In/Out ADAM5050 16

ADAM5051 Digital Input ADAM5051 16

ADAM5052 Digital Input ADAM5052 8

ADAM5056 Digital Output ADAM5056 16

ADAM5060 Relay Output ADAM5060 6

ADAM5068 Relay Output ADAM5068 8

M Remark: Please pay your attention to the item of IO Physical Address. There is a

rule of addressing for your reference, please follow this rule to set the

address of I/O modules in ADAM-5510:

0-3 for AO

Formula è Address = S.C S: Slot, 0-3 C: Channel, 0-7 for AI

0-15 for DI/O

Example:

ADAM-5051 is inserted in Slot1 of ADAM-5510, so the address of first

channel ( bit0 ) of ADAM-5051 is 1.0

M Remark: Take care of Type and With IO Size of, the following is for your

reference:

For AI/AO variable: Type è INT, With IO Size of è Word

For DI/DO variable: Type è BOOL With IO Size of è Bit

You can’t select LONG or REAL type for AI/AO variables because any I/O

driver under P-31 doesn’t support these two type, but supported by internal

data variables. Therefore, you should select INT type for AI/AO variable

and we’ll explain how to solve the problem of real value in AI/AO under

P-31 later.

Page 11: Paradym-31 Getting Started - Advantechdownloadt.advantech.com/ProductFile/Downloadfile3/1-11... · 2017-07-31 · Paradym-31 Getting Started 1. Create a file Before you begin it is

M Remark: In fact, we use amplifier in software to solve the problem of real or

floating. That is to say, we amplify the reading of AI/AO so that we can

convert the value from real type to integer type. The following list shows

the multiple of different input/output range for AI/AO:

For ADAM5017/18: Reading value = Real input value X Multiple

Input Range Multiple

+/- 10 V 1000

+/- 5 V 1000

+/- 2.5 V 10000

+/- 1 V 10000

+/- 500 mV 10

+/- 150 mV 100

+/- 100 mV 100

+/- 50 mV 100

+/- 15 mV 1000

+/- 20 mA 1000

Temperature ( TC ) 10

For ADAM5024: Real output value = Setting value / Multiple

Output Range Multiple

0-20 mA 1000

4-20 mA 1000

0-10 V 1000

After setting the IO physical variables of ADAM-5510, you can quit “Add

Program Variable” window and check all variables you set are all right or not

from “Program Variable” list.

Page 12: Paradym-31 Getting Started - Advantechdownloadt.advantech.com/ProductFile/Downloadfile3/1-11... · 2017-07-31 · Paradym-31 Getting Started 1. Create a file Before you begin it is

So far you complete to add relative program variables, now what you should

do is to assign all elements of your application with these variables. Please

double click the element you want to assign, then “Variable” window is pop-

up, just select the proper variable.

You can use the same way to assign all elements, then the final result is shown

as follows:

M Remark: Be careful to assign variables of FBD. You should type the name of the

FBD, then focus on certain Symbolic variable ( Symbolic Input or

Symbolic Output ) and type correct and proper variable name, just like

the following figures:

Page 13: Paradym-31 Getting Started - Advantechdownloadt.advantech.com/ProductFile/Downloadfile3/1-11... · 2017-07-31 · Paradym-31 Getting Started 1. Create a file Before you begin it is

M Remark: If you would like to use Timer Function in ADAM-5510, please note

that 1 tick of ADAM-5510 is about 54.5 ms ( 18.2 Hz ). However, the

unit of some timer FBDs such as TimerPulse, TimerOnDelay,

TimerOffDelay is tick, not ms or sec. So if you want to delay 1 sec

with TimerOnDelay FBD, please set PT as 18 ( 1 sec / 54.5 ¡ Ü 18 ),

don’t set 1 or 1000.

Actually, we have a plan to improve the accurate problem of timer

under ADAM-5510, the unit of Timer FBD with ADAM-5510 will be

between 1 and 10 ms instead of 54.5 ms. We’ll inform you when it is

finished.

Page 14: Paradym-31 Getting Started - Advantechdownloadt.advantech.com/ProductFile/Downloadfile3/1-11... · 2017-07-31 · Paradym-31 Getting Started 1. Create a file Before you begin it is

4. Complier & SimulationAlthough you design your strategy with graphical tool languages like LD, you

can use some compilers to convert these graphical diagrams to files with C code

under P-31. P-31 version 4.0 supports Borland C++ ( version 3.1 and 4.0 ), Turbo

C++ and Microsoft Visual C++ version 4.0 compilers, what kind of compiler you

should use depends on your target resource. The following figures will show you

which compilers are supported by each Resource.

P-31 allows you to simulate your control logic program without the need for a

controller or I/O modules. After you complete writing your application program and

before you load to a target resource, Simulation Function can let you to test it for

problems. This is a very powerful tool for testing, debugging and optimizing the

performance of your program.

Step1: Execute Simulation Function ( [Simulation] è [Build All and Run] )

Page 15: Paradym-31 Getting Started - Advantechdownloadt.advantech.com/ProductFile/Downloadfile3/1-11... · 2017-07-31 · Paradym-31 Getting Started 1. Create a file Before you begin it is

Step2: Check the status of compiler

Step3: Change values of variables to check your control logic

t

t

Page 16: Paradym-31 Getting Started - Advantechdownloadt.advantech.com/ProductFile/Downloadfile3/1-11... · 2017-07-31 · Paradym-31 Getting Started 1. Create a file Before you begin it is

M Remark: You can type New Value for INT variables, then click [Change] button

to implement it. For Bool variables, just click [Change] button. When

you change values of variables, please check the blinking with green

dots to prove your control process is correct.

Step4: Close simulation function ( [File] è [Close] è [Simulation] )

Page 17: Paradym-31 Getting Started - Advantechdownloadt.advantech.com/ProductFile/Downloadfile3/1-11... · 2017-07-31 · Paradym-31 Getting Started 1. Create a file Before you begin it is

5. Download a program into ADAM-5510P-31 converts your control logic program into a binary executable program.

This program is in the form of a DOS “.EXE”, you must download this program to

your target resource before you can run it.

Step1: Connection between Host PC and ADAM-5510 ( Null Modem Cable )

The pin assignment of RS-232 is shown as follows:

DB-9 DB-25 Symbol Description

1 8 DCD Carrier Detect2 2 * RX Receive Data

3 3 * TX Transmit Data

4 20 DTR Data Terminal Ready

5 7 * GND Ground

6 6 DSR Data Send Ready

7 4 RTS Request to Send

8 5 CTS Clear to Send9 22 RI Ring Indicator

Only three connections needed: RX, TX, GND. Please refer to the below

figure to complete your connections:

Paradym-31 ( Host PC ) DOS_PC ( ADAM-5510 )

TX ç=================è RX

RX ç=================è TX

GND ç=================è GND

Step2: Execute Download Function ( [Execution] è [Build All and Run] )

When you click [Build All and Run], P-31 compiles your program first, then

the status of compiler window is appeared. If success, just click [OK] button

to download the execution file; otherwise, click [Cancel] to debug it.

M Remark: Before you run download-function under P-31, please make sure the

receiving program ( P31_PC.EXE ) is running in ADAM-5510. It is

very important to do that, if not, ADAM-5510 can’t receive the

downloading file or commands from P-31. If you want to terminate

Compiler & Download & Run Download & Run

Page 18: Paradym-31 Getting Started - Advantechdownloadt.advantech.com/ProductFile/Downloadfile3/1-11... · 2017-07-31 · Paradym-31 Getting Started 1. Create a file Before you begin it is

P31_PC.EXE in ADAM-5510, it is ineffective to reset ADAM-5510.

you had better run ADAM5510.EXE and select Terminal mode, just

press the <CTRL> + <X> key to terminate P31_PC.EXE.

Status of Compiler Downloading file Finish

M Remark: There are four LED lights on ADAM-5510, that includes PWR, RUN,

COMM and BATT. When you run P31_PC.EXE in ADAM-5510, you

can see the LED of PWR is blinking, that means ADAM-5510 is

waiting for commands from P-31. If you run download function in P-

31, you can see the LEDs of RUN and COMM are blinking by turns.

That means ADAM-5510 is receiving the downloading file from P-31.

Therefore, you can know the status of ADAM-5510 by checking LED

lights.

Ø Ø

Page 19: Paradym-31 Getting Started - Advantechdownloadt.advantech.com/ProductFile/Downloadfile3/1-11... · 2017-07-31 · Paradym-31 Getting Started 1. Create a file Before you begin it is

6. Monitor the status of I/O modules on ADAM-5510You can verify that the control logic is working properly by inspecting that

status of different logic elements in a monitoring window. Monitor-Function can

allow you to exchange messages between P-31 and your target resource. But please

note that the status of the logic elements displayed on a monitoring window is not

real-time.

t

M Remark: The flashing green dot on the right side of the Status-Bar indicates that

P-31 is actively communicating with the target resource. If you have more than one

monitor window open at a time, this flashing green dot indicates there are message

to exchange between any one monitoring window and the target resource, not

necessary the current active window. The individual window’s title indicates when

the last reply was received.

By the way, P-31 also supports “On-Line Constant Changes” function. That

is to say, P-31 allows you to change all of the constants defined in a program while

Enable Monitor Switch Monitor status Run Program Stop Program

Page 20: Paradym-31 Getting Started - Advantechdownloadt.advantech.com/ProductFile/Downloadfile3/1-11... · 2017-07-31 · Paradym-31 Getting Started 1. Create a file Before you begin it is

monitoring this program in either Execution or Simulation mode. All constants

assigned to the Ladder Diagram function block’s input may be modified.

Step1: Double click certain FBD during monitoring

Step2: Select the constant ( not variable ) you want to change and type

new value

M Remark: The change to the constant is made temporarily in the run-time program,

not in the P-31 program. The new constant value is valid while the

program is running in the controller. If for any reason the controller’s

program is terminated and re-started, P-31 restores the original constant

Page 21: Paradym-31 Getting Started - Advantechdownloadt.advantech.com/ProductFile/Downloadfile3/1-11... · 2017-07-31 · Paradym-31 Getting Started 1. Create a file Before you begin it is

values. The user will need to repeat the On-Line constant change

procedure. It is strongly recommended that you update the constant value

in the P-31 program and download it again. This will make the new

constant value permanent.