Download presentation
Presentation is loading. Please wait.
1
FPWIN Pro
2
This is what we cover in next two days.
Program Editing This is what we cover in next two days. Ladder Editing How to draw constant Matsushita Address (Direct address) How to draw OUTPUT How to draw line How to change constant to B or Pulse, OUTPUT to SET Local Variable Simple Type How to declare Compile Option How to use FB Timer, Counter Comment FP-X motion profile Motion instruction How to draw Process order 32 bit DDT DUT profile How to use DUT ST programming Difference FB & FUN Creating FB using motion in ST How to use FB in ladder How to use FB in ST Save into Library How to use SHIFT How to create ARRAY Adr_of_I, Adr_of_O How to use bit array or DUT in F0 MV How to use F10 Other way to use DUT XY address of special unit I’ll show the power of FPWIN Pro Friday.
3
For first time, SELECT “Create a new project”.
1 For first time, SELECT “Create a new project”. 2 Click OK
4
POU (Program Organization Unit)
Project contains multiple programs. Program = POU Project Program Each program can have different operation like: Program 1----Initial setting Program Interlock Program Stage motion control Program Alarm logging Program Temperature control Program Communication to host etc Shorten the development time by organized debugging for the entire project. Also multiple people can develop different part of the program. Program Program Program Program
5
1 2 3 4 5 Creating project PLC type: Enter project file name here.
Project name(file name) You can change PLC type from this button. Select FP-X 32K C30T, C60T this time. 3 Program name: Enter name of the first program(POU) in this project. You can add programs (POU) later. 4 5 Program Language: Create project: Click Create Project. Select language that you use for programming for this POU. Select Ladder Diagram this time.
6
Left side tree is project navigator.
PLC system register setting Libraries: You can install libraries for function and function block made by anyone. Use the function as if those are built-in function. Tasks: You can define what POUs can run. POU runs from top to bottom defined in this task list. DUT: Data Unit Type This is like STRUCTURE in C language. But I will explain this later. Global Variables I will explain this later. POU: Program Organization Unit
7
Program field [F2] Program Editing Tips
TOOL BAR Program field: When you click on this field, the above TOOL BAR appears. Tips Please remember the Most important key stroke. [F2]
8
Matsushita Direct Address
Capital only Use CAPITAL only: When you use lower case, FPWIN Pro recognize it as Variable. Matsushita Direct Address Variable: Variable is custom memory area. You can write as the below. X0, X1, X XF, X10, X X1F Y0, Y1, Y YF, Y10, Y Y1F R0, R1, R RF, R10, R R1F DT0, 1, DT9, DT10, DT11 . . DDT0, DDT LD L FL etc
9
Declaring Variable Variable 1 2 3 Variable Declaring Motor
As soon as you type “Motor” and hit ENTER, the below dialog box pops up suggesting to declare the Variable. 1 Declaring Motor 2 Suggesting BOOL(bit) type 3 Declare When you click or just hit ENTER while the focus is on here, it create a variable called “Motor” as BOOL type.
10
Other way to declare Variables
1 Type variable name 2 Click down arrow Select type Type Start this time 3 Select BOOL this time ARRAY = Dimension BOOL = Bit DINT =32 bit DEC DWORD =32bit HEX INT =16bit DEC REAL =32bit floating point STRING[32]=Text TIME =Time WORD =16bit HEX
11
How to use B contact or Pulse
Constant Types How to use B contact or Pulse 1 Double click on contact 2 Select Nagation Normal Negation Rising Edge Falling Edge
12
How to use SET Output Types 1 2 Double click on Coil Normal Select Set
Negation Rising Edge Falling Edge Set Reset
13
PLC System Register setting
1 Click on + of PLC, System Registers 3 Select for fast program download 2 Double click Tool Port
14
Setting communication Parameters
Downloading Project Setting communication Parameters 1 Select Communication Parameters 2 Select the above When you install the latest GTWIN, although it shows USB in the list of Network type, you have to select C-NET(RS232C) to communicate with FP-X via USB cable.
15
Downloading Project Go Online 1 Click this ICON 2 Click this ICON
16
Someone must have gotten this error?
Downloading Project Someone must have gotten this error? Define “Start” as BOOL in the header.
17
How can you know which bit are supposed to be used or not used?
Variable What bit PLC uses for “Start” and “Motor”? These are automatically assigned to R bits by FPWIN Pro compiler. Every time you compile the project, same “Start” may be different R bit. How can you know which bit are supposed to be used or not used?
18
Compile option Variable
From Menu, Extras -> Options->Compile option You can define System area which compiler uses and user area which you can use as direct addressing. For default, you can use from R0 to R5F and DT0 to DT1650. What if you try to use R60?
19
Compiler automatically allocates variable to open memory.
R0 ~ R9F From touch screen R100 ~ R19F Error message R200 ~ R29F Motion Profile R300 ~ R39F Program bit for operation1 R400 ~ R44F Purpose2 R450 ~ R49F Purpose3 and go on. R0 ~ R9F From touch screen R100 ~ rest Compiler automatically allocates variable to open memory from the top to bottom. Now you don’t have to worry about arranging the open memory area. If you have programmed before, you know how pain in the neck this can be.
20
FB needs unique Identifier
Timer,Counter FB needs unique Identifier Click this Icon 1 2 Select timer with FB 4 Enter Identifier (Any name) FB needs unique identifier. You can use only alphanumeric characters and underscore. It can start 3 Click here
21
Using FB parameter Timer,Counter 1 3 4 2 5 Enter all in and out
Select Function Block start:= Start signal SV:= Set Value in ms T:= Timer output (OT can be connected) EV:= Elapsed Value (For monitor purpose) Expand by clicking + 4 2 How to use timer out Pump_Time . T (Identifier name.T) While this field is active, press F2 to bring the left dialog box. 5 Select this Pump_Time . EV is to monitor the EV value.
22
Changing bit status Monitor 1 2
Click on contact (not on name or address) The below dialog pops up. 2 Click OK
23
Changing bit status Comment in Ladder 2 1
Set the area and type comment To change line, CTRL+ENT. 1 Click this Click here and drag Click here and resize
24
How to use Motion Profile
FP-X Motion Profile How to use Motion Profile 60 step acceleration 50% duty 48 to 100KHz Incremental CW/CCW Control Code 32 bit DDT10 Low Speed DDT12 High Speed DDT14 Acceleration Time DDT16 Travel Distance DDT18 Creep Distance DDT20 H 500 Hz 1000 Hz 200 ms 3000 pulses 0 pulses DDT10 is 32 bit. DT10 is 16bit. DWR0 is also 32bit. s_Start is start address. n_Channel is axis number from 0 to 3 for FP-X Tr.
25
FP-X Motion Program in Ladder
How to use Motion Profile How to express each data type. Dec => 12345 Hex =>16# _ _ _ _ Real => String=> ”Hello” Binary => 2#_ _ _ _ _ _ _ Separate in two networks
26
FP-X Motion Program in Ladder
Or you will get this warning Difference between Error and Warning Error: You must fix it to run the program Warning: It still runs.
27
Set PLC system register to generate pulses
Before downloading Set PLC system register to generate pulses 1 Double click this 2 Select “Pulse Output”
28
How to monitor Pulse output counting
Monitor Data How to monitor Pulse output counting 1 Double click this 2 Enter Data or Variable name DDT90348 is Elapsed Value of Ch.0 pulse output. 3 Selecting Variable For this case, select Sample[PRG] And select Variable like “Start”
29
How to monitor Pulse output counting
Monitor Data How to monitor Pulse output counting Monitoring “EV” variable (Elapsed value) of Pump_Time FB of Sample POU Press [INS] to insert another value. Monitoring “Start” variable (bit) of Sample POU Monitoring Elapsed value DDT90348
30
DUT(Data Unit Type) This is like template of a group of data. Or template of profile or recipe. In C language, it’s called data structure. As you remember, FP-X motion profile consists of six 32bit registers. DUT allows you to create the template. Control Code 32 bit DDT10 Low Speed DDT12 High Speed DDT14 Acceleration Time DDT16 Travel Distance DDT18 Creep Distance DDT20 TYPE FPX_Profile ControlCode as DWORD LowSpeed as DINT HighSpeed as DINT AccelTime as DINT TravelDst as DINT CreepDst as DTIN These are one group. So LowSpeed always is next 32bit to ControlCode.
31
DUT(Data Unit Type) 1 Right Click on DUT and select New DUT
This Tab shows what you are editing And enter the name of DUT as FPX_Motion_Profile. This is a template name. Enter necessary data Default values
32
DUT(Data Unit Type) 1 Create name JOB1 using FPX_Motion_Profile template. This creates the below table. JOB1. ControlCode JOB1. LowSpeed JOB1. HighSpeed JOB1. AccelTime JOB1. TravelDistance JOB1. CreepDistance
33
DUT(Data Unit Type) Since DUT has the default value in each data, all you need to activate pulse output is this. JOB1. ControlCode JOB1. LowSpeed JOB1. HighSpeed JOB1. AccelTime JOB1. TravelDistance JOB1. CreepDistance Specify the first data in the table. If you want to change the value of Travel Distance, do as follows.
34
How to select a variable from DUT. 2
DUT(Data Unit Type) How to select a variable from DUT. 2 Select Data Unit Type List of DUTs shall appear in the below box. 3 Double Click on [+] 1 Press [F2] while this field gets the focus. When double clicked, the selected variable shall be appear in this field. 4 Double Click on TravelDistance
35
Global Variable If you want to change value in valuable from touch screen, where do you have to access? You have to define Global Variable with concrete direct address. Like Distance as DDT0. When checked, you can use this variable in all POUs in this project. Now this is DDT0
36
Global Variable VS Local Variable
Project Global Variable Global Variable Can be referred from any POU in this project POU1 Reference POU2 Reference Local Variable Can be referred from its own POU only. Local Variable Local Variable Global Variable can be allocated to direct address or not. No direct address Direct address
37
ST(Structured text) Refer to HELP for ST. 1 2
Right click on POUs and select New POU 1 2 Enter POU name Select PRG Select ST Select Program
38
Structured Text Program edit area
39
Structured Text F35_INC(DT0); Use IF THEN statement.
Rule 1: All program in ST is executed every scan. F35_INC(DT0); Rule3: End of each instruction requires semicolon. Rule2: All instruction need parenthesis for operands. Or you could do as below. Use IF THEN statement. IF R0=True THEN F35_INC(DT0); END_IF; IF DF(R0=False) THEN F35_INC(DT0); END_IF; IF DF(DT0>=100) THEN F35_INC(DT0); END_IF; Rule4: True or False, or True can be omitted. DF for executing just one scan.
40
Type “IF” and hit [CTRL]+[F1], it brings the below
Structured Text Intuitive editor Type “IF” and hit [CTRL]+[F1], it brings the below IF (?BOOL?) THEN END_IF; Type “F171” and hit [CTRL]+[F1], it brings the below Start address Channel number IF DF(Start) THEN F171_SPDH(s_Start := ?ANY32?, n_Channel := ?ANY16?); END_IF;
41
To change value, just use colon equal. ( := )
Structured Text Start address IF DF(Start) THEN F171_SPDH(s_Start := Job1.ControlCode, n_Channel := 0); END_IF; Channel number Tip1: You can change the line like above. To change value, just use colon equal. ( := ) JOB1.TravelDistance := 4500; Y8 := True; This is like F0 or F1. JOB1 := JOB2; Tip2: Copying an entire DUT is easy.
42
Structured Text Y0 := DF(TRUE); How to use FB in ST 1
Tip3: Creating one shot. Y0 := DF(TRUE); How to use FB in ST 1 Set FB in header, variable 2 Type the name and hit space key. timer Timer(start := ?BOOL?, SV := ?INT?, T => ?BOOL?, EV => ?INT?); The below all work! Timer(start := R0, SV := 1234, T => Y1, EV => DT100); Timer(start := R0, SV := 1234, T => Y1); Timer(start := R0, SV := 2000); Y1:=Timer.T; DT100:=Timer.EV; Timer(R0, 2000);
43
Other convenient programming
Structured Text Other convenient programming CASE DT12 OF 2,100: Y2:=True; : Y2:=False; 1,3..99, : DT12:=DT12+1; ELSE DT12:=0; END_CASE; If DT12 is 2 or 100 If DT12 is from –100 to 0 If DT12 is 1 or from 3 to 99 or from 101 to 120 Otherwise executes this If (R0=False) AND DT10<= and DFN(R1) Then DT11:=DT11+1; else DT11:=DT11-2; End_If;
44
GlobalVariableDDT0:=INT_TO_REAL(5)+1.2;
Structured Text Different types DDT0:=5+1.2; REAL data INT or DINT data GlobalVariableDDT0:=INT_TO_REAL(5)+1.2; DDT can’t be REAL format Converting to REAL format
45
Function Block Function Block is also POU.(Program) 1 Enter name of the function block Select Function Block 2 This time, select ST 3 Uncheck EN/ENO 4
46
Function Block When created FPX_Motion Function block, the FB does not have any input pin or output pin. Set names of input and output 1 Input and output pins with same name you set above appear
47
Make FPX_Motion_Profile DUT available in this FB 1
Function Block Before implementing the program written in the box, prepare the motion profile table. We can use the same DUT that you created. Make FPX_Motion_Profile DUT available in this FB 1 Profile <= name of the data set containing the below variables. .ControlCode as DWORD .LowSpeed as DINT .HighSpeed as DINT .AccelTime as DINT .TravelDistance as DINT .CreepDistance as DINT
48
Profile.LowSpeed := LowSpeed;
Function Block If DF(Start) Then Profile.ControlCode :=16# ; (*Fixed Control code*) Profile.LowSpeed := LowSpeed; Profile.HighSpeed := HighSpeed; Profile.AccelTime := AccelTime; Profile.TravelDistance:= TraveDistance; Profile.CreepDistance:=0; (*Fixed Control code*) F171_SPDH(s_Start := Profile.ControlCode, n_Channel := 0); (*Ch.0*) End_If; CurrentPosition:=sys_di_PLS_CH0_ElapsedValue; LowSpeed is a variable coming in from one of the pins on the FUNCTION BLOCK. sys_di_PLS_CH0_ElapsedValue is a pre-registered system register and actually it is DDT90348. 500 Profile.LowSpeed := LowSpeed; This 500 comes in from LowSpeed pin. 500
49
Function Block Press F2 1 Select <System Variables> under Libraries 2 How to use pre-set variable
50
Function Block How to place FB you made in LD 1 Type fpx to find the FB. Select FPX_Motion and hit Enter or click “Insert”. 2 Apply start contact and input values. 3
51
Function and Function Block
FUN and FB are different things. Function Block(FB) Function(FUN) How to make it Same Memory usage Multiple of the usage Just one memory Instance Necessary None Return Value Yes but selectable DF Available Not available Overall FB can keep running through multiple scans like when you move motion, you FUN should be done in one scan. So FUN is usually used to calculate something to get the result(return value). In case of FB In case of FUN 100 step 100 step If you use it 3 times If you use it 3 times Main POU Main POU It uses 300 steps It uses 100 steps This also uses 3 times of variables.
52
How to place FB you made in LD
Monitoring values How to place FB you made in LD 1 Double-click on “Start”. FP-X starts generating pulses. Monitor the counting value. 2 Select “Monitor Header” This is monitoring all values used in this POU except for direct address data.
53
Adding monitoring values 1
Hit INSERT key. 2 Enter direct address. While the cursor is on a variable, hit DELETE. It shall delete the variable from the monitor list.
54
Change the monitor data type
Monitoring values Change the monitor data type Enter direct address. Right click on the value you want to change the data type. Changed to Decimal (INT)
55
Monitoring values Change the value
While the cursor is on the data you want to change, just enter a value and hit ENTER. %MD: Data area %MW: Double word data %MX: Bit area Note: On POU screen, DT can be monitored as HEX only.
56
Monitoring values Change the value This is the FB we just added.
Double click on this. It expands and shows other variables contained in the FB.
57
Save the monitor format to a file
Right click on the field of the data monitor sheet. 1 To open what you saved, you have to open any data monitor field first and open. Save this format.
58
Function Block Use the FB in ST
Set a variable for FB---- the below example is Job4 1 2 Type the name (instance) of the FB and hit [CTRL]+[F1] Job4 3 Enter all variables. Job4( Start := ?BOOL?, LowSpeed := ?DINT?, HighSpeed := ?DINT?, AccelTime := ?DINT?, TraveDistance := ?DINT?, CurrentPosition => ?DINT?); Job4( Start := DF(R0), LowSpeed := 500, HighSpeed := 1000, AccelTime := 500, TraveDistance := 2500, CurrentPosition => DDT10);
59
Save FB & DUT to your library <<offline>>
Function Block Save FB & DUT to your library <<offline>> Right click on Libraries and select Library Install/Create…. 1
60
Save FB & DUT to your library <<offline>>
Function Block Save FB & DUT to your library <<offline>> Click here Enter a name of the library. Whatever you like. 2
61
Save FB & DUT to your library <<offline>>
Function Block Save FB & DUT to your library <<offline>> A library is added and appears here. Cut & Paste FB and DUT to this library. It should look like this.
62
Save FB & DUT to your library <<offline>>
Function Block Save FB & DUT to your library <<offline>> Save FB & DUT to your To create a new library or To bring in existing ones. Close and save To set password Up to 50 libraries can be installed in one project. Unlimited amount of POU can reside in one library.
63
Some tips How to create Array 1 4 2 3 Name it first
Change number of array 0..15 means 0 to 15 3..50 means 3 to 50 2 Select ARRAY 3 Select Type of Array
64
[-8..1 , 0..3 , 2..4] Some tips Three dimensional array
If you separate by a comma. [-8..1 , 0..3 , 2..4] This is useful when you want to make some profiles like multiple motion tables.
65
Some tips Adr_Of_Var When you have DUT or ARRAY, how can you use F10_BKMV? Adr_Of_Var finds the top address of a data group. AdrLast_Of_Var finds the last address of a data group. TestDUT.ControlCode as DINT TestDUT.LowSpeed as DINT : TestDUT.CreepDistance as DINT Finds the first address of 16bit data of TestDUT.ControlCode. Finds the last address of 16bit data of TestDUT.CreepDistance.
66
Adr_Of_Var_I and Adr_Of_Var_O
Some tips Adr_Of_Var_I and Adr_Of_Var_O Adr_Of_Var_I : This is for input. Adr_Of_Var_O : This is for input. In ST, there is only Adr_Of_Var for both input and output.
67
Some more tips How to use shift bit Just use direct address WRxx
But you may want to use some variable names. You can use ARRAY. All names in the same array are same but just number is different. You may want to change names of each bit. Use DUT. Either way 2 or 3, each group must consist of 16 bits, no more or less. (((ARRAY))) (((DUT))) BitArray[0] BitArray[1] BitArray[2] BitArray[3] BitArray[4] BitArray[5] BitArray[6] : BitArray[12] BitArray[13] BitArray[14] BitArray[15] BitDUT.bit0 BitDUT.start BitDUT.stop BitDUT.up BitDUT.down BitDUT.limitUp BitDUT.limitDWN (((Direct Adr))) (((ARRAY))) (((DUT)))
68
Some more tips How to program F356 EZPID
When you double click on any function, it shall show what type of data you have to use for input and output pins. In this case, you have to use three prepared DUT which comes with FPWIN Pro software when you purchase it.
69
Some more tips How to program F356 EZPID
Prepare these three DUT. Monitoring is EZ! Just attach these DUT to input pins. Loop1Control.b0_AT_Request Loop1Control.b1_AT_Complete Loop1ParaHold.SP Loop1ParaHold DUT is usually assigned in Global with actual Matsushita Address so that you can access it from your HMI.
70
SUPER EZ PID instruction
Some more tips SUPER EZ PID instruction To use this instruction for typical temperature control, all you have to set is the set point and start Auto Tuning. Monitoring is EZ! You can turn this bit ON by HMI as well. Loop1Control.b0_AT_Request Or you can do this too. *b0_AT_Request will be automatically shut down when AT completed. You can also change the SP from HMI. Loop1ParamHold. SP In order to access to variables from HMI, you have to set them in Global Variable.
71
SUPER EZ PID instruction
Some more tips SUPER EZ PID instruction Global Variable setting Local Variable setting You have to change the RETAIN area in Compile Option (Extras-> Options). Tip: When you move the slider close to where you want to set, then use left and right arrow keys to adjust.
72
Number of characters in this string
Structure of string TestString:=‘Hello’; DT m DT m+1 DT m+2 DT m+3 DT m+4 : DT n Max size of this string Number of characters in this string 2nd Char 1st Char 4th Char 3rd Char 6th Char 5th Char : Last Char 20 5 e H l o :
73
Instructions for strings
CONCAT: Connects two strings MID: Extract characters from a string RIGHT: Extract characters from a string from RIGHT LEFT: Extract characters from a string from RIGHT INSERT: Insert a string in another string FIND: Find the position of a string in another string EQ: Checks if two strings are equal. SEL: Select one string from multiple ones REAL_TO_STRING DINT_TO_STRING DWORD_TO_STRING TIME_TO_STRING STRING_TO_ETLANADDR
74
Example of how to use string
Use Adr_Of_VarOffs First word of string is “total size of the string”. And the second word is the number of character of the string, which is the word required in F159. You can get this by using Adr_Of_VarOffs or TestString[1]. Also number of characters you want to send can be obtained by “LEN” instruction. CONCAT Test4String:=CONCAT(Test2String,Test3String);
75
Example of how to use string
Use Adr_Of_VarOffs First word of string is “total size of the string”. And the second word is the number of character of the string, which is the word required in F159. You can get this by using Adr_Of_VarOffs or TestString[1]. Also number of characters you want to send can be obtained by “LEN” instruction. CONCAT Test4String:=CONCAT(Test2String,Test3String);
76
All you can use is IX and IY
Index register All you can use is IX and IY Other Index registers like I2 to ID are reserved by FPWIN Pro compiler. Even though you can use only IX and IY, by storing it to elsewhere you can use it many times. Beginning of POU IX_Store:=IX;-----Storing IX to IX_Store variable. Program IX:=IX_Store;-----Bringing IX back from IX_Store variable. VAR IX_Store AS INT To store IX and IY elsewhere, use DIX. Double word VAR IXIY_Store AS DINT IXIY_Store:=DIX;
77
Special unit I/O address
Another way to use DUT 1 Special unit I/O address It’s always difficult to remember all I/O address of special units like Positioning unit. You can set a DUT for Positioning unit and bring it into your variable. For example, RTEX has 128 bit of input information such as Servo Ready, Busy, Completed, Home Completed etc can be easily assinged. This DUT is allocated from X100, which is input address of FP Sigma RTEX at slot0. Instead of X110, it will be like below. No manual necessary any more. RTEX_Slot0_IN.Servo_Ready_Axis1
78
SFC (Sequential Flow Chart)
SFC is convenient for sequential program like motion control, communications or batch program. It’s easy to think the sequential movement and easy to program. Each step can be separated from the other. So while one step is working and other steps are not active, all you have to do is to check the activated step only.
79
SFC (Sequential Flow Chart)
Initial step: This step is automatically inserted. Transition: When the condition occurs, it moves to the next step. Step: You can write multiple programs (called actions). Each action can use different program language. When you made an Action, the color of the step become painted. Final Step
80
SFC (Sequential Flow Chart)
To edit, right click on the action and select Zoom Into. Name of Step plus dot x(.x) turns on the last scan. You can use it to reset output if you don’t want to keep the coil ON in the next step.
81
RUN Time edit 1 Click on this to go to RUN time edit mode. This tool bar appears only in online mode. 2 Click this when you finish editing the program. Note: If the program are you edited is larger than 128 steps for FP0, 2 and 2SH, it generates an error and won’t download the change. If the PLC is FP Sigma V3 or FP-X, they have a new feature called RUN TIME DOWNLOAD. Which means it download the entire program while it’s running. Our competitors can’t do this at this moment. This tells you how advanced FP-X is.
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.