Go to Parker.com
  • Sign in
Technologies
  • Aerospace
  • Climate Control
  • Electromechanical Group
  • Filtration
  • Fluid and Gas Handling
  • Hydraulics
  • IoT
  • Pneumatics
  • Process Control
  • Sealing and Shielding
Other Groups
  • Parker Indego
Blogs Forums Knowledge Bases
Parker Community
Parker Community
  • Technologies
    • Aerospace
    • Climate Control
    • Electromechanical Group
    • Filtration
    • Fluid and Gas Handling
    • Hydraulics
    • IoT
    • Pneumatics
    • Process Control
    • Sealing and Shielding
    Other Groups
    • Parker Indego
    Blogs Forums Knowledge Bases
  • User
  • Site
  • Search
  • User
Home Technologies Electromechanical Group Electromechanical - Industrial Electromechanical Industrial Knowledge Base How do I use function block methods in CFC?
Electromechanical - Industrial
  • Technologies
  • Electromechanical Group
  • Electromechanical - Industrial
  • More
  • Cancel
Electromechanical - Industrial
Electromechanical Industrial Knowledge Base How do I use function block methods in CFC?
  • Electromechanical – Industrial Support Forum
  • Electromechanical Industrial Knowledge Base
  • Members
  • Sub Groups
  • More
  • Cancel
  • New
Electromechanical - Industrial requires membership for participation - click to join
  • Electromechanical Knowledge Base & Frequently Asked Questions
  • Motion and Machine Controllers-
    • ACR Controllers+
    • PAC120+
    • PAC340+
    • PAC320 (Discontinued)-
      • 3rd Party Samples+
      • Embedded Xpress+
      • Errors+
      • Hardware+
      • PAM IDE+
      • Programming Tips-
        • ANY Data Type
        • C0046: Identifier 'xxxx' not defined - precompile error in PAM 1.3.0
        • How can I monitor cycle time in the PAC?
        • How do I use function block methods in CFC?
        • How to make comments in PAC software
        • How to program a Start, Stop, Reset Cold from within a PAC project
        • IDE Login Status
        • IDE User Management
        • Known issue with MC_Stop and MC_Home in PAM 1.3.0
        • Programming Tip: Save Time by reusing Code (Export / Import Programs & Function Blocks)
        • Programming Tip: Save Time on Naming Variables through Export/Import Mappings .csv
        • Variable size arrays
      • Web Visualization+
      • Quick Start and Online Training Videos
      • Adding New Devices
      • Auto Addressing enabled by default
      • Cam and Gear Program Sample & Video
      • Common PACIO Troubleshooting Tips
      • Compax3 Linear servo motor settings with PAC
      • Default IP Address 192.168.10.50 subnet 255.255.0.0 (X2 port)
      • Reading G Code from a file to develop a CNC machine
      • Error: Red triangle on EtherCAT axes/devices when ModBus or ProfiNet connects
      • FTP support
      • How can I send ASCII strings to or from the PAC?
      • How do I configure and gear to the PACIO-454-01 Module?
      • How do I upgrade a Parker Automation Manager (PAM) project from 1.3.0 to 1.4.0?
      • How do I use variables in G code?
      • How to Add ModbusTCP to PAC project (PAC as ModbusTCP slave)
      • How to Set and Get Time / Date / Time Zone Pre-1.4
      • How to Update Devices and their Descriptor files
      • How to Update PAC project without Parker Automation Manager software?
      • How to Update a PAC Firmware? Flashback instructions
      • How to Upload a Program?
      • How to Use the InteractX OPC Quick Client with the PAC
      • How to set up EtherNet/IP Communications with an Allen Bradley PLC
      • How to set Scaling for Parker Mechanics
      • How to use the Outputs on the Compax3-I31 or P series (EtherCAT)
      • IO settings for EtherCAT_Master: How to see IO update while in Stop
      • Log Data to a File
      • Minimum Internet Explorer version for Xpress and Visualization options
      • PAC CNC & Multi-Axis Capabilities, Samples & Video demos
      • PAC CNC visualization
      • PAC System Time Access and Edits
      • PAC Web Visualization with Internet Explorer: missing browser feature HTML5-Canvas Webvisu
      • PAC with .Net or LabView or InteractX: Using OPC DA Server
      • PAC with Modbus: What addresses for tags?
      • Reading Torque from Pseries drive
      • Remanent Variables: Retain vs Persistent Retain
      • Retentive Memory details
      • SDO Read / Write PAC to/from Compax3 I31
      • SMC_ERROR.SMC_FB_WASNT_CALLED_DURING_MOTION
      • Sample Continuous Function Chart CFC Program: time based counter
      • Sample Continuous Function Chart CFC Program: Basic Motion (Power, Home, Cycle)
      • Sample Ladder Logic LD Program: Basic Motion (Power, Home, Cycle)
      • Sample Ladder Logic LD Program: Time based counter
      • Sample SFC Program: time based counter
      • Sample Stuctured Text ST Program: Time Based Counter
      • Sample Structured Text ST Program: Basic Motion (Power, Home, Cycle)
      • Single Axis Sample Program with Visualization
      • Two Axis Sample Program with Visualization
      • Using the PAC as a Modbus TCP Master Device
      • Using the PAC as a Modbus TCP Slave Device
      • VIDEO: Run an AC30V an AC Induction motor via EtherCAT with a PAC
      • VIDEO: PAC with Compax3 EtherCAT part 1: EtherCAT connections & Device Selection
      • VIDEO: PAC with Compax3 EtherCAT part 2: Complete Configuration
      • VIDEO: PAC with Compax3 EtherCAT part 3: Setting EtherCAT Master and DS402 scaling
      • VIDEO: PAC with Compax3 EtherCAT part 4: Download & Test in C3 ServoManager
      • Video: Parker's PAC, the Automation Controller Based on IEC61131-3
      • What's the 16# in the axis scaling default of 16#10000?
      • Working with recipes in the PAC
      • Does the PAC have a first scan flag?
      • Error when switching Active Application
      • Using tappets during cam motion
      • WebVisualization not working in PAC terminal (PTA)
      • Can I open an edit and download a PAM 1.3.0 project using PAM 1.4.0?
      • Does PAC act as a OPC-UA server or client, or both?
      • How do I upgrade the PAC from OPC-DA to OPC-UA?
      • How do I use OPC-UA with the PAC?
      • PACIO-441-01 analog current input module
      • Sample code for PACIO-442-02 and PACIO-441-02 analog modules
      • What ports get used with PAC Ethernet connections?
      • C0032: Cannot convert type 'Unknown type: 'ADR(Device.Application.PLC_PRG.x)' to type 'POINTER TO BOOL'
      • CSV Reader Library for the PAC
      • Do I have to upgrade my PAC 1.3.0 Firmware to work with a PAM 1.4.0 project?
      • eCL Homing notes with PAC via EtherCAT
      • EtherCAT communication between the PAC and AC30 drive
      • How to add images to a visualization in WebVis
      • How to reset the EtherCAT bus
      • Parker Tap Adapter for EoE communications
      • User Management in the Parker Automation Controller
      • Using MC_TouchProbe with Compax3 Series Drives
      • Using MC_TouchProbe with P Series Drives
      • Webvis toolbox missing tabs (Codesys calls them tags) - Added alarms but no Alarms Display tool in toolbox.
    • 6K (Discontinued)+
  • General Technology Information+
  • Virtual Engineer+
  • Visualization and Human Machine Interface (HMI)+
  • Servo Drives and Servo Drive/Controllers+
  • Stepper Drives and Stepper Drive/Controller+
  • Gearheads+
  • AC and DC Drives and Inverters+
  • Servo Motors+
  • Step Motors+
  • Linear and Rotary Positioners+
  • Electric Cylinders+
  • T-Slot Aluminum Framing+
  • C3 + Xpress + ETH+
  • How can I stay updated on Parker electromechanical and drives product news?
  • Legacy (Discontinued)+
  • Other+
  • Memorandum: Information on EPA ban of Persistent bioaccumulative toxin (PBT)
  • What replaces the Gemini GV6K servo drive controller?
Wiki Actions
  • Share
  • More
  • Cancel
Community Quick Links
  • Home
  • Technologies
    • Aerospace
      • Supplier Resource Center
    • Climate Control
    • Electromechanical Group
      • Electromechanical - Industrial
      • Electromechanical – Mobile
    • Filtration
    • Fluid and Gas Handling
    • Hydraulics
    • IoT
      • Mobile IoT
    • Pneumatics
      • Pneumatic Industrial
      • Pneumatics Mobile
    • Process Control
    • Sealing and Shielding
  • Other Groups
    • Parker Indego
      • Parker Indego Instructors
      • Parker Indego Therapists
      • Parker Indego Distributors
  • Community Blogs
  • Community Forums
  • Community Knowledge Bases
Follow Us
  • Follow Parker Hannifin on social media

Follow Parker Hannifin on social media:

How do I use function block methods in CFC?

Print Friendly and PDF

Calling a function block method in Structured Text is very simple, but users may occasionally need to call a method in Continuous Function Chart (CFC). The procedure for doing this is not readily apparent to new users and is covered here.

  1. First, make sure that you have created an instance of the function block whose method you are going to call. You can do this in the Declaration Editor of your CFC program. The function block can be one that you create or one from a library.

    IMAGE BROKEN -- DCLIFFEIMAGE BROKEN -- DCLIFFE
  2. Next, add a box element to your CFC chart. Give it a type using the format <function-block-name>.<method-name>. Then, give it the same name as your function block instance.

    IMAGE BROKEN -- DCLIFFE

    Notice that type for this CFC element (the bold text inside the blue box) is myFunctionBlock.myMethod. The name of the element is FB_Instance1, which is the same name that we gave to the function block in the Declaration Editor.

Conditional Execution

By default, the method will execute every single time the CFC chart is scanned. However, there is a way to change this behavior and make it so that the method only executes when a variable input evalutates TRUE. Right-click on the method and click EN/ENO.

IMAGE BROKEN -- DCLIFFE

Your CFC method call will now look like the one shown below. You can use a boolean variable or expression tied to EN to control whether the method is actually called in the scan.

IMAGE BROKEN -- DCLIFFE

If you want the behavior of the method to be edge-triggered, you can add an R_TRIG function block to the CFC chart.

IMAGE BROKEN -- DCLIFFE

NOTE: You can add EN/ENO pins to any CFC box element.

Auto Declaration

You can also auto-declare a function block when adding a CFC element to call a method. Steps are shown below.

  1. Add a new box element to your CFC chart.

    IMAGE BROKEN -- DCLIFFE
  2. Give the box a type corresponding to the function block method you want to call. Use the format <function-block-name>.<method-name>.

    IMAGE BROKEN -- DCLIFFE
  3. Give the function block a name. Make sure that the name is not one you have already used. Then, press Enter.

    IMAGE BROKEN -- DCLIFFE
  4. The standard Auto Declare dialog will appear, allowing you to confirm the function block you want to use, where you want to declare it and what (if any) initialization parameters you want it to use. Most people leave all of these options at their defaults and change them later in the Declaration Editor if necessary. When finished, press OK.

    IMAGE BROKEN -- DCLIFFE
  5. You will now see that your Declaration Editor has been updated and displays the function block you declared. There is also a method call in your CFC chart. In this image, there is a red underline in the method call because none of the inputs are populated. You will need to supply data to every input since methods do not have optional arguments.

    IMAGE BROKEN -- DCLIFFE

pac cfc function block method expression expected syntax

23MAY2017 DC

-->
  • Share
  • History
  • More
  • Cancel
Anonymous
Related
Follow Us
  • Follow Parker Hannifin on social media

Follow Parker Hannifin on social media:

Parker Hannifin Parker Hannifin

  • Products
  • About Parker
  • Investors
  • Community
  • Careers

Global Operations Global Operations

  • Divisions
  • Sales Companies
  • Worldwide Locations
  • Distribution Network
  • ParkerStore™ Network

Company Information Company Information

  • Newsroom
  • Event Calendar
  • Working with Parker
  • Product Brands
  • History

Global Support Center Global Support Center

  • Support
  • CAD
  • Where to Buy
  • Contact Parker
  • Manage Online Orders
© Parker Hannifin Corp 2022
  • Site Map
  • Safety
  • Privacy Policies
  • Terms and Conditions
  • Community Terms of Use
ENGINEERING YOUR SUCCESS.