1 / 81

FPWIN Pro

FPWIN Pro. 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

ddagostino
Download Presentation

FPWIN Pro

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. FPWIN Pro

  2. 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. 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 2 ----Interlock Program 3 ----Stage motion control Program 4 ---- Alarm logging Program 5 ----Temperature control Program 6 ----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. Creating project 1 2 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 Create project: Program Language: Click Create Project. Select language that you use for programming for this POU. Select Ladder Diagram this time.

  6. Project navigator 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 Editing Program field TOOL BAR Program field: When you click on this field, the above TOOL BAR appears. Tips Please rememberthe 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, X1 . . . . XF, X10, X11 . . X1F Y0, Y1, Y1 . . . . YF, Y10, Y11 . . Y1F R0, R1, R1 . . . . RF, R10, R11 . . R1F DT0, 1, 2 . . . . .DT9, DT10, DT11 . . DDT0, DDT1 . . . LD L FL etc

  9. Variable Declaring Variable Variable 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. Variable Other way to declare Variables Type variable name Click down arrow 1 2 Select type 3 Type Start this time 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. Constant Types How to use B contact or Pulse Double click on contact 1 Normal 2 Select Nagation Negation Rising Edge Falling Edge

  12. Output Types How to use SET Double click on Coil 1 Normal Negation 2 Select Set Rising Edge Falling Edge Set Reset

  13. PLCSystem Register setting Click on + ofPLC, System Registers Select 115200 for fast program download 1 3 Double click Tool Port 2

  14. Downloading Project Setting communication Parameters Select Communication Parameters 1 Select the above 2 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 Click this ICON 1 Click this ICON 2

  16. Downloading Project Someone must have gotten this error? Define “Start” as BOOL in the header.

  17. 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. Variable Compile option 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. Variable 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. Timer,Counter FB needs unique Identifier Click this Icon 1 Select timer with FB 2 Enter Identifier (Any name) 4 FB needs unique identifier. You can use only alphanumeric characters and underscore. It can start Click here 3

  21. Timer,Counter Using FB parameter Enter all in and out 1 Select Function Block 3 start:= Start signalSV:= Set Value in ms T:= Timer output (OT can be connected) EV:= Elapsed Value (For monitor purpose) Expand by clicking + 4 How to use timer out 2 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. Monitor Changing bit status Click on contact (not on name or address) The below dialog pops up. 1 2 Click OK

  23. Comment in Ladder Changing bit status 2 Set the area and type comment To change line, CTRL+ENT. Click this 1 Click here and drag Click here and resize

  24. FP-X Motion Profile How to use Motion Profile 60 step acceleration50% duty48 to 100KHzIncremental CW/CCW H 000 10100 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 => 0.1234 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. Before downloading Set PLC system register to generate pulses Double click this 1 Select “Pulse Output” 2

  28. Monitor Data How to monitor Pulse output counting Double click this 1 Enter Data or Variable name 2 DDT90348 is Elapsed Value of Ch.0 pulse output. Selecting Variable 3 For this case, select Sample[PRG] And select Variable like “Start”

  29. 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. 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) Right Click on DUT and select New DUT 1 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. Specify the first data in the table. JOB1. ControlCode JOB1. LowSpeed JOB1. HighSpeed JOB1. AccelTime JOB1. TravelDistance JOB1. CreepDistance If you want to change the value of Travel Distance, do as follows.

  34. 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. Double Click on [+] 3 Press [F2] while this field gets the focus. 1 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 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. 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 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=TrueTHEN 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. 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. 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 Tip3: Creating one shot. Y0 :=DF(TRUE); How to use FB in ST Set FB in header, variable 1 Type the name and hit space key. 2 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. Structured Text Other convenient programming CASE DT12 OF2,100: Y2:=True;-100..0: Y2:=False;1,3..99,101..120: 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<=1000and DFN(R1) Then DT11:=DT11+1;else DT11:=DT11-2;End_If;

  44. 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. 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. Function Block If DF(Start)ThenProfile.ControlCode :=16#0010100;(*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 Type fpx to find the FB. 1 Select FPX_Motion and hit Enter or click “Insert”. 2 Apply start contact and input values. 3

More Related