The driver provides this function block in order to process alarms in the Runtime Service.

Every time a new alarm is received by the controller, it is pushed in a FIFO queue.

The PNIOGETALARM function block should be called when one wants to know if an alarm has been received and pushed in the FIFO queue.

  • If an alarm has been received, the output Q is set to TRUE.
    In this case, all the other outputs can be used to get information about the first alarm in the FIFO.
  • If there is no alarm received in the FIFO queue, the ouptput Q is set to FALSE.
    In this case, all the other outputs should not be used.

The alarm will remain in the FIFO queue until we call the function block PNIOACKALARM.

Therefore, several calls to PNIOGetAlarm without calling PNIOAckAlarm will return information about the same alarm.

NOTE: If the device sends several times the same alarm, it will be put in the FIFO queue only once.

Inputs

Parameter

Data type

Description

EN

BOOL

Enable function block to retrieve info about alarm.

TRUE to retrieve info about alarm.

DATA[]

USINT[]

BYTE array containing additional data about the alarm.

Hint: DATA[] is an Input/Output and an Array. The property has to be declared as an Input, otherwise it will not work in the Runtime Service.

Attention: The function block PNIOGETALARM uses DATA[] as an Output.
You can connect an array of 1024 bytes (max. length of additional data).

This additional data includes the User Structure Identifier (USI16 bits and OPTIONAL) followed by the data itself. An overview is given in the chapter Additional data.

This additional data is optional and the content and length depend on the alarm and the device that sends the alarm.

See the documentation of the device manufacturer to know what can be this additional data).

Use DATALEN parameter to know the size (in BYTES) of the additional data.

  • If DATALEN >0, additional data is available and you should read DATALEN BYTES.
  • If DATALEN is 0, there is no additional data

NOTE: If you don’t want to use the additional data, don’t connect any variable to this output.

Outputs

Parameter

Data type

Description

Q

BOOL

  • TRUE if there is an alarm and info are valid.
  • FALSE if no alarm.

FRAME_ID

UINT

Profinet Frame ID.

  • 0x0000 – 0x00FF Time Synchronization
  • 0x0100 – 0x7FFF RT_CLASS_3 Frames (IRTtop)
  • 0x8000 – 0xBFFF RT_CLASS_2 Frames (IRTflex)
  • 0xC000 – 0xFBFF RT_CLASS_1 Frames (RT/UDP)
  • 0xFC00 – 0xFCFF Acyclic transmission high
  • 0xFD00 – 0xFDFF Reserved
  • 0xFE00 – 0xFEFC Acyclic transmission low
  • 0xFEFD – 0xFEFF Reserved

SRC_ENDPOINT

UINT

Source End Point Identifier, specifying the origin of the packet inside the Source Process.

Value is between 0 and 2 high 32 -1.

See Profinet standard documentation to know more about this.

DST_ENDPOINT

UINT

Destination End Point Identifier.

Value is between 0 and 2 high 32 -1.

See Profinet standard documentation to know more about this.

SEND_SEQ_NUMBER

UINT

Send Sequence Number of the alarm.

See Profinet standard documentation to know more about this.

ACK_SEQ_NUMBER

UINT

Acknowledge Sequence Number of the alarm.

ALARM_HIGH

BOOL

  • TRUE if alarm is High.
  • FALSE if alarm is Low.

ALARM_TYPE

UINT

Alarm Type:

  • 0x01 DIAGNOSISAPPEAR
  • 0x02 PROCESS
  • 0x03 PULL
  • 0x04 PLUG
  • 0x05 STATUS
  • 0x06 UPDATE
  • 0x07 REDUNDANCY
  • 0x08 CONTROLLEDBYSUPERVISOR
  • 0x09 RELEASED
  • 0x0A PLUGWRONGSUBMODULE
  • 0x0B RETURNOFSUBMODULE
  • 0x0C DIAGNOSISDISAPPEAR
  • 0x0D MULTICASTCOMMUNICATIONMISMATCH
  • 0x0E PORTDATACHANGENOTIFICATION
  • 0x0F SYNCDATACHANGEDNNOTIFICATION
  • 0x10 ISOCHRONOUSMODEPROBLEMNOTIFICATION

Other values specific to manufacturer. See the documentation of the device manufacturer for more information in this case.

API

UDINT

API of the submodule associated with alarm (most of the time 0).

See Profinet standard documentation to know more about Application Process Identifier (API).

SLOT_NUMBER

UINT

Physical or logical slot which issues the alarm.

0x0000 - 0x7FFF

See Profinet standard documentation to know more about Slot number.

SUBSLOT_NUMBER

UINT

Physical or logical subslot which issues the alarm.

0x0000 - 0x8FFF

See Profinet standard documentation to know more about Subslot number.

MODULE_IDENT_NUMBER

UDINT

Module Ident Number.

1 - 0xFFFFFFFF

This value is specified by the device manufacturer. See the documentation of the device manufacturer for more information.

SUBMODULE_IDENT_NUMBER

UDINT

Identifier of the submodule which issues the alarm.

This value is specified by the device manufacturer. See the documentation of the device manufacturer for more information.

ALARM_SPECIFIER

UINT

Alarm specifier.

The content is explained in the chapter Alarm specifier.

DATALEN

UINT

 

Size of the additional data (DATA[]) (in BYTE).

  • 0 if there is no additional data.
  • >0 if there is additional data. In this case, you should read DATALEN bytes in the DATA[] array to get the additional data.
  •  

Other topics in this chapter

Additional data

Alarm specifier


Created with the Personal Edition of HelpNDoc: Effortlessly create a professional-quality documentation website with HelpNDoc