Twincat (Balford Beckhoff) Frequently asked Questions (FAQ)-How to configure a virtual axis TC2

Source: Internet
Author: User

Right-click Nc-configuration, then Append Task, then right-click Axis,append Axis

?

The type of shaft can be divided into: continuous axis, the default type, NC can be continuously closed loop control of the axis, Encoder axis, encoder type, NC can only read can not control, do not make any settings directly confirm.

?

Some pages are not available by default and will only become usable in running mode.

?

The first is the setup of the encoder, the encoder name and type are set in general (no tube here, because it is a virtual axis)

?

Right-click on the PLC, and then add the PLC project, the previous written a good plc program loaded in. After loading, the interactive variables in the PLC program with NC are automatically recognized (currently only two, NCTOPLC and Plctonc)

?

Click Plctonc, and then open the linked to window to automatically eject the corresponding AXIS1 corresponding variable (note that only one is bound here because only one axis was added earlier)

?

Use the same method to bind the part of the FROMPLC variable

?

Then click on the activation configuration, you can observe the online page becomes available status, NC on the basic configuration is complete, the virtual axis Axis1 is waiting for the PLC to give control commands, so as to achieve rotation

?

Start writing the PLC program:

Switch to library Manager in the PLC program, then right-click in the library, add the library, locate the TCMC library, and after the addition, there is a library other than STANDARD.LIB

?

Defines the input and output structure of the NC axis in a global string

Var_global

???? Plctonc at%q*????: plctonc_axlestruct;

???? NCTOPLC at%i*????: nctoplc_axlestruct;

End_var

????

In the main program to add the FBD program (FBD is not commonly used, but in the expression of TWINCAT standard motion function is more convenient, we can convert FBD to St language later), right-click Add Program, and then set the type is FBD, the name is axisenable ( If we are to define a mc_power function block, this is equivalent to creating a new class named Axisenable), the default is three question marks

?

Double-click the program, and then add a box, the default is automatically called and, you can rename to Mc_power, after the change will automatically become the standard function block format, press ENTER to end

?

At this point we need to define this function block, which describes the function block equivalent to the class, we need to instantiate it, and define the function block according to the official definition. Enter the instantiated name of the class in the question mark at the top, such as power, which automatically asks you to confirm the variable type (that is, the Mc_power type), and then automatically creates the power variable at the top

?

Next define the various parameters of the function block, note that the last two on the left is our defined global structure

Var_global

???? Plctonc at%q*????: plctonc_axlestruct;

???? NCTOPLC at%i*????: nctoplc_axlestruct;

End_var

?

And then fill in the variable_configuration.

Var_config

????. Plctonc at%qb0:plctonc_axlestruct;???? (* ~ {Linkedwith:tinc^nc-task 1 saf^axes^axis 1^inputs^axis 1_FROMPLC} *)

????. NCTOPLC at%ib0:nctoplc_axlestruct;???? (* ~ {Linkedwith:tinc^nc-task 1 saf^axes^axis 1^outputs^axis 1_TOPLC} *)

End_var

?

?

The user can find the definition of each function block in Infosys

?

For the parameters on the right, the mouse moves to the extended line part, right click and then assign can set the parameters (you can be defined in the previous, you can also lose directly here, enter the window after the request to confirm the variable type)

?

Well, that's completely defined.

?

Define the Mc_moveabsolute module, note that it is right-click on main to add an action, then add a box, and then set the name to Mc_moveabsolute, as well as a lot of input input variables (except axisrefout is global, Apply as in front)

?

Note that Moveaction is a function block that defines variables that appear in main, unlike the previous axisenable is a program whose variables are self-contained (access is accessed through axisenable.xxx)

?

The complete program runs, the virtual axis will be in the 0-2000 position of the reciprocating movement

?

After the PLC control of the NC virtual axis movement, we can try to see the position, velocity, and acceleration curve in the twincat scope. , open Twincat Scopeview, and then add a

?

Add a Channel

?

Modify the name and set the monitored variables in acquisition (location corresponds to Actpos)

?

Because we already know that the PLC program is to control the motor in the position of 0-2000 run, so here can set the upper and lower limit of 1000 to 3000, can also be set to other values, set up, first start the PLC program, and then start here, you can see the default has been drawn position curve

?

You can modify the color and brush weights in the style page

?

The same way to monitor the speed and acceleration, you can run after the maximum value of the minimum and then modify the speed and acceleration of the upper and lower limits (you can directly copy the location of the channel and then modify, note that the corresponding Actvelo and ACTACC)

?

Finally, you can see three curves as shown, note that you can modify the unit

?

Why is the acceleration curve always 1000, because we don't set the encoder type, change the encoder type to POSVELOACC, then we can monitor the acceleration

?

The curve after the change is as shown

?

?

?

For more instructional videos and downloads, please pay attention to the following information:

My Youku Space:

Http://i.youku.com/acetaohai123

?

My online forum:

http://csrobot.gz01.bdysite.com/

?

Problem Exchange:

qq:910358960

Email:[email protected]

?

Twincat (Balford Beckhoff) Frequently asked Questions (FAQ)-How to configure a virtual axis TC2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.