JXCP1 Library User Guide For TIA Portal

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

User Guide

JXCP1 Library
for
TIA Portal

Document No. Checked Prepared

JXCP1 Library for


Lovász, Ferenc
TIA Portal

1
Table of Contents

I. Discalimer .................................................................................................................................................................. 3
II. Start a new project in TIA Portal ............................................................................................................................... 4
1. First steps .............................................................................................................................................................. 4
2. Hardware configuration ........................................................................................................................................ 4
2.1. PLC selection ................................................................................................................................................. 4
2.2. Installation of the GSD file............................................................................................................................. 5
2.3. Add and connect the JXCP1 unit to the PLC .................................................................................................. 5
III. Open and use the „JXCP1” library ......................................................................................................................... 7
1. Open a „JXCP1” library .......................................................................................................................................... 7
2. How to use these function blocks? ....................................................................................................................... 7
2.1. Insert a function block to the PLC program .................................................................................................. 7
2.2. Input/output variables .................................................................................................................................. 8
2.3. How to create an „Array[0..35] of Byte” type PLC tag? ................................................................................ 8
2.4. How to use the Array[0..35] of Byte tag........................................................................................................ 9
2.5. Function blocks and their input/output types ............................................................................................ 10

2
I. Discalimer

------- PLEASE READ CAREFULLY - THIS DISCLAIMER LIMITS OUR LIABILITY -------

THIS PROGRAM/FUNCTION BLOCKS ARE PROVIDED "AS ARE" FOR INFORMATION PURPOSES. THE
PROGRAM/FB AND ITS OUTPUT IS NOT INTENDED TO BE USED IN AN ACTUAL APPLICATION
WITHOUT MODIFICATION AND VALIDATION BY THE USER. THE PROGRAM IS BEING PROVIDED
WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, ALL OF WHICH ARE HEREBY DISCLAIMED.

YOU ACKNOWLEDGE AND AGREE THAT YOU ARE SOLELY RESPONSIBLE FOR THE SELECTION,
APPLICATION AND USE OF THE PROGRAM/FUNCTION BLOCKS. SMC CORPORATION AND ITS
AFFILIATED COMPANIES, DO NOT WARRANT THAT THE FUNCTIONS PERFORMED BY THE
PROGRAM/FB WILL MEET YOUR REQUIREMENTS, OR THAT THE PROGRAM/FB WILL OPERATE
ERROR FREE, UNINTERRUPTEDLY OR IN COMBINATION WITH OTHER SOFTWARE, OR THAT ALL
PROGRAM DEFECTS ARE CORRECTABLE.

SMC IS NOT RESPONSIBLE UNDER ANY CIRCUMSTANCES FOR ANY HARM OR DAMAGE ARISING OUT
OF OR RELATED TO YOUR USE OF THE PROGRAM/FB.

THIS PROGRAM/FB IS INTENDED TO HELP THE USER COMMUNICATING MEANINGFULLY WITH


JXC*1 CONTROLLERS. IT IS NOT MEANT TO BE USED WITHOUT VALIDATING ITS INPUTS/OUTPUTS.

THE USER ITSELF HAS TO ENSURE THE CORRECTNESS OF THE DATA TRANSFERRED BEFORE
EXECUTING THEM ON THE ACTUAL CONTROLLER AND THE MACHINE.

3
II. Start a new project in TIA Portal

1. First steps

a) Run the TIA Portal software

b) Click on „Create new project”

c) Fill the fields with your project datas and


after click on „Create”.

d) Select the „Project view – Open project view” option.

2. Hardware configuration
2.1. PLC selection

a) In the following we have to build-up the hardware configuration.


On the left side of your screen under the project tree you can find your project. At first, add a PLC by
double click on „Add new device”

b) In out project we are using just a


PLC. Select the „Controllers”group.

From the list select your PLC that


you are using for this project. In our
case
„6ES7 211-1AE40-0XB0”.

When you set the version if possible


to modify you can submit by
selecting the „OK” button.

4
2.2. Installation of the GSD file

a) Open the „Install general station


description file (GSD)” under the
„Option” menu.

b) Add a path or browse the location of


your GSD file. In our case it is
„D:\Siemens\GSDML-V2.31-SMC-
JXCP1-20160623”

It must to tick the found file from


the list that you would like to install.

Select „Install” -> OK

2.3. Add and connect the JXCP1 unit to the PLC

a) Open the „Hardware Catalog”of the right side of your TIA Portal screen

Search for the JXCP1 device. The easiest way if you type in the field „JXC”
and then „Enter”.

Pick and drop the JXCP1 unit to the „Topology view” or „Network
view”of TIA Portal.

b) Connect the PLC Profinet port to the Port1 of the JXCP1 unit (if
it is connected to Port2 then connect to Port2 in the project)

As you can see these are connected together however the


JXCP1 unit not assigned to the PLC. To assign select the
„Network view” and click on the „Not assigned” link. The
program shows the available PLCs. In our case we will select the
PLC named „Feccco”.

5
When it has assigned you see it is
written the PLC name „Feccco” in
the JXCP1 unit box.

The PLC name is written on the


Profinet line as well.

c) Double click on the JXCP1 it opens the


„Device view” and under the „General”
tab you can change a device „Name” in
the project.

You can submit the change by pressing


the „Enter” button.

d) You can set the I/O allocation of the JXCP1 unit by selecting the ’upper arrow’ to
extend the „Device overview” under the „Device view” tab

You can set here the Input and Output addresses of the JXCP1 unit that allocate in
the PLC.

6
III. Open and use the „JXCP1” library

1. Open a „JXCP1” library

a) Select the „Libraries” (1) tab on the right side of TIA Portal.

b) Select the „Open” (2) icon

c) Browse a JXCP1 folder and open a „JXCP1.al13” file.

d) You have the new „JXCP1” (3) library in your „Global libraries”. You don’t
have to open it again. It remains here until you remove from the „Global
libraries”.

e) Under the „Master copies” folder you can find the JXCP1 function blocks
that you can use in any of your projects. 3

2. How to use these function blocks?

2.1. Insert a function block to the PLC program

a) Open the „MAIN [OB1]” program block.

b) Just pick and drop any of the function blocks from the „JXCP1/Master
copies” to the „Network” where you would like to use it.

In our case we do this with the function block called „JXCP1_Inputs”

7
c) A pop-up window appears and you have to
add a name of the „Data block”.

This name is good for us, just select „OK” to


continue.

2.2. Input/output variables

a) If you move your cursor onto the „…” marked place the required
variable type appears as a note.

b) If you double click on the function block in the „Project tree” the
variable table shows you the names and data types.

You are able to modify the function blocks because these are not protected.

2.3. How to create an „Array[0..35] of Byte” type PLC tag?

a) As you can see it is required to make an array[0..35] of byte type variable.


In the „Project tree” you have to make a new „PLC data type” by double
click on „Add new data type”
In our case rename to „JXCP1”

b) Give a name of your new data type „Data”and give a type as „Array[0..35] of Byte”

8
c) In the „Project tree” open a „PLC tags” folder.

d) Open the „Show all tags” option by double clicking.

e) Give a nameof your variable that you would like to use in the PLC program. In our case it is „JXCP1 IN”.
Add a data type that you created in the previous steps (III./2.3./b) -> „JXCP1”
Do not afraid because it is pink after a compile it turns to grey as normal (in V14 it is normal-grey).

Add a start bit „Address” to the tag that you already set in the hardware configuration (II./2.3./d).
In our case we set the inputs and the outputs to „1..36” as well. Now we have to give „%I1.0” for inputs.

f) To create tags for the outputs just type for instance „JXCP1 OUT”, give a same type as previously „JXCP1”
and for the address set „%Q1.0”.

g) To compile your project just right click on


the project name „Feccco” than open
„Compile” and select „Hardware and
software (only changes)” option.

h) The data type „JXCP1” changed to grey

2.4. How to use the Array[0..35] of Byte tag

a) Open your program or function that you already inserted


your function block „JXCP1_Inputs”.

Select the „…” at „JXCP1 Inputs” and start type the name of
your PLC tag („JXCP1 IN”).
The software gives you an available tags that you can select
from the list by pushing the „Enter” button.

b) Then gives you an


available data type that
we also created with the
name „Data”.

c) After the selection and submitted of the „Data” we finished the


linking of the input side of the „JXCP1_Inputs” function block.

Now you can give a simple PLC tags and link to the output side of
this function block to use the datas in the PLC program like
„Current position”, „Current speed”, Alarm codes, etc…

9
2.5. Function blocks and their input/output types

a) „JXCP1_Inputs”

Name Type I/O


JXCP1 Inputs Array[0..35] of Byte Input
Step Data OUT Usint Output
State Bits USint Output
Ready Flag Bool Output
Current Position Real Output
Current Speed Int Output
Current Pushing Force Int Output
Target Position Real Output
Alarm1 USint Output
Alarm2 USint Output
Alarm3 USint Output
Alarm4 USint Output

b) „JXCP1_StepDataOUT”

Name Type I/O


Step Data OUT Usint Input
OUT0 Bool Output
OUT1 Bool Output
OUT2 Bool Output
OUT3 Bool Output
OUT4 Bool Output
OUT5 Bool Output

c) „JXCP1_StateBits”

Name Type I/O


State Bits USint Input
BUSY Bool Output
SVRE Bool Output
SETON Bool Output
INP Bool Output
AREA Bool Output
WAREA Bool Output
ESTOP Bool Output
ALARM Bool Output

10
d) „JXCP1_Outputs”

Name Type I/O


Step Data IN Usint Input
Control Bits USint Input
Control Flags Int Input
Start Flag Bool Input
Movement Mode USint Input
Speed Int Input
Target Position Real Input
Acceleration Int Input
Deceleration Int Input
Pushing Force Int Input
Trigger LV Int Input
Pushing Speed Int Input
Moving Force Int Input
Area1 Real Input
Area2 Real Input
In Position Real Input
JXCP1 Outputs Array[0..35] of Byte Output

e) „JXCP1_StepDataIN”

Name Type I/O


IN0 Bool Input
IN1 Bool Input
IN2 Bool Input
IN3 Bool Input
IN4 Bool Input
IN5 Bool Input
Step Data IN USInt Output

f) „JXCP1_ControlBits”

Name Type I/O


HOLD Bool Input
SVON Bool Input
DRIVE Bool Input
RESET Bool Input
SETUP Bool Input
JOG - Bool Input
JOG + Bool Input
FLGTH Bool Input
Control Bits USint Output

11
g) „JXCP1_ControlFlags”

Name Type I/O


Speed Restriction Bool Input
Movement Mode Bool Input
Speed Bool Input
Target Position Bool Input
Acceleration Bool Input
Deceleration Bool Input
Pushing Force Bool Input
Trigger LV Bool Input
Pushing Speed Bool Input
Moving Force Bool Input
Area1 Bool Input
Area2 Bool Input
In Position Bool Input
Control Flags Int Output

12

You might also like