Application Programming Interface

Application Programming Interface

This chapter lists the API functions that are provided by GOAL PROFINET.

 

goal_pnioInit - Register GOAL PROFINET in GOAL (appl_init)

This function registers GOAL PROFINET in GOAL and must be called in appl_init. Its main functionality is to register a set config manager variables before the NVS storage is initialized.

It returns a GOAL_STATUS_T status and has no parameters.

GOAL_STATUS_T appl_init( void ) { GOAL_STATUS_T res; /**< GOAL result */ /* initialize GOAL PROFINET */ res = goal_pnioInit(); if (GOAL_RES_ERR(res)) { goal_logErr("failed to initialize GOAL PROFINET"); } return res; }

 

goal_pnioNew - Create a GOAL PROFINET instance (appl_setup)

This function creates a new GOAL PROFINET instance by taking a snapshot of all pre-variables (goal_pnioCfg API) and allocating the necessary resources. The application has to provide a GOAL PROFINET instance id and a callback handler. The callback handler can also be NULL to only use GOAL PROFINET stack default behavior. It returns a GOAL_STATUS_T status and a GOAL PROFINET instance handle.

Parameter

Description

GOAL_PNIO_T **ppPnio

returned GOAL PROFINET instance handle

const uint32_t id

GOAL PROFINET instance id

GOAL_PNIO_FUNC_CB_T pFunc

GOAL PROFINET callback function

Table: goal_pnioNew parameters

See example 01_simple_io for a demonstration.

 

goal_pnioCfgDcpFactoryResetDisableSet - Configure DCP Factory Reset

Controls if DCP factory reset is available. If set to GOAL_TRUE DCP factory reset will be denied. Default: GOAL_FALSE.

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: This function should not be used as the behavior can break conformity.

Parameter

Description

GOAL_BOOL_T flgDcpFactoryResetDisable

DCP Factory Reset Disable Flag

Table: goal_pnioCfgDcpFactoryResetDisableSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgDcpAcceptMixcaseStationSet - Configure DCP Mixcase Stationname Acceptance

Controls if DCP accepts station names with mixed case spelling. If set to GOAL_TRUE DCP accepts mixed case station names. Default: GOAL_FALSE.

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: This function should not be used as the behavior can break conformity.

Parameter

Description

GOAL_BOOL_T flgDcpAcceptMixcaseStation

DCP Mixcase Stationname Acceptance Flag

Table: goal_pnioCfgDcpAcceptMixcaseStationSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgVendorIdSet - Set Vendor Id

Configures the vendor id. Default: 0x028c (port GmbH)

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Parameter

Description

uint16_t idVendor

Vendor ID

Table: goal_pnioCfgVendorIdSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgDeviceIdSet - Set Device Id

Configures the device id. Default: 0x0001

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Parameter

Description

uint16_t idDevice

Device ID

Table: goal_pnioCfgDeviceIdSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgVendorNameSet - Set Vendor Name

Configures the vendor name. Default: "port GmbH"

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Parameter

Description

const char *strVendor

Vendor Name

Table: goal_pnioCfgVendorIdSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgPortDescSet - Set LLDP Port Description

Configures the LLDP port description. Default: "TestPort"

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Parameter

Description

const char *strDescPort

Port Description

Table: goal_pnioCfgPortDescSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgSystemDescSet - Set LLDP System Description

Configures the LLDP system description. Default: "PROFINET System"

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Parameter

Description

const char *strSystem

System Description

Table: goal_pnioCfgSystemDescSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgOrderIdSet - Set Order Id

Configures the order id. Default: "00210"

See document "Profile Guidelines Part 1: Identification & Maintenance Functions" for details.

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Parameter

Description

const char *strOrder

Order Id

Table: goal_pnioCfgOrderIdSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgSerialNumSet - Set Serial Number

Configures the serial number. Default: "20074"

See document "Profile Guidelines Part 1: Identification & Maintenance Functions" for details.

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Parameter

Description

const char *strNumSerial

Serial Number

Table: goal_pnioCfgSerialNumSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgHwRevSet - Set Hardware Revision

Configures the hardware revision. Default: 1

See document "Profile Guidelines Part 1: Identification & Maintenance Functions" for details.

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Parameter

Description

uint16_t idRevHw

Hardware Revision

Table: goal_pnioCfgHwRevSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgSwRevPrefixSet - Set Software Revision Prefix

Configures the software revision prefix. Default: "P"

See document "Profile Guidelines Part 1: Identification & Maintenance Functions" for details.

Valid values are:

  • "V" - official

  • "R" - revision

  • "P" - prototype

  • "U" - under test

  • "T" - test device

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Parameter

Description

const char chrRevSwPrefix

Software Revision Prefix

Table: goal_pnioCfgSwRevPrefixSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgSwRevFuncEnhSet - Set Software Revision Functional Enhancement

Configures the software revision functional enhancement. Default: 0x50

See document "Profile Guidelines Part 1: Identification & Maintenance Functions" for details.

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Parameter

Description

uint8_t idRevSwFuncEnh

Software Revision Functional Enhancement

Table: goal_pnioCfgSwRevFuncEnhSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgSwRevBugfixSet - Set Software Revision Bugfix

Configures the software revision bugfix. Default: 3

See document "Profile Guidelines Part 1: Identification & Maintenance Functions" for details.

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Parameter

Description

uint8_t idRevSwBugfix

Software Revision Bugfix

Table: goal_pnioCfgSwRevBugfixSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgSwRevIntChgSet - Set Software Revision Internal Change

Configures the software revision internal change. Default: 0x18

See document "Profile Guidelines Part 1: Identification & Maintenance Functions" for details.

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Parameter

Description

uint8_t idRevSwIntChg

Software Revision Internal Change

Table: goal_pnioCfgSwRevIntChgSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgSwRevCntSet - Set Software Revision Counter

Configures the software revision counter. Default: 0x0000

See document "Profile Guidelines Part 1: Identification & Maintenance Functions" for details.

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Parameter

Description

uint16_t idRevSwRevCnt

Software Revision Counter

Table: goal_pnioCfgSwRevCntSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgIm1TagFuncSet - Set I&M1 Tag Function

Configures the I&M1 tag function. Default: ""

See document "Profile Guidelines Part 1: Identification & Maintenance Functions" for details.

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Parameter

Description

const char *strIm1TagFunc

I&M1 Tag Function

Table: goal_pnioCfgIm1TagFuncSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgIm1TagLocSet - Set I&M1 Tag Location

Configures the I&M1 tag location. Default: ""

See document "Profile Guidelines Part 1: Identification & Maintenance Functions" for details.

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Parameter

Description

const char *strIm1TagLoc

I&M1 Tag Location

Table: goal_pnioCfgIm1TagLocSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgIm2DateSet - Set I&M2 Date

Configures the I&M2 date. Default: ""

See document "Profile Guidelines Part 1: Identification & Maintenance Functions" for details.

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Parameter

Description

const char *strIm2Date

I&M2 Date

Table: goal_pnioCfgIm2DateSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgIm3DescSet - Set I&M3 Description

Configures the I&M3 description. Default: ""

See document "Profile Guidelines Part 1: Identification & Maintenance Functions" for details.

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Parameter

Description

const char *strIm3Desc

I&M3 Description

Table: goal_pnioCfgIm3DescSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgIm4SigSet - Set I&M4 Signature (Functional Safety)

Configures the I&M4 signature. Default: ""

See document "Profile Guidelines Part 1: Identification & Maintenance Functions" for details.

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Parameter

Description

const char *strIm4Sig

I&M4 Signature

Table: goal_pnioCfgIm4SigSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgDevDapSimpleSet - Configure Device DAP Simple Mode

Configures the device DAP simple mode. If flgDevDapSimple is GOAL_TRUE the GOAL PROFINET stack automatically creates the DAP and port slots and modules.

Default: GOAL_TRUE

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: This function should not be used as the behavior can break conformity.

Parameter

Description

GOAL_BOOL_T flgDevDapSimple

Device DAP Simple Mode Flag

Table: goal_pnioCfgDevDapSimpleSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgDevDapApiSet - Set Device DAP API Number

Configures the device DAP API number. Default: 0

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: This function should not be used as the behavior can break conformity.

Parameter

Description

uint32_t idDevDapApi

Device DAP API Number

Table: goal_pnioCfgDevDapApiSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgDevDapSlotSet - Set Device DAP Slot Number

Configures the device DAP slot number. Default: 0

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: This function should not be used as the behavior can break conformity.

Parameter

Description

uint16_t idDevDapSlot

Device DAP Slot Number

Table: goal_pnioCfgDevDapSlotSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgDevDapSubslotSet - Set Device DAP Subslot Number

Configures the device DAP subslot number. Default: 1

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: This function should not be used as the behavior can break conformity.

Parameter

Description

uint16_t idDevDapSubslot

Device DAP Subslot Number

Table: goal_pnioCfgDevDapSubslotSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgDevDapModuleSet - Set Device DAP Module Id

Configures the device DAP module id. Default: 1

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: This function should not be used as the behavior can break conformity.

Parameter

Description

uint32_t idDevDapMod

Device DAP Module Id

Table: goal_pnioCfgDevDapModuleSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgDevDapSubmoduleSet - Set Device DAP Submodule Id

Configures the device DAP submodule id. Default: 1

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: This function should not be used as the behavior can break conformity.

Parameter

Description

uint32_t idDevDapSubmod

Device DAP Submodule Id

Table: goal_pnioCfgDevDapSubmoduleSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgNetLinkSafetySet - Configure Device Port Disable Behavior

Configures the device port disable behavior. If flgNetLinkSafety is set to GOAL_TRUE the GOAL PROFINET stack doesn't allow the master to disable all Ethernet interfaces at the same time. Default: GOAL_TRUE

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: This function should not be used as the behavior can break conformity.

Parameter

Description

GOAL_BOOL_T flgNetLinkSafety

Device Port Disable Behavior

Table: goal_pnioCfgNetLinkSafetySet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgNewIoDataCbSet - Configure New IO Data Callback

Configures the new IO data callback. If flgCbNewIoData is set to GOAL_TRUE the registered callback function is also called for each arrived cyclic frame. It must return as fast as possible as this happens in real time context. Default: GOAL_FALSE

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: If enabled it produces a very high application load as the callback is called 1000 times a second if the cycle time is set to 1 ms.

Parameter

Description

GOAL_BOOL_T flgCbNewIoData

New IO Data Callback Flag

Table: goal_pnioCfgNewIoDataCbSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgLldpOrgExtSet - Configure LLDP Organizationally-specific Extension

Configures the LLDP organizationally-specific extension. Default: GOAL_TRUE

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: This function should not be used as the behavior can break conformity.

Parameter

Description

GOAL_BOOL_T flgLldpOrgExt

LLDP Organizationally-specific Extension Flag

Table: goal_pnioCfgLldpOrgExtSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgLldpOptTlvSet - Configure LLDP Optional TLV Parameters

Configures the LLDP optional TLV parameters. Default: GOAL_TRUE

These parameters contain:

  • port description

  • system name

  • system description

  • system capabilities

  • management address

  • object ID

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: This function should not be used as the behavior can break conformity.

Parameter

Description

GOAL_BOOL_T flgLldpOptTlv

LLDP Optional TLV Parameters Flag

Table: goal_pnioCfgLldpOptTlvSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgLldpGenMacSet - Configure LLDP Port MAC Address Generation

Configures the automatic LLDP port MAC address generation. If set to GOAL_TRUE the LLDP port-specific MAC addresses are automatically generated by adding the port id to the host port MAC address. Default: GOAL_TRUE

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: If this functionality is enabled (default) every device uses at least two MAC addresses (real plus one per port) in an ascending order. To use specific virtual port MAC addresses this feature must be disabled and the driver must provide different MAC addresses per request (GOAL_ETH_PORT_HOST and port specific requests).

Parameter

Description

GOAL_BOOL_T flgLldpGenMac

Automatic LLDP MAC Generation Flag

Table: goal_pnioCfgLldpGenMacSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgIm14SupportSet - Configure I&M 1-4 Support

Configures the GOAL PROFINET stack I&M 1-4 support. If set to GOAL_FALSE the stack denies I&M 1-4 requests. Default: GOAL_TRUE

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: This function should not be used as the behavior can break conformity.

Parameter

Description

GOAL_BOOL_T flgIm14Support

I&M 1-4 Support Flag

Table: goal_pnioCfgIm14SupportSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgIm14CbSet - Configure I&M 1-4 Callback

Configures the GOAL PROFINET stack I&M 1-4 callback. If set to GOAL_TRUE the application callback must handle the I&M 1-4 get and set requests. Default: GOAL_FALSE

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: This function should not be used as the behavior can break conformity.

Parameter

Description

GOAL_BOOL_T flgIm14Cb

I&M 1-4 Callback Flag

Table: goal_pnioCfgIm14CbSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgIm0CbSet - Configure I&M 0 Callback

Configures the GOAL PROFINET stack I&M 0 callback. If set to GOAL_TRUE the application callback must handle the I&M 0 get and set requests. Default:

GOAL_FALSE

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: This function should not be used as the behavior can break conformity.

Parameter

Description

GOAL_BOOL_T flgIm0Cb

I&M 0 Callback Flag

Table: goal_pnioCfgIm0CbSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgIm0FilterDataCbSet - Configure I&M 0 Filter Data Callback

Configures the GOAL PROFINET stack I&M 0 filter data callback. If set to GOAL_TRUE the application callback must handle the I&M 0 filter data get and set requests. Default: GOAL_FALSE

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: This function should not be used as the behavior can break conformity.

Parameter

Description

GOAL_BOOL_T flgIm0FilterCb

I&M 0 Filter Data Callback Flag

Table: goal_pnioCfgIm0FilterDataCbSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgRecDataBusyBufsizeSet - Configure Record Handle Storage Count

Configures the count of parallel record handles. Default: 2

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Parameter

Description

GOAL_BOOL_T cntRecDataBusyBufsize

Record Handle Storage Count

Table: goal_pnioCfgRecDataBusyBufsizeSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgRpcFragReqLenMaxSet - Configure Maximum Record Size

Configures the maximum size in bytes of a record request. This must match the MaxSupportedRecordSize attribute in the GSDML file. Default: 4068

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: Changing this value to a smaller number can break conformity.

Parameter

Description

unsigned int sizeRpcFragMaxReqLen

Maximum Record Size

Table: goal_pnioCfgRpcFragReqLenMaxSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgRpcFragMaxCntSet - Configure Maximum RPC Fragment Number

This function is obsolete. The GOAL PROFINET stack now allows 64 fragmented frames.

 

goal_pnioCfgRpcFragEnableSet - Configure RPC Fragmentation

Configures the RPC fragmentation feature. If set to GOAL_TRUE RPC fragmentation is enabled. Default: GOAL_TRUE

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: This function should not be used as the behavior can break conformity.

Parameter

Description

GOAL_BOOL_T flgRpcFragSupport

RPC Fragmentation Enable Flag

Table: goal_pnioCfgRpcFragEnableSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgRpcSessionMaxCntSet - Configure Maximum RPC Session Count

Configures the maximum count of RPC sessions. Default: 8

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: This function should not be used as the behavior can break conformity.

Parameter

Description

unsigned int numRpcSessions

RPC Session Count

Table: goal_pnioCfgRpcSessionMaxCntSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgDiagBufMaxCntSet - Configure Maximum Diagnosis Entries

Configures the maximum count of diagnosis entries. Default: 20

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: Using a too small value can break conformity.

Parameter

Description

unsigned int numDiagBufMax

Maximum Diagnosis Entries

Table: goal_pnioCfgDiagBufMaxCntSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgDiagBufMaxDataSizeSet - Configure Maximum Diagnosis Data Size

Configures the maximum size in bytes of each diagnosis entry. Default: 28

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: Using a value below 28 can break conformity.

Parameter

Description

unsigned int numDiagDataSizeMax

Maximum Diagnosis Data Size

Table: goal_pnioCfgDiagBufMaxDataSizeSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgIocrBlocksMaxSet - Configure Maximum IOCR Block Buffers

Configures the maximum count of IOCR block buffers. Default: 10

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: This function should not be used as the behavior can break conformity.

Parameter

Description

unsigned int numIocrBlocksMax

Maximum IOCR Block Buffers

Table: goal_pnioCfgIocrBlocksMaxSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgCrMaxCntSet - Configure Maximum Communication Relation Count

Configures the maximum count of communication relations. Default: 10

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: This function should not be used as the behavior can break conformity.

Parameter

Description

unsigned int numCrMax

Maximum CR Count

Table: goal_pnioCfgCrMaxCntSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgArMaxCntSet - Configure Maximum Application Relation Count

Configures the maximum count of application relations. Default: 2

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: This function should not be used as the behavior can break conformity.

Parameter

Description

unsigned int numArMax

Maximum AR Count

Table: goal_pnioCfgArMaxCntSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgApiMaxCntSet - Configure Maximum API Count

Configures the maximum count of application process identifiers. Setting this value only affects the ModuleDiffBlock logic and needs to be big enough to hold the largest possible GSDML configuration. Default: 1

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: This function should not be used as the behavior can break conformity and the GOAL PROFINET stack only supports API 0.

Parameter

Description

unsigned int numApiMax

Maximum API Count

Table: goal_pnioCfgApiMaxCntSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgSlotMaxCntSet - Configure Maximum Slot Count

Configures the maximum count of slots. Setting this value only affects the ModuleDiffBlock logic and needs to be big enough to hold the largest possible

GSDML configuration. Default: 3

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Parameter

Description

unsigned int numSlotMax

Maximum Slot Count

Table: goal_pnioCfgSlotMaxCntSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgSubslotMaxCntSet - Configure Maximum Subslot Count

Configures the maximum count of subslots per slot. Setting this value only affects the ModuleDiffBlock logic and needs to be big enough to hold the

largest possible GSDML configuration. Default: 6

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Parameter

Description

unsigned int numSubslotMax

Maximum Subslot Count Per Slot

Table: goal_pnioCfgSubslotMaxCntSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgSubslotIfSet - Configure Interface Subslot

Configures the interface subslot id. Default: 0x8000

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: This function should not be used as the behavior can break conformity.

Parameter

Description

unsigned int idSubslotIf

Interface Subslot Id

Table: goal_pnioCfgSubslotIfSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgSubslotPortSet - Configure Port Subslot

Configures the port subslot base id. Default: 0x8001

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Warning: This function should not be used as the behavior can break conformity.

Parameter

Description

unsigned int idSubslotPort

Port Subslot Id

Table: goal_pnioCfgSubslotPortSet parameters

See example 15_config_set for a demonstration.

 

goal_pnioCfgSnmpIdSet - Configure SNMP Instance Id

Configures the GOAL SNMP instance id that is used by the GOAL PROFINET stack.

Default: GOAL_ID_INVALID

It returns a GOAL_STATUS_T status.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Parameter

Description

idSnmp

GOAL SNMP Instance Id

Table: goal_pnioCfgSnmpIdSet parameters

See example 13_pnio_snmp for a demonstration.

 

goal_pnioSlotNew - Create a new slot

Create a new slot. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

uint32_t idApi

API number (always 0)

uint32_t idSlot

slot number

GOAL_BOOL_T flgAutoGen

generate API automatically if not exist

Table: goal_pnioSlotNew parameters

/* create API 0:Slot 1 even if API 0 doesn't exist */ res = goal_pnioSlotNew(pPnio, 0, 1, GOAL_TRUE);

 

goal_pnioSubslotNew - Create a new subslot

Create a new subslot. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

uint32_t idApi

API number (always 0)

uint32_t idSlot

slot number

uint32_t idSubslot

subslot number

GOAL_BOOL_T flgAutoGen

generate API and slot automatically if not exist

Table: goal_pnioSubslotNew parameters

/* create API 0:Slot 1:Subslot 1 even if API 0 and/or * Slot 1 don't exist */ res = goal_pnioSubslotNew(pPnio, 0, 1, 1, GOAL_TRUE);

See example 01_simple_io for a demonstration.

 

goal_pnioModNew - Create a new module

Create a new module. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

uint32_t idMod

module id

Table: goal_pnioModNew parameters

 

goal_pnioSubmodNew - Create a new submodule

Create a new submodule. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

uint32_t idMod

module id

uint32_t idSubmod

submodule id

GOAL_PNIO_MOD_TYPE_T type

submodule type (input, output, both)

uint16_t sizeInput

size of input module

uint16_t sizeOutput

size of output module

GOAL_BOOL_T flgAutogen

generate module if not exist

Table: goal_pnioSubmodNew parameters

See example 01_simple_io for a demonstration.

 

goal_pnioModPlug - Plug a module into a slot

Plug a module into a slot. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

uint32_t idApi

API (always 0)

uint16_t idSlot

slot number

uint32_t idMod

module id

Table: goal_pnioModPlug parameters

 

goal_pnioSubmodPlug - Plug a submodule into a subslot

Plug a submodule into a subslot.

This function causes communication core and application core to exchange process data via RPC in multicore projects. See goal_pnioDmSubmodPlug for further details.

Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

uint32_t idApi

API (always 0)

uint16_t idSlot

slot number

uint16_t idSubslot

subslot number

uint32_t idMod

module id

uint32_t idSubmod

submodule id

Table: goal_pnioSubmodPlug parameters

See example 01_simple_io for a demonstration.

goal_pnioDmSubmodPlug - Plug a submodule into a subslot (Data Mapper)

This function is only available on multicore targets using Micro Core to Core (MCTC) and Data Mapper (DM).

Plug a submodule into a subslot.

The data exchange with the peer core is done by MCTC, which causes a faster communication than RPC (see goal_pnioSubmodPlug) but a limitation in number and size of submodules. This limit relates to the physical medium (e.g. SPI, DPRAM) used by MCTC.

The functions goal_pnioSubmodPlug and goal_pnioDmSubmodPlug can be utilized next to each other.

Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

uint32_t idApi

API (always 0)

uint16_t idSlot

slot number

uint16_t idSubslot

subslot number

uint32_t idMod

module id

uint32_t idSubmod

submodule id

Table: goal_pnioDmSubmodPlug parameters

See example 21_pnio_snmp_dm or 25_dynamic_modules_dm for a demonstration.

goal_pnioModPull - Pull a module from a slot

Pull a module from a slot. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

uint32_t idApi

API (always 0)

uint16_t idSlot

slot number

Table: goal_pnioModPull parameters

See example 08_dynamic_modules for a demonstration.

 

goal_pnioSubmodPull - Pull a submodule from a subslot

Pull a submodule from a subslot. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

uint32_t idApi

API (always 0)

uint16_t idSlot

slot number

uint16_t idSubslot

subslot number

Table: goal_pnioSubmodPull parameters

 

goal_pnioDataOutputGet - Get output data from a submodule

Get output data from a submodule. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

uint32_t idApi

API (always 0)

uint16_t idSlot

slot number

uint16_t idSubslot

subslot number

char *pBuf

data buffer

uint16_t len

data buffer length

GOAL_PNIO_IOXS_T *pStateIops

pointer for producer state

Table: goal_pnioDataOutputGet parameters

See example 01_simple_io for a demonstration.

 

goal_pnioDataInputSet - Set input data for a submodule

Set input data for a submodule. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

uint32_t idApi

API (always 0)

uint16_t idSlot

slot number

uint16_t idSubslot

subslot number

char *pBuf

data buffer

uint16_t len

data buffer length

GOAL_PNIO_IOXS_T stateIops

producer state

Table: goal_pnioDataInputSet parameters

See example 01_simple_io for a demonstration.

 

goal_pnioApduStatusGet - Get the application protocol data unit status

Get the application protocol data unit status. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

GOAL_PNIO_AR_ID_T idAr

application relation id

GOAL_PNIO_APDU_STATUS_T *pStatusApdu

APDU status pointer

Table: goal_pnioApduStatusGet parameters

See example 06_apdu_status for a demonstration.

 

goal_pnioAlarmNotifySend - Send an alarm notification

Send an alarm notification. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

uint16_t *pNrAlarmSeq

pointer to store alarm sequence number

GOAL_PNIO_AR_ID_T idAr

application relation id

uint32_t prio

priority

const GOAL_PNIO_ALARM_ NOTIFY_T *pAlarmNotify

pointer to alarm notification

uint16_t lenDataUser

user data length

void *pDataUser

pointer to user data

Table: goal_pnioAlarmNotifySend parameters

See example 07_alarm_button for a demonstration.

 

goal_pnioAlarmNotifySendAck - Send an alarm notification acknowledge

Send an alarm notification acknowledge. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

GOAL_PNIO_AR_ID_T idAr

application relation id

uint32_t prio

priority

const GOAL_PNIO_ALARM_ NOTIFY_T *pAlarmNotify

pointer to alarm notification

GOAL_PNIO_STATUS_T *pStatus

PROFINET status

uint16_t lenDataUser

user data length

void *pDataUser

pointer to user data

Table: goal_pnioAlarmNotifySendAck parameters

See example 07_alarm_button for a demonstration.

 

goal_pnioAlarmProcessSend - Send a process alarm

Send a process alarm. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

uint32_t api

API

uint16_t slot

slot number

uint16_t subslot

subslot number

uint16_t usi

user structure identifier

uint16_t lenData

data length

uint8_t *pData

pointer to user data

Table: goal_pnioAlarmProcessSend parameters

See example 17_process_alert for a demonstration.

 

goal_pnioRecReadFinish - Answer a record read request

Answer a record read request. The sequence number is used to detect if the request has expired. If that is the case the response will be silently dropped.

Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

int32_t hdl

record handle

GOAL_PNIO_STATUS_T *pStatusPnio

PROFINET status pointer

const uint8_t *pData

record data

uint16_t len

record data length

uint32_t numSeq

sequence number

Table: goal_pnioRecReadFinish parameters

See example 09_busy_records for a demonstration.

 

goal_pnioRecWriteFinish - Answer a record write request

Answer a record write request. The sequence number is used to detect if the request has expired. If that is the case the response will be silently dropped.

Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

int32_t hdl

record handle

GOAL_PNIO_STATUS_T *pStatusPnio

PROFINET status pointer

uint32_t numSeq

sequence number

Table: goal_pnioRecWriteFinish parameters

See example 09_busy_records for a demonstration.

 

goal_pnioDiagExtChanDiagAdd - Add an extended channel diagnosis entry

Add an extended channel diagnosis entry. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

GOAL_PNIO_DIAG_HANDLE_T *pHdl

pointer to store diagnosis handle

uint32_t api

API

uint16_t slot

slot number

uint16_t subslot

subslot number

uint16_t chan

channel index

uint16_t numErr

error number

uint16_t typeExtChanErr

extended channel error type

uint32_t valExtChanAdd

extended channel error value

GOAL_BOOL_T flgMaintReq

maintenance required flag

GOAL_BOOL_T flgMaintDem

maintenance demanded flag

GOAL_BOOL_T flgSubmitAlarm

submit alarm flag

uint16_t typeAlarm

alarm type

Table: goal_pnioDiagExtChanDiagAdd parameters

See example 12_diag_entry for a demonstration.

 

goal_pnioDiagChanDiagRemove - Remove an channel diagnosis entry

Remove an channel diagnosis entry. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

GOAL_PNIO_DIAG_HANDLE_T hdl

diagnosis handle

GOAL_BOOL_T flgSubmitAlarm

submit alarm flag

Table: goal_pnioDiagChanDiagRemove parameters

See example 12_diag_entry for a demonstration.

 

goal_pnioCyclicCtrl - Control cyclic data received callback

Control cyclic data received callback. If flgCyclic is set to GOAL_TRUE then the callback GOAL_PNIO_CB_ID_NEW_IO_DATA signalizes the reception of new I/O data. This will led to a much higher system load. For most applications it is sufficient to poll the cyclic data by goal_pnioDataOutputGet.

Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

GOAL_BOOL_T flgCyclic

cyclic data enable flag

Table: goal_pnioCyclicCtrl parameters

 

goal_pnioVendorIdSet - Set the vendor id

Set the vendor id. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

uint16_t id

vendor id

Table: goal_pnioVendorIdSet parameters

See example 14_info_set for a demonstration.

 

goal_pnioDeviceIdSet - Set the device id

Set the device id. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

uint16_t id

device id

Table: goal_pnioDeviceIdSet parameters

See example 14_info_set for a demonstration.

 

goal_pnioDeviceNameSet - Set the device name

Set the device Name. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

char *strName

device name

uint32_t lenName

device name length

GOAL_BOOL_T flgPerm

permanent flag

GOAL_BOOL_T flgCb

run-callback flag

Table: goal_pnioDeviceNameSet parameters

 

goal_pnioHwRevSet - Set the hardware revision

Set the hardware revision. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

uint16_t revHw

hardware revision

Table: goal_pnioHwRevSet parameters

See example 14_info_set for a demonstration.

 

goal_pnioSwRevSet - Set the software revision

Set the software revision. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

uint8_t chrPrefix

prefix

uint8_t idFuncEnh

functional enhancement

uint8_t idBugfix

bugfix

uint8_t idIntChange

internal change

uint16_t cntRev

revision counter

Table: goal_pnioSwRevSet parameters

See example 14_info_set for a demonstration.

 

goal_pnioProfileIdSet - Set the profile id

Set the profile id. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

uint16_t id

profile id

uint16_t type

profile specific type

Table: goal_pnioProfileIdSet parameters

See example 14_info_set for a demonstration.

 

goal_pnioOrderIdSet - Set the order id

Set the order id. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

const char *strOrder

order id

uint32_t lenOrder

order id length

Table: goal_pnioOrderIdSet parameters

See example 14_info_set for a demonstration.

 

goal_pnioSerialNumSet - Set the serial number

Set the serial number. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

const char *strSerial

serial number

uint32_t lenSerial

serial number length

Table: goal_pnioSerialNumSet parameters

See example 14_info_set for a demonstration.

 

goal_pnioVendorNameSet - Set the vendor name

Set the vendor name. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

const char *strVendor

vendor name

uint32_t lenVendor

vendor name length

Table: goal_pnioVendorNameSet parameters

See example 14_info_set for a demonstration.

 

goal_pnioPortDescSet - Set the port description

Set the port description. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

const char *strPort

port description

uint32_t lenPort

port description length

Table: goal_pnioPortDescSet parameters

See example 14_info_set for a demonstration.

 

goal_pnioSystemDescSet - Set the system description

Set the system description. Returns a GOAL_STATUS_T status.

Parameter

Description

GOAL_PNIO_T *pPnio

PROFINET data

const char *strSys

system description

uint32_t lenSys

system description length

Table: goal_pnioSystemDescSet parameters

See example 14_info_set for a demonstration.

 

goal_pnioCfgflgIm4WriteSupportSet - Set the I&M4 Data write support flag

Set the I&M4 Data write support flag. Returns a GOAL_STATUS_T status.

If set to GOAL_FALSE the I&M 4 Data will be read only. Default: GOAL_TRUE.

This function configures the GOAL PROFINET instance and must be called before goal_pnioNew to have an effect.

Parameter

Description

GOAL_BOOL_T flgIm4WriteSupport

Write support flag

Table: goal_pnioCfgflgIm4WriteSupportSet parameters

 

 

Â