Beckhoff Automation Blog

The Beckhoff Blog contains posts relating to Beckhoff Automation programming and technology. Select a post below to view the full story and details.


  • Configuring Multiple PLC Runtimes in TwinCAT

    The TwinCAT system allows you to run up to 4 PLC runtimes on 1 PC based controller. This is a very useful feature, for example, I have used this during development by implementing a separate PLC Simulator program that runs on its own run-time.

    Variables from the second Simulator PLC project can be linked to the first, machine PLC project to act as inputs/outputs during development.

    Adding a Second TwinCAT PLC Runtime

    Right click on PLC configuration to add another PLC runtime. Up to 4 PLC run-times can be configured.

    Append a second PLC runtime by right clicking on the TwinCAT PLC Configuration node.

    Runtime system is used by another project!

    However, when setting up a second runtime for the first time, you might get the above error, which can be frustrating. Below are the steps to setup multiple run-times in the TwinCAT System Manager and PLC Control.

    The runtime in use error occurs when you try to add a second PLC project, but have not enabled multiple runtimes, or chosen the second runtime in the PLC editor.

    Choose Number of Runtimes and Apply

    Choose the number of runtimes on the PLC settings tab. ...

    Full story

    Comments (2)

  • Connecting Visual Studio to Beckhoff Windows CE Devices

    You can quickly develop .NET applications in Visual Studio that target Beckhoff Windows CE controllers. At some point, it always becomes essential to connect to the device from Visual Studio, and debug the application online, running on the device hardware and not just an emulator.

    After pressing F5 to deploy the application, it will prompt you to choose a device. The Windows CE Device is the correct choice, but unless connection options are set correctly, you will only get the dreaded error "Unable to connect to device".  

    Before reading the rest of this post, refer to the MSDN article below.

    How to: Connect to Windows CE Device Without ActiveSync

    Below are the steps to connect to a Beckhoff device.

     

    Step 1. Copy the Windows CE Debug Files to the Device

    There are five files you need to copy to the Windows CE controller. The most important is ConmanClient2.exe...

    Full story

    Comments (1)

  • TwinCAT NCI Running but Axes do not Move

    It is very easy to create a 3 axis CNC system and run CNC commands and programs in simulation mode with TwinCAT NCI. Simply add 3 simulation axes X, Y, and Z to the NC taxk as shown in the configuration below. Then, add a NCI Channel to the task, save, and activate the configuration. After the system starts, goes green, and is running, assign the three axes to the NCI channel group and then enable each axis on its respective Online tab.

    You may now think that it is configured and ready to go, especially if you are experienced with TwinCAT PTP. You go to the channel MDI tab to try entering CNC commands. However, there is a critical step that has been overlooked, and missing this step can be frustrating and time consuming.

    The program appears to be running, yet there is no error in the logger console at ...

    Full story

    Comments (0)

  • The Best TwinCAT PLC Font

    When I was an early software programmer, I never changed any of the default options and fonts in the TwinCAT PLC Editor. If you work with the editor for long periods of time, however, you will soon find that it is very useful to use a very legible font. In addition, I have found that the use of a monotype font, where all characters are equal in length, is essential for efficiently developing code.

    Default TwinCAT PLC Font

    The default font in the TwinCAT PLC development environment is MS Sans Serif 10pt as shown below. This is a pretty legible font, but is not the best chioce for the structured text language.

    TwinCAT PLC development environment using the default MS Sans Serif font

     

    Changing the Font to Lucida Console

    Beckhoff colleague advised me that this default choice is not ideal, because it is hard to see the semicolons at the end of the structured text programming language. His ...

    Full story

    Comments (0)

  • Installing SQL Server CE Compact Edition

    SQL Server Compact Edition (SQL Server CE) is a lightweight, yet powerful member of the SQL Server 2008 family. It can be installed on either a Windows Mobile device or on a full, desktop operating system.

    For example, a common use of SQL Server CE is to store data locally on a handheld device. This is often used in data collection and inspection systems when the device is only intermittently connected to a network, or synced regularly at the end of the day. However, it is not just mobile applications that can benefit from SQL Server CE, it can be implemented on notebooks and tablets, running full blown Vista, for richer versions of client software.

    Beckhoff Embedded PC Controllers running Windows CE or Embedded can use SQL Server CE as a local data store.

    Steps:

    Step 1. Install the correct / latest .CAB installation file.

    For more information about SQL Server Compact Edition: ...

    Full story

    Comments (0)

  • TwinCAT Blue Screen 64 Bit AMD Processor

    I shamelessly copied this scenario and solution from the TwinCAT Developer LinkedIn group. Kudos to Steve Maves of Beckhoff Automation USA support, who fixed a customer's bluescreen issue by making the registry tweak below.

    I have had a Dell laptop on a project recently that blue screens every time I try to start the TwinCAT System. I am not sure if this is the same problem that is described below, but I am going to try this tweak the next time I have access to the laptop.

    I will update this post when I determine if this fixed my problem as well. 

    The Blue Screen Problem

    Numerous blue screens of death (BSOD) are occuring on a development computer.

    STOP: 0x0000008E (0xC0000005, 0xDE04BCA5, 0xECDEAA70, 0x00000000)
    TcRunTime.sys-adress ED04BCA5 base at ED037000, DateStamp 48e34ca8

    The PC System Properties

    AMD Athlon 64 Bit,1.5 GHz, 512 MB, Gigabyte motherboard (GA-K8VT800 Pro) with XP pro SP2

    The Registry ...

    Full story

    Comments (2)

  • Beckhoff CX1000 CX1001 CX1010 CX1020 CX1030 Images

    You may often need to restore a backup image to a CX controller, or be able quickly deploy a solid, tested image to multiple controllers. Here are some points and links to consider when planning a CX controller deployment. Note, that this article only applies to x86 based CX controllers, that have a removable CF card. This does not apply to embedded CX9000 series controllers. For those devices, browse to the links shown in the references at the end of this post for more information.

    This posting is subject to change, please note the references at the end and search for more information in the Beckhoff Information System and Beckhoff FTP Server.

    1. Make Initial Backup Copy of the Compact Flash Card

    When you get your new CX controller, my advice would be to immediately make a copy of the complete compact flash (CF) card, so you have a default image ...

    Full story

    Comments (0)

  • Bechoff FTP Server Resources

    Beckhoff has many resources to assist in developing applications on their embedded controllers.

    One of these lesser known, but extremely useful places is the Bedkhoff FTP Server: ftp://ftp.beckhoff.com

    For example, a cache of extremely useful Windows CE Embedded tools and solutions can be found in this sub-directory location.

    ftp://ftp.beckhoff.com/Software/embPC-Control/CE/Solutions

    Browsing Beckhoff FTP Server wtih Windows Explorer

    You can use either windows explorer or Internet explorer to easily browse FTP servers.

    Beckhoff FTP Server Windows Explorer

    Browsing Beckhoff FTP Server with Filezilla

    I particularly like to use Filezilla's FTP client to browse resources like this. You can simply click on the link, or use Windows Explorer, but it is much more efficient to browse and download with a rich client.

     Beckhoff FTP Server Filezilla

     

    Full story

    Comments (0)

  • CX1000 Factory Reset

    It is possible to do many very useful administrative tasks, including a factory reset of a Beckhoff embedded controller (CX1000, CX9000, CX1020 series) using the Web Administration Interface that is built into the embedded device's image.

    This is a documented feature within the Beckhoff Information System, but a search for this topic proved quite difficult and time consuming. Hopefully putting this information here will save others the headache.

    Note, the documentation says that this interface is only available on "CE based devices (image 2.16 or higher required)"

    CX Web Administration Portal Documentation

    You can drill down the left had tree and find help on this topic. There are a lot of other interesting tips and tricks at this path as well.

    Infosystem Path to the Web Based Controller Administration Topic

    Embedded PC > Operatingsystem > CE > Web based diagnostic and configuration interface

    Accessing the TcWebAccess Web Administration Portal...

    Full story

    Comments (0)

  • TwinCAT NCI 3 Axis CNC Simulation Video

    TwinCAT NCI is a PC based CNC controller, where you can group axes into a channel, and command them using standard G-Codes and part programs. It is very easy to quickly setup a 3 axes simulation in TwinCAT NCI for development and to demonstrate how to run programs.

    You need to download the trial version of TwinCAT and install it at the NCI level. During installation, there is a dialog with a choice to install TwinCAT at the PLC, NC PTP, or NCI level. It must be installed at the highest, NCI level to have access to the NCI tasks and services shown in the video below.

    The video above shows these steps to create a configuration and run programs.

    1. Download and install TwinCAT at the NCI level
    2. Open System Manager and add 3 axes, which will be simulation axes by default
    3. Add an NCI channel that will be used to group the ...

    Full story

    Comments (1)

  • Beckhoff Infosys Search Tips

    I regularly search the online Beckhoff Information System, (infosys.beckhoff.com) for information and programming examples.

    Tip 1. Use a mouse click, not the Enter key to initiate a search

    This may be obvious, and is more of an just an annoyance, but it was frustrating to me that the first couple times I searched that I was getting no results back. This is because the search form was not picking up the Enter key press.

    After typing in a search query into the search box on the site, you must use the mouse to click the "Search" or "Suchen" button on the site. Simply hitting the enter key does not activate this search button, and it will appear that you get no results.  

    Tip 2. Use Google to search only the Infosys domain

    Sometimes, I like to use google to search a domain instead of using the site's internal search engine. ...

    Full story

    Comments (0)

  • TwinCAT PLC Variable is too Large Error

    Recently, I was working on a PLC program and ran into this error message. I had created several data structures, and marked them with wildcard output addresses as shown below:

    stInProductStack AT %Q*: ARRAY [1..1200] OF ST_InProductRecord;

    However, I received an error in the message window when trying to build the PLC project:

    Error 3801 Data(10): The variable 'stInProductStack' is too large (24000 bytes)

    This did not make sense to me at first. I was trying to use this data structure to store data persistently in the CX1000 NOV-RAM, which has memory space for 128 KB  of data, so why should it get an error like this? The variable stInProductStack was only 24 KB?

    Well, it turns out the error can be easily be resolved in the Options .> TwinCAT PLC menu items screen. I just increased the size from the default setting of 16 KB to 128 KB for both input and output ...

    Full story

    Comments (0)

  • Useful Free Programming Utilities

    I was cleaning up my computer, and decided to take an inventory of some of the more useful free programs that I have installed.

    I built up a list by inspecting these areas:

    1. Remove Programs List
    2. Program Files folder
    3. Startup Menu Folder
    4. Registry Startup Keys

    It seems we need an ever increasing array of tools to build software effeciently. My list of programs has grown to what seems like an alarming number. However, I believe this is just a way of life for PC based development. Ever more powerful computers are coming out, and IDE's are constantly evolving into more massive installations. It seems the release of new, faster, less expensive, and even free applications will never slow.

    Here's a short list of some of the most useful free applications I've installed: Some are pretty obvious, but I include them all regardless. There will come a day when I get a new ...

    Full story

    Comments (0)