[00] - Training Notes
Kieran's Training Notes
These are Kieran'sthe training notes from the TR3028 course that I took from [2025.10.21 - 2025.10.24].
InfoSYS can be downloaded as an offline EXEOfferingsPressing [F1] or [CTRL] + [F1] while in TwinCAT will launch the appropriate InfoSYS page according to what you are highlighting.
- There is a Beckhoff Robotics Project on the way. ATRO
- Industrial, modular, robots.
- Fully customization for the linkages
- Supposedly cobot payloads. ~20kg max
- Create custom robots from 1->7 axis robots
TheyInfoSYShavecanabebasicdownloadedroboticsasshellanforofflineprogrammingEXEKukaPressingintigration[F1] or [CTRL] + [F1] while in TwinCAT will launch the appropriate InfoSYS page according to what you are highlighting.
TheyBeckhoffhighlyUPSrecommend-separateHardwarepowerthat suppliesforthe IPC with a few minutes of power andtheautomaticallyIOsends a command to write persistent vars to memory when it detects that power has been lost.- No specific training for OOP but if there is enough interest then something can be set up with Germany
Beckhoff
TwinCAT - General
- It is possible to export a system configuration in Package Manager so that everyone has the exact same packages.
- Ensure the Firewall ports for ADS are set to allow all
ReccomendedYou can initialize a Git repo with a built-in Official TC3 gitignore- Sync Unit - Data being sent as a single datagram
- FB Size mismatch pragma
- attribute "pack-mode"
- Right Click -> Reset Toolbox
- For when the Toolbox glitches out and doesn't show anything
- You can change the PLC compiler warning in PLC properties
- Remove warning that "This line of code does nothing"\
- [ALT] + [SHIFT] Multiline Select, or [ALT] + [Mouse Drag]
- They have a basic robotics shell for programming
- Kuka and Staubli integration only
TwinSAFE
- EL2911 Safety Output w/logic - Kills power to everything to its right in the slice rack when tripped.
- Safety - Always check off Connection Inputs/Outputs and Standard Inputs/Outputs (Take over Alias Device)
- Alias-> Import IO Config
- Automatically imports all safety cards you have as alias devices
- TwinSAFE - Highly Recommended to create multiple logins for different people with different permissions.
- Tie safety ErrAck to reset button.
- Call out safety errors on HMI
- Shortcut to power cycle IO slice - "Request BOOT State"
- Safety Function block number indicates the order of exectution
- Safety Alias Device (FW2) -> Firmware Version 2
- FB for requesting safety state for latching faults.
TwinCAT - HMI
- HMI Package Industrial Common Library
- Has a lot of the missing functionality items that VISUs have. Push Buttons, Rocker Switches, LEDS, etc.
- HMI Diagnostics Page
- Replicates entire IO slice setup
- Trends for individual IO
- Built in forcing functionality
- Build-In PDF viewer on HMI
Hardware
- They stress how vitally important it is to ONLY EVER use shielded ethernet cables for both EtherCAT and EthernetIP.
-
Called not using shielded cables "amateur hour" and "exceedingly foolish"
-
- They highly recommend separate power supplies for the IPC and the IO
Programming
- Recommended to only use LREAL not REAL.
- There are no real advantages to using REAL instead.
- LIMIT - Useful function for limiting inputs by a set bound
- Always better to map your IO from the IO side, not the variable side.
- It's much easier to find the correct bit that you are wanting to connect.
- There are a ton of libraries and function blocks that already exist.
- If you are thinking of creating a function block, check the existing libraries first. There is a good chance that Beckhoff has already made it
- Calling timers at the end of the POU isn't very efficient. It's better to instantiate the timer [ timer(IN:=.., PT:=..,,,); ] when you start it and then update the timer [ timer(); ] right before you need to check if the timer is done or not. This way the timer is not being called every scan, even when it is not being used.
- There are a smattering of useful array functions to not forget about
- MEMCPY(), MEMSET(), ADR()
- If there is a
scpecificspecific library version that works with your program, you can set a static library version in the library manager that is required at Build- A "*" at the library version indicates that the most recent version of the library will be used.
- The number on the bottom right of TwinCAT indicates the % CPU usage
- In ST, pressing [F2] starts the Input Assistant.
- If the FB that you want to insert is already declared, it will show up under "Instances". Clicking on this instance and inserting will insert the instance in the code with the entire structure ready for the user to populate, saving time.
- Flow Control Mode - Incredibly useful for debugging. Shows in highlighted green the path that the code is taking, through case and if statements. If the line is not highlighted green, the code is not executing
- Use Refactor->Rename, instead of just Rename. This finds every instance of the variable or FB in your code and replaces it with the new version while also checking to make sure that the new name is not already taken.
- Pragmas apply conditions to the start of POUs, DUTs, and FBs that change how they operate at a global level.
- For example there is a pragma that can be added to an ENUM that allows the contents of the ENUM to be called globally without
referenceingreferencing the parent namespace.- [ ENUM_ITEM; ] vs [ my_enum.ENUM_ITEM; ]
- For example there is a pragma that can be added to an ENUM that allows the contents of the ENUM to be called globally without
- Case Statements - If a ENUM DUT is used for the statement names, create an instance of the ENUM and use that in the CASE ___ OF.
- This will populate the states at runtime viewing with the strings instead of the integer. very useful.
- You can also force CASE states by dropdown of the strings rather than the int value.
- Core Dump - Can Save the current state of the IO variables so that it can be reloaded later in this exact state for debugging.
YouVARcanPERSISTENTinitialize-anon-volatileGitmemory- Some
withIPCs have a built-inOfficialUPSTC3-gitignoreSUPS HMI Package Industrial Common LIbraryLibraryHasFB_S_UPSa(GenerallotFB)ofcanthewritemissingPersistentfunctionalitydataitemsonthatpowerVISUs have. Push Buttons, Rocker Switches, LEDS, etc.loss
HMIForDiagnosticshandlingPagemultiple complex projects: Treat the projects subtractivly?ReplicatesRecommendedentireweIOlooksliceintosetupVariant TrendsManagementfor individual IOBuilt in forcing functionality