Home
        sigmadue CU-02 & MP-01
         Contents
1.                       MODBUS MODBUS  Memory Model PDU Access    Read Write Coil         PLC Memory     M Memory Direct  Access       Functions 1  5  15              Read Write Holding    1024 Digital In  128 Bytes g Functions 3  6  16    Read Input    8192 Bytes 4  4096 Registers Function 2    Read Register       Input  Registers                 Function 4                      Sigmadue   Function Block Firmware Library    This memory model  accessible via the modbus TCP IP Server agent  is mapped  on a memory zone which can be accessed via the IEC61131 3 programming  environment as shown in the following table              Protocol Agent Protocol Memory Areas   PLC Memory Mapping  Coils  M10000 0 to  M10127 7       MW10128 0 to  Holding Registers  MW18318 0  ModBus TCP IP Server  Discrete Inputs  M10000 0 to  M10127 7   MW10128 0 to  Input Registers  MW18318 0  Status Register  MB18319 0                The following tables show the correspondence between the modbus addresses of  the registers and bits accessible via the IEC61131 3 protocol and the syntax used  to access the same memory areas     COILS Modbus TCP IP Server    MODBUS Address 1EC61131 3 SYNTAX   MX10000 0   MX10000  1   MX10000 2   MX10000 3   MX10000 4   MX10000 5   MX10000 6   MX10000 7   MX10001 0   MX10001 1                N                   3  4  5  6  7  8  9        MX10127 1   MX10127 2   MX10127 3   MX10127 4   MX10127 5   MX10127 6   MX10127 7                      REGISTERS Modbus TCP IP Server    MODB
2.            Canopen FBS               CanOPEN_Autolearn           0    ccc eee eee  CanOPEN_Device_Compare                  000005     4 1    4 1 1    az  Le  Si  E  SE  E   1   SE  f     ARBRHRARHRHAHRHHA    gt  0 ONDQUIASWN    Chapter 5  PROFIBUS  for CU 02 unit only                            PROFIBUS DP Slave Agent    5 1    5 1 1  5 1 2  5 1 3    Chapter 6  Memory Copy Functions      Copy Function Blocks          6 1    6 1 1    Index  continued     CanOPEN_ Get _ Dev    ice Com_Par                 2 2      CanOPEN_get_Device_id                ee eeeee  CanOPEN_Network_Compare                  20005   CanOPEN_Network_Status                    0 0005  CanOPEN_Net_Control_Start                          CanOPEN_Scan_Device_Com                   000   CanOPEN_Scan_Device_Id               naaa aa  CAN_ENABLE_CYCLIC_SYNC                         CAN_GET_CANOPEN_KERNEL_STATE                 CAN_GET_LOCAL_NODE ID                            CAN_GET_STATE  CAN_PDO_READ8  CAN_PDO_WRITE8    CAN_RECV_BOOTUP 2 00  liane re  CAN_RECV_BOOTUP_DEV                CAN_RECV_EMCY    CAN_RECV_EMCY_DEV dada poeti eh bod  CAN  REGISTER  COBID 4 05 ire alti    CAN_SDO_READ8    CAN_SDO_READ_STR_            0 0  e eae    CAN_SDO_WRITE8    CAN_SDO_WRITE_    CAN_SEND_SYNC    in are ri    CAN WRITE  EMG   pub olii is banda Pala ER  GEIT   SUPPORTED  DIAG  lt a tele ee eae ewes    NET_ASCON_ID    NGSRIRi ils    PROFI_ENABLE    PROFI_STATUS      PROFI SEND  TO MASTER appia eni    MEMCOPY_FROM_    MEMCOPY_
3.       Label Type Description Range  SLAVE_ID   USINT Agent in question  slave 1 or slave 2    1  2  ADDRESS   UINT I O address on which to write 1  128  DATA BOOL Bit value being set TRUE  FALSE   Output description  Label Type Description Range  OPRS  USINT Execution result 0  1 2 3 4                   The Function Block writes individually the memory locations dedicated to the digital  I O  According to the input specified memory address  the memory locations  dedicated to the I O can be written without declaring the corresponding percentage  variables  Several digital I Os can be written by specifying the Function Block within  a cycle     The OPRS parameter can acquire the following values              Value Meaning  0 Block execution terminated successfully  1 Illegal address  3 Invalid protocol  different from 1 or 2              The error condition with value 1 has the highest priority and if the condition occurs  other possible errors are not diagnosed        43    Sigmadue   Function Block Firmware Library    3 4 Master modbus protocol    It is possible to initiate a protocol which provides the fundamental functions of a  modbus Master on one of the serial ports of the Ascon CPUs  Fundamental  functions constitute the possibility to generate a serial line query compliant with  modbus specifications  The implementation of the Master defines a memory area   accessible via the IEC61131 3 programming environment  which stores the data  that the Modbus Master agent must s
4.     NODE_DIAGNOSTICS anes OF Producer and Diagnostics details    ERROR WORD Error Code  ERROR_INFO DWORD  Details of the errors occurred       Content OD 1000h       DEVICE_NAME Content OD 1008h  max  4 characters                         Description The data type arrays are composed of 127 elements from a number of possible  addresses that correspond to the slave  The diagnostic data of node assigns  individual bits mean the following     The form is available on the network    The module on the network is Ascon  The module supports the Heartbeat  The module supports the Node Guarding                82    Chapter 4   CanOPEN    4 1 29 NG_RTR    Using the present Function Block it is possible to send an RTR to a network node  respecting the Node Guardin protocol     FB Prototype NG_RTR    EN       BOOL BOOL       gt  ENO  NODE_ID       USINT USINT       gt  OPRS       Input description    Tyre Description    EN  BOOL Enable In TRUE FALSE       NODE_ID  USINT  Network node TRUE FALSE    Output description    Type Description    ENO BOOL Enable Out TRUE FALSE  OPRS  USINT FB execution result             Description The node diagnostic data assigns individual bits with the following meaning     Node address not valid 0x20  Node not controlled 0x01    Stack problem             83    Chapter 5  PROFIBUS  for CU 02 unit only     The Ascon spa sigmadue series device CU 02 2010 provides the PROFIBUS DP  connection capability as a slave unit  The communication protocol is Master Slave 
5.     end_if        29    Chapter 3  Serial communications    The Ascon CU 02 and MP 01 units are IEC61131 3 programmable devices with  several communication ports  10baseT ethernet  serial RS232 RS485 and a CAN  port in case of CU 02 unit  The available serial ports can be used for applications  requiring Modbus communication  Two slave agents and one master agent have  been implemented  the Modbus agents can be associated to each of the physical  available ports  An agent has also been implemented for an ASCII string  communication  this one can only be associated to the serial service port  XO for  MP 01 and X1 for CU 02   The thread in the FW executing all serial communication  activities repeats the operations every 100 ms  This means that in case for example  of a serial port configuration with Modbus Slave protocol  a possible master  executing a query must consider a response timeout not lower than 100 ms     3 1 Serial communication configuration    The serial communication configuration of the auxiliary ports can be made using  two Function Blocks     e OPEN _SERIAL_COMM  e CLOSE_SERIAL COMM    These calls are used to define the configuration and the protocol to be assigned to  the port  Two slave and one master protocols and an agent can be assigned for  simple serial communication of ASCII strings  The 3 MODBUS and the ASCII  protocols can be freely assigned to the ports  The following numbers classify the  physical ports for the CU 02 and the MP 01 units     RS232 
6.     gt  PAGE_IN_USE    Label Type   Description Range    0  Waiting for config data from the master  1 1  PROFIBUS agent not instantiated  STATUS USINT ee Pa 2  Data Exchange running   9 3  Protocol Error  4  Hardware Error    PAGE_IN_USE   USINT  Page in use 1   4    Input Parameters                         The PAGE_IN_USE parameter gives the indication of which output page actually  is exchanged with the master  from CU 02 to the master   The following table  gives the possible values for the different data exchange modes                       Exchange Mode PAGE_IN_USE  Basic 1  Paged 1   4  Non paged mode with a data integrity control 2       PROFI_SEND_TO_MASTER  PROFI_SEND_TO_MASTER    PAGE     gt    USINT   gt  OPRS       Input Parameters                         Label Type Description Range  PAGE USINT Page sent to the master PROFIBUS 1   4  Output Parameters  Label Type Description Range  0  OK  OPRS USINT Execution Result 1  Page number Error  4  Hardware Error                   The function block prepares the output data page sent to the master PROFIBUS  unit  Depending on the Exchange Mode chosen  the PAGE value could assume  different meanings           Exchange Mode PAGE value  Basic FB not used  Paged The value identifies the next exchanged page       Non paged mode with   The value it is not considered     Always the page2 will be  a data integrity control  copied over the page1                   87    Chapter 6  Memory Copy Functions    In order to simplify the
7.     network layer     CAN_WRITE_EMCY    ENABLE     gt   EMCY_ERR_CODE     gt   EMCY_ERR_REGISTER  gt   EMCY_ERR_FIELD1  gt   EMCY_ERR_FIELD2  gt   EMCY_ERR_FIELD3  gt   EMCY_ERR_FIELD4  gt   EMCY_ERR_FIELD5     gt   EMCY_ADD_INFO  gt   NETNUMBER     gt     Input description           CONFIRM  WORD       ERROR    Description  Input for enabling or locking the function block       Emergency error information corresponding to  the CiA Draft Standard 301 for the Emergency   Message to send       EMCY_ERR_REGISTER BYTE    Emergency error information corresponding to  the CiA Draft Standard 301 for the Emergency   Message to send       EMCY_ERR_FIELD1    Emergency error information corresponding to  the CiA Draft Standard 301 for the Emergency   Message to send       EMCY_ERR_FIELD2    Emergency error information corresponding to  the CiA Draft Standard 301 for the Emergency   Message to send       EMCY_ERR_FIELD3    Emergency error information corresponding to  the CiA Draft Standard 301 for the Emergency   Message to send       EMCY_ERR_FIELD4    EMCY_ERR_FIELD5  BYTE       Emergency error information corresponding to  the CiA Draft Standard 301 for the Emergency   Message to send    Emergency error information corresponding to  the CiA Draft Standard 301 for the Emergency   Message to send             80    Description    4 1 27    FB Prototype    Description    Chapter 4   CanOPEN       Additional  application specific emergency error  information  which is stored in index 1003
8.    Output description    Description  BOOL Output for signal service completion by the function block    Address of the node  1 127   from which a Bootup message  USINT  was received    Error code corresponding to the data type   CIA405_CANOPEN_KERNEL_ERROR     The function block CAN_RECV_BOOTUP is used for reading the Bootup  messages of any node from the network layer s receiving buffer  If upon the return  of the function block the output CONFIRM is set to TRUE  the output DEVICE  gives the node address that the message was received from  However  if the  output CONFIRM is set to FALSE  then the network layer s receiving buffer does  not contain any Bootup messages    The function block always returns the first Bootup message entered into the receiving  buffer    oldest message   the message is subsequently erased from the receiving  buffer  Thus every Bootup message can only be read one time by the PLC program   The function blocks CAN_RECV_BOOTUP_DEV and CAN_RECV_BOOTUP both  access the same receiving buffer    This function block is only available on control units in    PLC with CANopen  Master    mode                    71    Sigmadue   Function Block Firmware Library    4 1 17    FB Prototype    Description    4 1 18    FB Prototype    CAN_RECV_BOOTUP_DEV    Function block for reading Bootup messages of a specific node from the receiving  buffer of the network layer     CAN_RECV_BOOTUP_DEV       DEVICE     gt    USINT BOOL       gt  CONFIRM  ENABLE       BOOL WORD    
9.    SOURCE_ADDR   UDINT    M  input  source address  num        Amount of bytes to be copied    The value  combined with the  destination address  DEST_ADDR    MEM_SIZE MEM_SIZE   cannot exceed the last   0    43000  memory location available for the  specific memory type    I  M or Q   num           Output description    Type Description  ERROR BYTE  Error status    Description This function block performs a copy of a desired amount of bytes from a valid  M  memory area to a desired  M memory location        Default Values    Default Value    DEST_ADDR  SOURCE_ADDR  MEM_ SIZE             Reference Table    I e       0   OK   OPRS 1   Source area outside the allowed address   2   Destination area outside the allowed address       92    Chapter 6   Real Time Clock    6 1 5 MEMCPY_M_TO_Q  FB Prototype MEMCPY_M_TO_Q    DEST_ADDR       UDINT BYTE    gt  OPRS  SOURCE_ADDR     UDINT  MEM_SIZE     gt    UDINT    Input description       Description    All available  addresses    All admitted  addresses    DEST_ADDR  Q memory destination address  num        SOURCE_ADDR  M  input  source address  num        Amount of bytes to be copied    The value  combined with the  destination address  DEST_ADDR    MEM_SIZE MEML_ SIZE   cannot exceed the last   0    43000  memory location available for the  specific memory type    I  M or Q   num              Output description    Type Description  ERROR BYTE   Error status    Description This function block performs a copy of a desired amount of byt
10.    Sigmadue   Function Block Firmware Library    3 1 2 CLOSE _SERIAL_COMM  Function Block closing the serial port                 FB Prototype CLOSE_SERIAL_COMM  PORT       USINT  Input description  Label Type Description Range  CU 02 Serial port selection variable   0 1  2  Port INT    59 MP 01 Serial port selection variable   0 1                   Description This function closes the serial communication port and releases its association  with the previously assigned serial protocol  After the function block has been  executed  the port is available for later use through the open function block        32    Chapter 3   Serial communications    3 2 Modbus Slave protocol    Once the Modbus Slave protocol is assigned to a port as described in function  block OPEN_SERIAL_COMM  it is not operative yet  but needs to be configured   This is done with function block MODBUS_SLAVE_SETTINGS which assigns a  Modbus network address and a timeout to the slave port  The system monitors the  time between two consecutive queries to the slave and checks that such time is  shorter than timeout  Once the slave is configured  the agent stays operative and  grants a Master access to specific memory areas shared with the IEC61131 3  programming environment  The Modbus agent responds to the following functions  and processes one message approximately every 100 ms     Function Codes    Code  Sub code   hex   Physical Discrete Inputs Read Discrete Inputs  Bit Read Coils    access aa Bits Or Physical
11.    VAR_GLOBAL       baud   USINT    parity   USINT   data_length   USINT   stop_bit   USINT   init_port  BOOL    true   error  BOOL    node_id   USINT           next_step  BOOL    true   sequence_read  ARRAY  1  5  OF WORD   sequence _write  ARRAY  1  5  OF WORD           END_VAR  In addition to serial port configuration parameters  a number of parameters such    as init_por  error and next_step cyclically control the execution of the code of  the running tasks depending on the status of the other tasks  The two arrays   sequence_read and sequence_write  contain the values written in the registers  and the values read via the modbus        HW port initialisation  This task initialises the serial ports and assigns them the desired protocols  The  task code variable declaration and executable code are shown below     Variable declaration          VAR_EXTERNAL             baud   USINT   parity   USINT   data _length  USINT   stop_bit   USINT   init_port  BOOL   error  BOOL   node_id   USINT                 END_VAR          VAR_GLOBAL    END_VAR       VAR    timeout  UINT   oprs  USINT   open_serial_com  OPEN_SERIAL_ COMM   modbus_slave_setting  MODBUS_SLAVE_ SETTINGS   close _serial_com  CLOSE_SERIAL_ COMM                                      END_VAR          48    Chapter 3   Serial communications    Task code  if init_port then    baud    3   parity    0   data_length   8   stop bit    1   init_port   false   node_id    16 11   timeout   10   error   FALSE        close_serial_
12.    gt  ERROR  NETNUMBER     USINT       Input description    Description  Address of the node  1    127  for which the receipt of  Bootup messages must be tested    DEVICE USINT    ENABLE BOOL Input for enabling or locking the function block  NETNUMBER USINT  Network number  Output description    RM  BOOL    Output for signal service completion by the function block                      Error code corresponding to the data type     CIA405_CANOPEN_KERNEL_ERROR          The function block CAN_RECV_BOOTUP_DEV is used for reading the Bootup  messages of a specific node from the network layer s receiving buffer  If upon the  return of the function block the output CONFIRM is set to TRUE  a Bootup  message was received for the reported node  However  if the output CONFIRM is  set to FALSE  then the network layer s receiving buffer does not contain a Bootup  message for the node in question     After a Bootup message has been read it is erased from the receiving buffer and  therefore only reported to the PLC program once  The function blocks  CAN_RECV_BOOTUP_DEV and CAN_RECV_BOOTUP both access the same  receiving buffer    This function block is only available on control units in    PLC with CANopen  Master    mode     CAN_RECV_EMCY    Function block for reading emergency messages of a node from the network  layer   s receiving buffer     CAN_RECV_EMCY    CONFIRM   DEVICE   ERROR  EMCY_ERR_CODE  EMCY_ERR_REGISTER    ENABLE     gt   NETNUMBER     gt     EMCY_ERR_FIELD1  EMCY_ERR_FIEL
13.   CONNECTION       USINT USINT       gt  STATUS  USINT       gt  OPRS             Input description       Label Type Description Range       Connection whose status is to be  CONNECTION   USINT aE ed 0   9                   Output description       Label Type Description Range         No Operations  Communication   Memory value updated  Status USINT Status   Timeout expired      Agent error    Ok     Server not available    Timeout expired     Inactive connection    Protocol exception  10  No connection    Oprs USINT Execution Result                      This Function Block shows the communication status on a specified connection   As noted above  the system can initiate up to 10 connections at a time  Current FB  acquires a number from 0 to 9 as its input  which indicates the connection whose  status is to be questioned  Naturally  one of the possible status is    inactive con   nection     i e  no connection has been initiated in the requested position  Other  Function Blocks  described later  make it possible to trace the IP addresses and  connection port from the position  and vice versa        21    Sigmadue   Function Block Firmware Library    2 1 4    FB Prototype    Description    MB_TCP_GET_CONN_BY_ADDR  Function Block returning the position of a connection identified by the client IP  address  the client port and the server port     MB_TCP_GET_CONN_BY_ADDR    IP_ADDR    STRING USINT       gt  CONNECTION  CLIENT_PORT       UINT USINT       gt  OPRS  SERVER_PORT     g
14.   Oprs USINT Execution Result                   This FB sets the initialisation and configuration parameters of the Modbus TCP IP  Server agent  After execution of the Function Block  if successful  the agent is  operative and responds to any message it receives  The    SERVER_PORT     parameter tells the agent on which port to listen while waiting for the TCP IP  connections  The default setting is 502 for the Modbus TCP IP protocol  The agent  is always set to listen on the default port  With the    SERVER_PORT    parameter the  user can also choose a second port on which the agent is set to listen  The timeout  parameter indicates the agent the maximum interval between two consecutive  queries  If this interval is exceeded  the agent does not change its operation  but  simply flags the timeout expiry the next time the MB_TCP_CONN_STATUS  Function Block is called  To evaluate the timeout  the counter starts at the end of the  execution of current Function Block and is reset every time a new query is received     CLOSE _MODBUS_TCP_SERVER  Function Block disabling the Modbus TCP IP Server     CLOSE _MODBUS_TCP_SERVER             This function disables the Modbus TCP IP Server agent execution and makes the  resources newly available for a new initialisation or for the Modbus RTU Slave 2        20    2 1 3    FB Prototype    Description    Chapter 2   Modbus TCP IP    MB_TCP_CONN_STATUS  Function Block showing the status of a Modbus TCP IP connection     MB_TCP_CONN_STATUS     
15.   Sigmadue   Function Block Firmware Library    1 4 2  FB Prototype    Description    CTRL_MV    CTRL_MV    MV     gt   DTRK  gt   TRK     gt   DAM     gt   UP       DOWN  gt   AM_SL  gt   DAUX  gt   AUX  gt         OUT      DBMP       Input parameters  Label   Type Description    MV REAL Controlled variable  also named manipulated variable   It is gener   ated by the PID module with range  0 0     100 0   default value   0 0     DTRK   BOOL  Digital Tracking Command  default value   FALSE   TRK REAL   Tracking signal  0   100 0   default value   0 0   DAM BOOL   Digital AutoMan Command  default value   FALSE   UP BOOL   Manual Up Command  default value   FALSE   DOWN   BOOL  Manual Down Command  default value   FALSE   AM_SL   REAL   Manual Delta Value  default value   0 1    DAUX  BOOL  Digital Auxiliary Command  default value   FALSE   AUX REAL   Auxiliary Signal  0   100 0   default value   0 0                                         Output parameters   Label Type Description  OUT REAL Control Output  0 0     100 0   default value   0 0   DBMP BOOL BUMPLESS command  default value   FALSE                          This module is an Auto Man station  to be connected downstream a PID module   providing the functionalities the operator needs  to interact with the loop  The  CTRL_MV function block provides auto manual track aux operating mode  and the  commands for incrementally set the output  The operating modes are defined by a  set of digital inputs  as listed above  ordere
16.   the cool action called Relative Cool Gain   RCGA  The module provides auto   manual track aux operating mode  and the commands for incrementally set the    output        Sigmadue   Function Block Firmware Library    The operating modes  that are unique for both the Cool and the Heat output  are  defined by a set of digital inputs  as listed above  ordered according to their priority  level     Trk DTRK  AutoMan DAM  Aux DAUX    Depending on these digital inputs  the functionality of the module changes as  follows     e If none of these digital signals are active  the module split the input MV into  the two action MVH and MVC  The DBND parameter defines how the Cool  and the Heat channel interact each other  When it is positive  this parame   ter defines the dead band width  centered around the value 50 0 of the  input  It means that when the input is in the range  50 0     DBND    50 0    DBND  both the OUTC and the OUTH output are 0  When it is negative   the opposite occurs  for a value included in the dead band  both the OUTC  and the OUTH are different from 0     e lf DTRK  Track  is active  the outputs are set according to the value of the  analog input TRK  This signal has a range from  0 0     100 0  and it drives  both OUTH and OUTC  When its value is in the range 0 0 to 50 0  it means  that a Cool action must be taken  therefore  OUTH is set to 0  while OUTC  is set to  RCGA   2 0    50 0   TRK    Inversely  when it is in the range 50 0  to 100  OUTC is set to 0  w
17.  10   DBND  REAL  Qefaut value   00  I  RCGA REAL   Relative Cool Gain  default value   1 0   DTRK BOOL   Digital Tracking Command  default value   FALSE   TRK REAL   Tracking signal  0   100 0   default value   0 0   DAM BOOL   Digital AutoMan Command  default value   FALSE   UP BOOL   Manual Up Command  default value   FALSE   DOWN BOOL   Manual Down Command  default value   FALSE   AM_SL REAL  Manual Delta Value  default value   0 1   DAUX BOOL   Digital Auxiliary Command  default value   FALSE   AUX REAL   Auxiliary Signal  0   100 0   default value   0 0           Output parameters                         Label Type Description  OUTHEAT  REAL  Control Output for HEAT  0 0     100 0   default value   0 0   OUTCOOL   REAL   Control Output for COOL  0 0     100 0   default value   0 0   Control Output for visualization   100 0     100 0   QUIS MODE  default value   0 0   BMP_MV  REAL  BUMPLESS output value  default value   0 0   DBMP BOOL  BUMPLESS command  default value   FALSE   OVERLAP   BOOL Active if both OUTH and OUTC are active        default value   FALSE        This module is an Output station for an Heat Cool loop  providing the functionali   ties the operator needs to interact with the loop  The loop is controlled by one PID   connected downstream to this module  when the PID output value is between   50 0    0 0  the cool action is active  when the PID output value is between   50 0    100 0  the heat action is active  The function block applies also a factor to
18.  5 ASCII serial    The following Function Blocks have been created to swap ASCII strings on a  serial port via CPU without implementing a specific protocol     3 5 1 CONV_ASCII TO_CHAR  FB Prototype CONV_ASCII_TO_CHAR       ASCII  gt    BYTE STRING 1        gt  CHAR             Input parameters    Label  Type  ASCII BYTE Binary code of the input string character    Output parameters    Label   Type          Alphanumeric string character has to be converted in  abii STRINGO  the equivalent binary ASCII code    Description This FB can be used to convert a binary ASCII code in the equivalent  alphanumerical character     3 5 2   CONV_CHAR_TO_ ASCII  FB Prototype CONV_CHAR_TO_ASCII    CHAR     gt    STRING 1  BYTE    gt  ASCII    Input parameters    Type Description          Alphanumeric string character has to be converted in  CHAR STANGO  the equivalent binary ASCII code  Output parameters    Type Description  ASCII BYTE Binary code of the input string character    Description This FB can be used to convert any alphanumerical character in the equivalent  binary ASCII code           53    Sigmadue   Function Block Firmware Library    3 5 3 SERIAL IO CONFIG    FB Prototype SERIAL_IO_CONFIG  PORT       USINT USINT       gt  N_OF BYTE  SERVICE       USINT USINT    gt  OPRS    Input parameters    Description  Port on which the serial agent is initiated  Admissible values   USINT  uPAC  0  X0  or 1  X1    SigmaPAC  O  X1   1  X3  or 2  X4   USINT  Requested service             Output
19.  Firmware Library    Description    4 1 24    FB Prototype       Input for enabling or locking the function block  Data byte of the entry to be written   Data byte of the entry to be written  Data byte of the entry to be written  Data byte of the entry to be written  Data byte of the entry to be written  Data byte of the entry to be written  Data byte of the entry to be written  Data byte of the entry to be written  Length of the entry to be written  Network number                                      Description  Output for signal service completion by the function block  Error code corresponding to data type     CIA405_CANOPEN_KERNEL_ERROR     SDO abort code of the communication partner  FRMORINE 1 BWORD corresponding to the data type     lt CIA405_SDO_ERROR                   The function block CAN_SDO_READ8 is used to read the object entries of a node  currently being used by the SDO transfer  The SDO transfer is always executed in  the background  thus the procedure described in section 4 1 3 for synchronization  between the function block and the PLC program has to be applied while using both  parameters ENABLE and CONFIRM  The individual bytes of the object entry to be  written are transferred to the elements DATAO through DATA7  Whereby the input  DATALENGTH specifies the number of valid data bytes  beginning with DATAO      The network layer only supports a single SDO transfer through the PLC program  at anyone time  After the start of the SDO transfer by setting ENAB
20.  Write Single Coil  Data Write Multiple Coils             Access Physical Input Registers Read Input Register  16 bit Read Holding Registers          Internal Registers Or    access  Physical Output Registers    Write Single Register  Write Multiple Registers  Read Exception status  Diagnostics   The protocols support data area complies with the Modbus native memory model              Diagnostics                      MODBUS MODBUS  Memory Model PDU Access    Read Write Coil        PLC Memory     M Memory Direct  Access       Functions 1  5  15          Read Write Holding          1024 Digital In  128 Bytes g Functions 3  6  16  Read Input  8192 Bytes 4096 Registers Function 2                 Read Register       Input  Registers           Function 4                      33    Sigmadue   Function Block Firmware Library    This memory model  which is accessible via the Modbus Slave agent  is mapped  on a memory zone which can be accessed via the IEC61131 3 programming  environment as showed in the following table     Protocol Agent   Protocol Memory Areas PLC Memory Mapping   M1000 0 to  M1127 7  Holding Registers  MW1128 0 to  MW9318 0  Discrete Inputs  M1000 0 to  M1127 7  Input Registers  MW1128 0 to  MW9318 0  Status Register  MB9320 0    ModBus Slave  Channel  1              M10000 0 to  M10127 7  Holding Registers  MW10128 0 to  MW18318 0  Discrete Inputs  M10000 0 to  M10127 7  Input Registers  MW10128 0 to  MW18318 0  Status Register  MB18320 0    ModBus Slave  Channel  
21.  amount of bytes within the serial ASCII  agent  ONLY when the specified amount of bytes will be received they will be loaded  in the output BUFFER  If the amount of bytes differs from the requested quantity  the  FB will return an error  The values returned by the    OPRS    parameter are     Operation executed successfully   Port not configured for the ASCII serial protocol  Peripheral driver problems   Unavailable number of requested bytes in the input buffer    Number of bytes present in the input buffer less then requested                   55    Sigmadue   Function Block Firmware Library    3 5 5 SERIAL IO READ BYTE  FB Prototype SERIAL_IO_READ_BYTE    PORT       USINT ARRAY  1  100  of BYTE       gt  BUFFER  N_OF_BYTE       USINT USINT       gt  OPRS    Input parameters    Description  Port on which the serial agent is initiated  admissible values   uPAC  0  X0  or 1  X1      SigmaPAC  0  X1   1  X3  or 2  X4   Desired amount of bytes to read                Output parameters    Oupa yee f Description    BUFFER  ARRAY 1  100  of BYTE  String containing the requested bytes  OPRS USINT Operation status    Description This FB can be used to receive a desired amount of bytes within the serial ASCII  agent  ONLY when the specified amount of bytes will be received they will be loaded  in the output BUFFER  If the amount of bytes differs from the requested quantity  the  FB will return an error  The values returned by the    OPRS    parameter are     Operation executed success
22.  and cool regulation       CTRL_SPLITMV    Automan Station for heat and cool regulation with split range  algorithm                CTRL_SRV Servomotors algorithm  CTRL_SRV_POS   Servomotors algorithm close loop  positioner   CTRL_TPO Time proportional output       For further details  see the specific documentation of the individual module     1 3 PID implementation    The implementation of the PID algorithm is based on a standard PID  implementation in the latest generation Ascon instruments  with the  implementation of a Setpoint_Weighting scheme based on an evolved Overshoot  Control algorithm  Theoretical references on control theory are confined to  describing the structure of the system           Sigmadue   Function Block Firmware Library    The implemented PID algorithm is in its most complete  and complex  form and  the dynamic relationship binding the setpoint  the process value and the control  variable is the following     ib  UVa ey   i ST  1 sTi   N    where    U control variable   K gain   B overshoot control   Ysp setpoint   Y value   Ti integral time   Ta derivative time   E error  setpoint   value    N filter constant for numerical computation of derivative  The basic structure of the controller is illustrated below          Measure    The functional block has other auxiliary inputs used to add specific features   manual reset  bumpless command  integral stop action command  etc      The    overshoot control    algorithm implemented in the FB optimises the co
23.  and the CU 02 unit is able to provide functionalities for diagnostics  configuration  and cyclic data exchange  The protocol itself does not take care about the  meaning of the data exchanged  but it requires a configuration session where it is  defined the exchanged data size  Please check the specific Ascon spa  documentation for details about the GSD file and configuration description     5 1 PROFIBUS DP Slave Agent    Note     For the PROFIBUS communication a  M memory area of 976 byte is reserved for  the output data  from the CU 02 to the master PROFIBUS   These bytes are  spitted in 4 different pages of 244 byte  For the input data  from the master  PROFIBUS to the CU 02   the reserved memory size is 244 byte  The following  table gives the memory map dedicated to the PROFIBUS interface                       Profibus Agent Protocol Memory PLC Memory Mapping  Areas   Page 1 From  M20000 0 to  M20243 0     Page 2 From  M20244 0 to  M20487 0  Profibus slave output   Page 3 From  M20488 0 to  M20731 0   Page 4 From  M20732 0 to  M20975 0   Profibus slave input From  M21000 0 to  M21243 0          The data exchange between master and slave could be managed in three  different ways     The first is the basic mode  it consists to enable the local PROFIBUS agent and to  use only the page 1 to send data to the master  from  M20000 0 to  M20243 0    The user will fill this memory in order to send the correct data to the master     The second is the paged mode  in this case the 
24.  data exchange between the   variables it is available a set  of dedicated function blocks that allow the users to move entire data blocks from  one to another area     6 1 Copy Function Blocks    6 1 1 MEMCOPY_FROM_M  FB Prototype MEMCOPY_FROM_M    MEM_ADDR     gt   DATATYPE  gt     ERROR  ERR_CODE  TO_BYTE  TO_WORD  TO_DWORD       Input description  MEM_ADDR   UDINT    M memory location to be copied  num   0    43000    0 TO BYTE   Selection of the desired output data   1  TO WORD     type  num  2   TO DWORD       DATATYPE       Output description    Description  ERROR BOOL   Error status       16 00 00 00 00       ERR_CODE  DWORD    Error code  bit mask  16 FF FF FF FF       Value copied from the desired memory  TERE E location as 8 bit notation  num     Value copied from the desired memory  TO WORD   WORD location as 16 bit notation  num     Value copied from the desired memory  location as 32 bit notation  num           TO_DWORD   DWORD                Description This function block performs a copy of a value from a valid desired memory  location into a desired data type  The format selected as output data   types refers  to the basic bit mask notation of the data  It needs then to be converted into the  desired enumerated data   type  e g  if 8 bit to USINT or if 16 bit to INT or if 32 bit  to REAL  etc          88    Chapter 6   Real Time Clock    Default Values    Default Value    MEM_ADDR 22000  DATATYPE o    Reference Table    Output Description  ERR_CODE 0 Memory l
25.  erased along with the messages stored in the  network layer    The network layer supports access to PDOs and CAN Layer 2 messages via a call  of the function block CAN_PDO_READ8 generally only for registered messages                       CAN_SDO_READ8  Function block for reading a node   s object entries by way of an SDO transfer   CAN_SDO_READ8    CONFIRM  ERROR  ERRORINFO  DATAO   DATA1   DATA2  DATA3  DATA4  DATAS  DATA6  DATA7  DATALENGTH    COBID     gt   INDEX  gt   SUBINDEX     gt   ENABLE      NETNUMBER     gt     444444444444       Input description    Description    COBID of the message to be newly entered into  registration or to be erased from the registration    INDEX WORD  Number of the index entry to be read       COBID UINT                   75    Sigmadue   Function Block Firmware Library    Description    4 1 22    FB Prototype       SUBINDEX  BYTE  Number of the subindex entry to be read  ENABLE BOOL _  Input for enabling or locking the function block  NETNUMBER  USINT  Network number    Output description    Type Description    CONFIRM BOOL Output for signal service completion by the function  block   Error code corresponding to data type      CIA405_CANOPEN_KERNEL_ERROR      Reserved for additional error information   Data byte of the received CAN message   Data byte of the received CAN message    BYTE Data byte of the received CAN message    Data byte of the received CAN message  Data byte of the received CAN message  Data byte of the received CAN mess
26.  intervals of 10 seconds  and  if none of them receives a response  the connection is closed     The page shown in the following picture is displayed  if menu item 3 is selected     Ascon S p a     SigmaPAC Control Unit    Device configuration  MODBUS TCP SECURE ADDRRESSES TABLE MENU    0  Insert New Address    192 168 0 10  192 168 0 25  192 168 0 100    al  2  3  4  So  6   7  8  9   10    31     Enter Selection        This menu specifies the addresses which can access the Modbus TCP IP Server  agent when security functions are enabled  To enter a new address  select item 0  and then enter the address  which is entered in the first free position out of the 30  available  To delete an address  select the number which it is associated with     As described above  an address list called    priority connection pool    is also  available  which can be configured by selecting the menu item 4 in the    MODBUS  TCP IP SETUP MENU     The page shown in the following picture is thus displayed     The address entry process is the same as that described for the entry of the     security address pool    addresses     Ascon S p a   SigmaPAC Control Unit  Device configuration  MODBUS TCP PRIORITY ADDRESSES TABLE MENU  0  Insert New Address  192 168 0 12    192 168 0 75  192 168 0 123    ilo  2   So  4   5   Gr  Ta  8   Clo  10     Side    Enter Selection        The addresses in the    priority connection pool    are given priority by the system  as  explained above  up to 10 TCP connection
27.  is active  and DTRK is inactive   the current outputs are  not driven any longer according to the PID outputs  but they are changed  only from the UP and DOWN commands  When the DAM and one of the  two UP or DOWN commands are active  every cycle of the PLC the output  of the function block moves  up or down  by the AM_SL quantity    If DAUX  Aux  is active and both DAUX and DTRK are inactive   the out   puts are set according to the value of the analog input AUX  This signal has  a range from   100 0      100 0  and it drives both OUTH and OUTC  When  its value is in the range  100 to 0  it means that a Cool action must be  taken  therefore  OUTH is set to 0  while OUTC is set to the value of AUX   with the sign inverted  Inversely  when it is in the range 0 to 100  OUTC is  set to 0  while OUTH is set to AUX  These values are valid if the DBND of  the phase splitter is set to 0  otherwise they slightly change        1 4 4  FB Prototype    Description    CTRL_SPLITMV    MV  gt   DBND     gt   RCGA     gt   DTRK  gt    TRK     gt    DAM       UP   gt   DOWN     gt   AM_SL  gt   DAUX  gt    AUX  gt     Input parameters    Chapter 1   AsconCTRLFb Embedded    CTRL_SPLITMV    OUTHEAT  OUTCOOL  OUTHC  BMP_MV  DBMP  OVERLAP    444444                                              Label Type Description  Controlled variable  also named manipulated variable   It is  MV REAL  generated by the PID module with range  0 0     100 0    default value   0 0   D nd  with range from   10 0     
28.  is intended to describe structure and use of the Function  Blocks implemented in the CPU firmware devoted to manage all the built in  functionalities of the CU 02 and MP 01 device  Thanks to these Function Blocks   using OpenPCS IEC61131 3 programming tool  is possible to access all the  peripheral  and to manage all the basic control present in the device     Caution  The function blocks of the various libraries are valid for both CU 02 and MP 01  units except when it is expressly indicated     Current Documentation on the Internet    Make sure you are always working with the latest version of this document   ASCON spa reserves the right to make changes to its products in the name of    technological advancement  New manual revisions  when published  and can be  found online at     http   www ascon it          viii    1 1 Purpose    Chapter 1  AsconCTRLFb Embedded    The purpose of this document is to describe the control Function Blocks available  in the Ascon spa control units     1 2 Description    The Function Blocks described below represent the totality of basic control  functions made available by Ascon devices in terms of functions required in  process control applications  All FBs are embedded  i e  they do not belong to any  specific IEC61131 library  but they are always present in the device firmware  The  following is the list of present FBs           CTRL_PID PID algorithm  CTRL_MV Automan Station for single action regulation  CTRL_HCMV Automan Station for heat
29.  parameters    N_OF_BYTE   USINT  Number of bytes related to the requested service  OPRS USINT  Service status    Description This FB can be used to request some functions to the serial ASCII agent  The input  parameter    SERVICE    the type of function desired  The available functions are           Number of bytes present in the input buffer  Send immediately all the bytes present in the output buffer and leave it empty    Reset immediately all the output buffer bytes  Reset immediately all the input buffer bytes                   The FB will returns the status of the operated service on the output    OPRS     parameter  The returned values are     Value Description    0 Function executed successfully  Port not configured for the ASCII serial protocol       Peripheral driver problems  Unavailable number of requested bytes in the input buffer  Number of bytes present in the input buffer less then requested                   54    Chapter 3   Serial communications    3 5 4 SERIAL IO READ    FB Prototype SERIAL_IO_READ  PORT     gt    USINT STRING 100        gt  BUFFER  N_OF_BYTE     USINT USINT    gt  OPRS    Input parameters    Description  Port on which the serial agent is initiated  admissible values   uPAC  0  X0  or 1  X1    SigmaPAC  0  X1   1  X3  or 2  X4   Desired amount of bytes to read                Output parameters  BUFFER STRING 100   String containing the requested bytes  OPRS USINT Operation status          Description This FB can be used to receive a desired
30.  retrieve information about the type of diagnostic active on a given  network node    GET_SUPPORTED_DIAG    EN       BOOL BOOL       gt  ENO  NODE_ID     gt    USINT USINT       gt  SUPPORTED_DIAG       Input description    EN  BOOL Enable In TRUE FALSE  NODE_ID  USINT  Networknods  TRUETFALSE    Output description    BOOL  Enable Out TRUE FALSE  SUPPORTED DIAG USINT Diagnostic Information Form             The node diagnostic data assigns individual bits with the following meaning     The form is available on the network 0x20  The module supports the Heartbeat 0x01    The module supports the Node Guarding             81    Sigmadue   Function Block Firmware Library    4 1 28 NET_ASCON_ID    This function block  starting from the scan performed by the master  provides  information about the connected modules  about their diagnostic type  as they  were recorded by the master and their identity  The function block is non blocking  and follows the calling rules of the CAN communication FBs     FB Prototype NET_ASCON_ ID  EN     gt  BOOL ENO  ENABLE     gt  BOOL CONFIRM  ARRAY OF DWORD DEVICE_TYPE  ARRAY OF DWORD DEVICE_NAME    ARRAY OF USINT  WORD  DWORD    NODE_DIAGNOSTICS  ERROR  ERROR_INFO    4444444       Input description    Range    BOOL  Enable In co  ENABLE  BOOL  Enabling the function of block TRUE FALSE    Output description          Description    ENO BOOL Enable Out       CONFIRM BOOL Result of the of module comparison    ARRAY OF  DEVICE_TYPE DWORD    ARRAY OF  DWORD
31.  to the CAN_SEND_SYNC function block              66    Chapter 4   CanOPEN    4 1 11 CAN_GET_CANOPEN_KERNEL_STATE  Function block for state query of the CANopen kernel of the local PLC        FB Prototype CAN_GET_CANOPEN_KERNEL_STATE  ENABLE     gt    BOOL BOOL       gt  CONFIRM  NETNUMBER         USINT WORD       gt  STATE             Input description    ENABLE BOOL  Input for enabling or locking the function block  NETNUMBER  USINT    Output description    Description   CONFIRM  BOOL  Output for signal service completion by the function block  State or error code corresponding to the data type     CIA405_CANOPEN_KERNEL_ERROR       Description The function block CAN_GET_CANOPEN_KERNEL STATE is used for a query  about the state of the CANopen kernel of the local PLC     4 1 12 CAN_GET_LOCAL_NODE ID  Function block for a local node address query                 FB Prototype CAN_GET_LOCAL_NODE ID  ENABLE     gt    BOOL BOOL       gt  CONFIRM  NETNUMBER     gt    USINT USINT       gt  DEVICE             Input description    Label Type Description    ENABLE BOOL Input for enabling or locking the function block  NETNUMBER  USINT Network number    Output description       Description  Output for signal service completion by the    function block  Local Node Address of the PLC                Description The function block CAN_GET_LOCAL_NODE_ID is used for a query of the local  node address of the PLC  The node address of a control unit has an influence  over the availability of th
32. 10144 0   MW10146 0                      N                       CO  NI DID          2048  MW1 4224 0     MW1 4226 0   MW1 4228 0   MW1 4230 0   MW1 4232 0                 MW1 8304 0   MW1 8306 0   MW1 8308 0   MW18310 0   MW18312 0   MW18314 0   MW18316 0   MW18318 0                         Once the Modbus port has been configured  the slave agent runs in the  background and automatically updates the above indicated memory areas   However  a function block is also available to check the status of the slave agent   MODBUS_SLAVE_STATUS        36    Chapter 3   Serial communications    3 2 1 MODBUS_SLAVE SETTINGS  Function Block setting and activating the Modbus slave agent     FB Prototype MODBUS_SLAVE_SETTINGS    CHANNEL       USINT USINT       gt  OPRS  NODE_ID       USINT  TIMEOUT       UINT       Input description             Label Type Description Range  Channel   USINT Agent in question  Slave 1 or Slave2  1 2  Node_id   USINT Node_ld of Modbus node on bus 1   247   Timeout  UINT  Timeout in units of 100ms               0  65535                        Note    if timeout   0 the timeout computation function is disabled  Output description    Description Range  0  Ok        Execution Result   1  Port not available   2  Invalid Node_id       Description This FB sets the node_id and timeout parameters of the Modbus slave agent   After execution of the function block  if successful  the Modbus Slave agent is  already operative and responds to any message it receives  The time
33. 2                      The following tables show the correspondence between the modbus addresses of  the registers and bits accessible via the IEC61131 3 protocol and the syntax used  to access the same memory areas     COILS Slave 1    MODBUS Address IEC61131 3 SYNTAX     MX1000 0   MX1000 1   MX1000 2   MX1000 3   MX1000 4   MX1000 5   MX1000 6   MX1000 7   MX1001 0   MX1001 1                             MX1127 1   MX1127 2   MX1127 3   MX1127 4   MX1127 5   MX1127 6    1023  MX1127 7                         34    Chapter 3   Serial communications    COILS Slave 2    MODBUS Address IEC61131 3 SYNTAX     MX10000 0   MX10000  1   MX10000 2   MX10000 3   MX10000 4   MX10000 5   MX10000 6   MX10000 7   MX10001 0   MX10001 1                              2  3  4  5  6  7  8  9     MX10127 1   MX10127 2   MX10127 3   MX10127 4   MX10127 5   MX10127 6   MX10127 7                         REGISTERS Slave 1    MODBUS Address 1IEC61131 3 SYNTAX   MW1128 0   MW 1130 0   MW1132 0   MW1134 0   MW1136 0   MW1138 0   MW1140 0   MW1142 0   MW1144 0   MW1146 0                                MW5224 0   MW5226 0   MW5228 0   MW5230 0   MW5232 0                 MW9304 0   MW9306 0   MW9308 0   MW9310 0  4092  MW9312 0                         35    Sigmadue   Function Block Firmware Library       4093  MW9314 0   MW9316 0   MW9318 0    REGISTERS REGISTER Slave 2    MODBUS Address 1EC61131 3 SYNTAX   MW10128 0   MW10130 0   MW10132 0   MW10134 0   MW10136 0   MW10138 0   MW10140 0   MW10142 0   MW
34. 8       Index  continued     Chapter 3  Serial communications                       1  s16s11   3 1 Serial communication configuration     3 1 1 OPEN_SERIAL COMM                   anaana na  3 1 2 CLOSE_SERIAL COMM             eee eeee  3 2 Modbus Slave protocol     3 2 1 MODBUS_SLAVE_SETTINGS                 3 2 2 MODBUS_SLAVE_STATUS               anann  3 3 Data access function for Modbus slaves                          3 3 1 MODBUS_GET_SLAVE_DATA               0000000 ee  3 3 2 MODBUS_SET_WORD_DATA              00  3 3 3 MODBUS_SET_DWORD_DATA               000000   3 3 4 MODBUS_GET_DIGITAL_SLAVE                       3 3 5 MODBUS_SET_DIGITAL_SLAVE                       3 4 Master modbus protocol     3 4 1 MODBUS_MASTER_EXECUTE                    0    3 4 2 MODBUS_MASTER_STATUS                0  000005  3 4 3 Application example of the modbus communication port      3 4 4 Global application variables           0    0000s  3 4 5 HW port initialisation LL   3 4 6 MASTER COGS ons  Sete cl Ri brah Oe dean ge  3 4 7 Slave Code Lich bale pelli Sh wedbhead ows Deeke iy Qo i  3 5   ASCItsSerah sessista Sa fans eee te See wales ue MO una ee o s  3 5 1 GONV ASCII TO CHAR dirtelo  3 5 2 CONV_CHAR_TO_ASCIH LL     3 5 3 SERIALAOGCONE G al eh toes Peet iui e a a  3 5 4 SERIAL WO READ  collera ele aan  3 5 5 SERIAL  IO  READ amp ABNTE  ieri  3 5 6 SERIAL NO  WRITE    alle ale ala TRE  3 5 7 SERIAL IO  WRITE  BYTE  cola aa a       Chapter 4  CanOPEN  for CU 02 unit only                    
35. BUS_MASTER_STATUS to monitor the progress status of the queries        45    Sigmadue   Function Block Firmware Library    3 4 1    FB Prototype    Note     Description       MODBUS_MASTER_EXECUTE  Function Block executing a query in compliance with the modbus protocol     MODBUS_MASTER_EXECUTE    SLAVE_ID  gt      OPRS  FUNCT  gt    ADDR  gt   N_OF_ELEMENTS  gt   TIMEOUT  gt    REST  gt        Input description    Description  Slave_id Slave address to which the query is sent  Funct Query function    Addr Register and slave bit addresses being  worked with    N_of_elements Number of registers or bits being queried  Tiemout Timeout in units of 100 ms  0   65535  Blocks current query                           if timeout   0 the timeout computation function is disabled    Output description    0  Ok   Function Block Execution   1  port not available   Oprs USINT 2  agent busy   4  invalid address or function    This function block starts the query response process characteristic of modbus  communication  The function block defines the addressee of the query  the function  to be executed  the address and the number of registers or bits to be queried  This  Function Block assumes that the data to be sent reside in the output data memory  area  while the input memory area contains the requested data  The modbus master  agent checks the time from the moment the query is initiated and compares it to the  timeout set at the time the Function Block is called  The query and response pr
36. CIA Draft Standard 405     CANopen Interface and Device Profile for  IEC61131 3 Programmable Devices        version 2 0      CANopen Application Layer and Communication Profile   CIA DS301 v 4 02        Modbus Messaging on TCP IP implementation guide        http    www Modbus IDA org     10     MODBUS over Serial Line Specification  amp  Implementation guide         http  Awww Modbus  DA org        11     MODBUS APPLICATION PROTOCOL SPECIFICATION         http  Awww Modbus  DA org        12     CU 02 Installation manual  code  J30   658   1ACU02 E     13     CU 02 User manual     code  J30   478   1ACUO2 E      14     MP 01 Installation manual     code  J30   658   1AMP01 E     15    MP 01 User manual  code  J30   478   1AMP01 E      16     microPAC I O modules Installation Manuals        17     microPAC I O modules User Manuals           105    
37. D2  EMCY_ERR_FIELD3  EMCY_ERR_FIELD4  EMCY_ERR_FIELD5    444444444       Input description    Description    ENABLE BOOL Input for enabling or locking the function block  NETNUMBER  USINT          72    Description    4 1 19    FB Prototype       Chapter 4   CanOPEN    Output description    Deron    I for signal service completion by the  CONFIRM BOOL function block    DEVICE Address of the node  1 127  from which an  emergency ee was ci    ERROR Error code corresponding to the data type   CIA405_CANOPEN_KERNEL_ERROR     Emergency error information corresponding  EMCV ERA CODE to the CiA Draft Standard 301             Emergency error information corresponding  to the CiA Draft Standard 301       Emergency error information corresponding  to the CiA Draft Standard 301    Emergency error information corresponding  EMG Y ERA PIELDE to the CiA Draft Standard 301    Emergency error information corresponding  EMOYCERRCRELDS to the CiA Draft Standard 301    Emergency error information corresponding  BMGT   BR FIERDA to the CiA Draft Standard 301    Emergency error information corresponding  EMG Y ERA FIELDS to the CiA Draft Standard 301    The function block CAN_RECV_EMCY is used for reading the emergency  messages of any nodes from the network layers receiving buffer  If upon the return  of the function block the output CONFIRM is set to TRUE  the output DEVICE  reports the node address from which the message was received  The elements  EMCY_ERR contain the emergency error informat
38. E Close   FALSE  2 Open   FALSE Close   TRUE  ERR_BAND    Outside band of the MV range  0 0   100 0   where to evaluate the error conditions   ERR_CODE  Bits mask associated to the ERR_CODE value              ERR_CODE bit Control Output Status  Bit 4 Validation of input POT value  LOW_POT and HIGH_POT   exceeded OFR_LIM value  Bit 2 MV out of range  Bit 3 Timeout to reach the target value  in according to travel time  and actual position              Sigmadue   Function Block Firmware Library    1 4 7    FB Prototype    Description    Note                          CTRL_TPO  CTRL_TPO  MV     gt  REAL BOOL       gt  DOUT  TCYCLE     gt  REAL BOOL       gt  ALARM  TMIN  gt  REAL  Input parameters  Label Type Description  MV REAL Required duty cycle  0 0     100 0   default value   0 0   TCYCLE REAL Cycle time in seconds  default value   20 0   TMIN REAL Minimum time is seconds  default value   0 0   Output parameters  Label Type Description  DOUT BOOL Time proportional output  default value   FALSE              ALARM BOOL Alarm flag  default value   FALSE        This module creates a time proportional output requiring as inputs the duty cycle  value  MV   and the period of the signal  TCYCLE   The TMIN input specifies the  minimum pulse length that can be generated by the function block  If the required  duty cycle sets a pulse length less then TMIN  the function block generates a  pulse of TMIN  and it modifies the period of the signal in order to maintain the duty  cycle passe
39. FALSE after completion of the data transfer    The call of the function block with DEVICE   0 leads to an access of the local  Object Dictionary on the PLC  Thus values from the local Object Dictionary can be  written as well     CAN_SEND_SYNC  Function block for sending an individual SYNC message   CAN_SEND_SYNC    BOOL BOOL  USINT WORD    WORD       ERRORINFO DWORD                    CONFIRM      ERROR    ENABLE     gt   NETNUMBER     gt              Input description   Description   ENABLE BOOL  Input for enabling or locking the function block  NETNUMBER  USINT  Network number             79    Sigmadue   Function Block Firmware Library    Description    4 1 26    FB Prototype    Output description          Description    Output for signal service completion by the function  block    Error code corresponding to the data type     CIA405_CANOPEN_KERNEL_ERROR          The function block CAN_SEND_SYNC is used to generate individual SYNC   messages under complete control of the PLC program  With every component call  where the input ENABLE is set to TRUE  a SYNC message is sent  Through this  targeted influence it is possible to generate SYNC messages only if really relevant    data has been altered     This function block is only available on control units in    PLC with CANopen Master     mode and can only be used as alternative to the CAN_ENABLE_CYCLIC_SYNC    function block     CAN_WRITE_EMCY    Function block for sending application specific Emergency Messages throught the
40. H of  the Object Dictionary  Error Field  see CiA Draft  Standard 301   is not part of the Emergency   Message  thus it is only used for diagnostic pur   poses and can be set to zero    EMCY_ADD_INFO WORD             Output description    Output for signal service completion by the function block    Error code corresponding to the data type   CIA405_CANOPEN_KERNEL_ERROR           The function block CAN_WRITE_EMCY is used for sending application specific  Emergency Messages throught the network layer    The EMCY_ERR members have to be filled with emergency error information  according to the IEC61131 3 standard  The emergency message to send is gener   ated from these members  The contents EMCY_ADD_INFO input can be defined by  the application  This element is only stored in index 1003H of the Object Dictionary   Error Field  see CiA Draft Standard 301   It is not part of the Emergency  Message   thus it is only used for diagnostic purposes and can be set to zero  The index 1003H  of the Object Dictionary can be read out by configuration and diagnostic tools   When the function block CAN_WRITE_EMCY is called  the message to be sent  gets stored in the send buffer of the CANopen kernel  If no error occurs here   message could be written to the buffer correctly   then the component returns  with the output CONFIRM set to TRUE     However  no return message is given to the PLC program showing whether or not  the message could be sent successfully   GET_SUPPORTED_DIAG  This FB can
41. INT Desired amount of bytes to write  ARRAY  1    100   of BYTE          Array of bytes which contain the bytes to be sent          Output parameters    OPRS___JUSINT    Description This FB can be used to send a desired amount of bytes within the serial ASCII  agent  The values returned by the    OPRS    sila are     Operation executed successfully  Port not configured for the ASCII serial protocol  Attempt to write a number of bytes that exceeds the allowed limit                58    Chapter 4    CanOPEN  for CU 02 unit only                                         4 1 Canopen FBs  4 1 1 CANOPEN_AUTOLEARN  It performs the network scan and stores the main important parameters of the  connected I O modules   FB Prototype CANOPEN_AUTOLEARN  EN     BOOL       gt  ENO  ACQUIRE     gt  ARRAY OF DWORD       gt  SAVED_DEVICE  ARRAY OF DWORD       gt  DEVICE_TYPE  ARRAY OF DWORD       gt  DEVICE_NAME  ARRAY OF DWORD       gt  VENDOR_ID  ARRAY OF DWORD       gt  PRODUCT  ARRAY OF DWORD       gt  CODE  DWORD       gt  OPRS  Input description   Range  BOOL   Enable In Pee      SCARE BOOL  Start the command execution TRUE FALSE  Output description  Type   Description  ENO BOOL Enable Out TRUE FALSE  Array of the  SAVED_DEVICE present addresses TRUE FALSE  Read device types  DEVICE_TYPE array  Device names  DEVICE_NAME array  VENDOR_ID Vendor IDs array  Product codes  PRODUCT CODE array  0 Operation successful  OPRS OPeration result  1 Memory management problems  2 Network problems  Descri
42. LE to TRUE   this SDO channel is locked  preventing use by other components  The lock state is  maintained until the SDO function block is called again by setting the ENABLE  input to FALSE after completion of the data transfer     A function block call with DEVICE   0 leads to access of the local Object Dictionary  of the PLC  Thus values can be written to the local Object Dictionary as well     CAN_SDO_WRITE_STR  FB for writing strings to the Object Dictionary of a node via SDO transfer   CAN_SDO_WRITE_STR    DEVICE       USINT BOOL       gt  CONFIRM  INDEX       WORD WORD       ERROR  SUBINDEX     gt    BYTE DWORD       gt  ERRORINFO   SDOTYPE       USINT STRING       gt  TXDATA    ENABLE       BOOL  TXDATA       STRING  TXLENGTH     gt    INT  NETNUMBER       USINT       Input description    Description  Address of the node to be read  INDEX WORD  Number of the index entry to be written to  SUBINDEX  BYTE Number of the subindex entry to be written to    Type of the SDO transfer mode to be used  OOS No corresponding to the data type    CAN_SDO_TYPE       ENABLE BOOL  Input for enabling or locking the function block                            78    Description    4 1 25    FB Prototype       Chapter 4   CanOPEN       TXDATA STRING String variables for storing the characters to be written    Limit to the number of characters to be written  with 0 the  length of the characters contained in the string TXDATA  calculated internally  corresponds to LEN TXDATA      and used as th
43. ND_VAR    VAR  sequence USINT    1           51    Sigmadue   Function Block Firmware Library          at  MW1128 0 word   at  MW1130 0 word   at  MW1132 0 word   at  MWN1134 0 word   at  MW1136 0 word   END_VAR   Task code    if init_port   false then  if error   false then  if next_step   true then       case sequence of                         T  sequence_write 1     16 0102   sequence_write 2     16 0304   sequence_write 3     16 0506   sequence_write 4     16 0708   sequence_write 5     16 090A    2  sequence_write 1     16 0304   sequence_write 2     16 0506   sequence_write 3     16 0708   sequence_write 4     16 090A   sequence_write 5     16 0102    33 sequence_write 1     16 0506   sequence_write 2     16 0708   sequence_write 3     16 090A   sequence_write 4     16 0102   sequence_write 5     16 0304    4  sequence_write 1     16 0708   sequence_write 2     16 090A   sequence_write 3     16 0102   sequence_write 4     16 0304   sequence_write 5     16 0506    bi  sequence_write 1     16 090A   sequence_write 2     16 0102   sequence_write 3     16 0304   sequence_write 4     16 0506   sequence_write 5     16 0708    end_case    MW1128 0    sequence_write 1     MW1130 0    sequence_write 2     MW1132 0    sequence_write 3     MW1134 0    sequence_write 4     MW1138 0    sequence_write 5    if sequence   5 then   sequence    1   else   sequence    sequence   1   end_if   next_step    false   end_if   end_if   end_if        52    Chapter 3   Serial communications    3
44. NT   conn  USINT   client_port  UINT    1500   server_port  UINT    503   connection  USINT   0   ip_addr  STRING 16      192 168 5 1    connected  BOOL   con_from_addr  BOOL    false   conn_from_addr  MB_TCP_GET_CONN_BY_ADDR   con_config  BOOL    false   conn_config  MB_TCP_GET_CONN_CONFIG   con_status  BOOL    false   connection_stat  MB_TCP_CONN_STATUS   close_con  BOOL    false   close_conn  MB_TCP_CLOSE_CONN   at  MW10128 0  UINT   at  MW10130 0  UINT   at  MW10132 0  UINT   at  MW10134 0  UINT     END_VAR          28    Task code    if init_port_mb_tcp    if error_mb_tcp      false then  false then           MW10128 0     MW10128 0   1   MW10130 0     MW10130 0   2   MW10132 0     MW10132 0   3  SMW10134 0     MW10134 0   4    if con from addr   true then  conn_from_addr      Chapter 2   Modbus TCP IP                                                          IP_ADDR    ip_addr   CLIENT_PORT    client_port   SERVER_PORT    server_port  conn    CONNECTION   oprs    OPRS    con_from_addr    false   end_if   if con_config   true then  conn_config   CONNECTION    connection  connected    CONNECTED   client_port    CLIENT_PORT   server_port    SERVER_PORT   ip_addr    IP_ADDR   oprs    OPRS    con_config    false   end_if   if con_status   true then  connection_stat    CONNECTION    connection  status    STATUS   oprs    OPRS    con_status    false   end_if   if close_con   true then  close_conn    CONNECTION    connection  oprs    OPRS    close_con    false   end_if   end_if 
45. R   status   USINT   datarec   USINT   excode   USINT   timeout_err  UDINT     err_err   UDINT    0   mb_exec_busy_err  UI    mb_exec_no_port  UDINT    0  mb_exec_func_err  U    counter_ok  UDINT  counter_ko  UDINT                                     modbus_master_exec  MODBUS_MASTER_EXECUTE   modbus_master_statuss  MODBUS_MASTER_STATUS                    oprs  USINT              at  IW1000 0 word    at  IW1002 0 word    at  IW1004 0 word    at  IW1006 0 word    at  IW1008 0 word   END_VAR   Task code   if init_port   false then  if error   false then   if next_step   false then    modbus_master_statuss      datarec   DATAREC   excode   EXCODE                                         status    STATUS   oprs    OPRS     case status of   0     next activity associated to the master    modbus_master_exec     SLAVE_ID    node_id   FUNCT sad   ADDR La E  N_OF_ELEMENTS   55  TIMEOUT   Os   REST   FALSE     oprs    OPRS      case oprs of       50    3 4 7    Chapter 3   Serial communications    1  mb_exec_no_ port    mb_exec_no_ port   1   2  mb_exec_busy_err mb_exec_busy_err   1   4  mb_exec_func_err mb_exec_func_err   1     end_case   1     the master is processing the last function required     2     the master has ended the last activity required      sequence_read 1       IW1000 0    sequence_read 2       IW1002 0    sequence_read 3      IW1004 0    sequence_read 4      IW1006 0    sequence_read 5      IW1008 0        if sequence_read 1   lt  gt  sequence_write 1  then  counter_
46. TO_M  MEMCPY_I_TO_M  MEMCPY_M_TO_M  MEMCPY_M_TO_Q  MEMCPY_Q_TO_M    EAT E cia       Index  continued     Chapter 7  Real Time Clock Licciana 95  7 1 Description of the individual Function Blocks                      95  7 1 1 ALC GET VALUES ul E alkaline bd eats 95  7 1 2 BiG SETUP is oooh  Se hinken tite red bb pote 96  Chapter 8  Watchdog swine eee ee eee ee eee eee 97  8 1 Description of the individual Function Blocks                      97  8 1 1 WATCHDOG  SET i ln ina 97  8 1 2 WATCHDOG  STATUS great dna 99  Chapter 9  Random number generators                             100  9 1 Description of the individual Function Blocks                      100  9 1 1 BANDI Serio rin a BS 100  Chapter 10  Type conversion  FLATTEN IEEE     REAL and vice versa     101  10 1 Description of the individual Function Blocks                      101  10 1 1 ASCON  FLATTEN  TO UREAL si epr iaia 101  10 1 2 ASCON_REAL_TO_FLATTEN                102  Chapter 11  Counter Block  for MP 01 unit only                        103  11 1  RESET PULSE COUNTER v4 perire a oi ae ke eta 103  Chapter 12  TC_Calibrate  for MP 01 unit only                         104  Appendix A  Reference documents                       1rsr1rs11 105       vi    Introduction    Preface    The products described in this manual should be installed  operated and  maintained only by qualified application programmers and software engineers  who are almost familiar with EN 61131 3 concepts of PLC programming   automation safety to
47. The watchdog is a decreasing counter which is decremented  every 100ms  When the counter reaches zero  the system could respond in two  different modes  store the event and open a dedicated digital output  or perform a  system reset  Please note that even the watchdog mechanism is controlled by the  function blocks  its operation is independent from the PLC running program    This means that during the debug of an application a PLC stop command does not  stop the watchdog counter  which will terminate according to the programmed mode     8 1 Description of the individual Function Blocks    8 1 1  FB Prototype    Description    WATCHDOG_SET  WATCHDOG_SET    WD_ENABLE       BOOL  WD_TIMER_VALUE     gt    UINT  WD_TIMEOUT_MODE     gt    USINT       Input description                            Label Type Description Range  Enable Disable the Watchdog  WD_ENABLE BOOL operations True False  WD_TIMER_VALUE  UINT Sets the timer countdown value 0    65535   100 ms   Sets the watchdog operation  WD_TIMEOUT_MODE  USINT mode  num  0    1       This function block can be used to setup the watchdog control available within the  sigmadue CPU models  When the function is activated by using it  the designed  digital output  if enabled  is forced to 1  closed   The specified countdown time  value is calculated and reset at every cycle of the application before it reaches 0   zero   for this reason the FB should not be used in a timer task and the timer value  should be evaluated accordingly th
48. U    Network Setup    Cpu Setup    Modbus TCP IP Setup    Cpu info      Exit  Enter Selection        The menu shown in the following picture is displayed  if item 3 is selected     Ascon S p a     SigmaPAC Control Unit    Device configuration  MODBUS TCP IP SETUP    Messages per cycle  10    Broken connection timeout s   10      Secure Address Setup      Priority Address Setup      Exit  Enter Selection        Item 1 specifies the number of messages processed per cycle  The value entered  must be within the range of 1 to 50     Item 2 specifies the connection idle timeout  The value entered must be within the  range of 10s to 5400s  The connection probe in case of long communication idle  time complies with the    keep alive    protocol provided by TCP IP specifications   This process performs the following operation sequence     1  The system resets an internal idle timeout when it receives a new message     2  If the internal idle timeout reaches the value set in point 2  the system  sends a so called    probe    message which checks whether the connection  is still active     3  If the probe message receives a response  the connection is active and  the idle timeout is reset     4  If the probe message does not receive a response within 10 seconds  the  system sends a new  probe  message     5  If the probe message receives a response  the idle timeout is reset        25    Sigmadue   Function Block Firmware Library    2 1 8    6  The system sends up to 4 probe messages at
49. US ADDRESS IEC61131 3 SYNTAX   MW10128 0   MW10130 0   MW10132 0   MW10134 0                 MW10138 0   MW10140 0   MW10142 0   MW10144 0                0  1  2  3  4  MW10136 0  5  6  7  8          18    Chapter 2   Modbus TCP IP       9  MW10146 0        MW14224 0   MW14226 0   MW14228 0   MW14230 0              MW14232 0           MW18304 0   MW18306 0   MW18308 0   MW18310 0   MW18312 0   MW18314 0   MW18316 0   MW18318 0                         Once the Server agent has been configured  it runs in the background and  automatically updates the above indicated memory areas  A function block is also  available to check the status of each separate TCP IP connection   MB_TCP_CONN_STATUS        Sigmadue   Function Block Firmware Library    2 1 1    FB Prototype    Note     Description    2 1 2    FB Prototype    ENABLE MODBUS_TCP_SERVER  Function Block setting and activating the Modbus TCP IP Server agent     ENABLE _MODBUS_TCP_SERVER    SERVER_PORT     gt    UINT USINT       gt  OPRS  USE_SECURITY       BOOL   gt   TIMEOUT       UINT       Input description                Label Type Description Range  SERVER_PORT   UINT Port on which the server listens  USE_SECURITY   BOOL Use of security functions TRUE FALSE  TIMEOUT UINT Timeout in units of 100 ms  0  65535                  if timeout   0 the timeout computation function is disabled  Output description       Label Type Description Range   0  Ok   1  Server not available   2  Resources not available  4  TCP IP Problems     
50. _ERROR     Emergency error information corresponding  EMEY ERR GODE to the CiA Draft Standard 301  Emergency error information corresponding  to the CiA Draft Standard 301  Emergency error information corresponding  EMOTY ERR PELDI to the CiA Draft Standard 301       EMCY_ERR_REGISTER       Emergency error information corresponding  ENEI ERR EBEDE to the CiA Draft Standard 301       Emergency error information corresponding  EMGY ERR EIEN to the CiA Draft Standard 301    Emergency error information corresponding  EMEYNSERRSFIELD4 to the CiA Draft Standard 301    Emergency error information corresponding  EMC ERR EIEED  to the CiA Draft Standard 301    The function block CAN_RECV_EMCY_DEV is used to read the emergency  messages of a specific node from the network layer s receiving buffer  If upon  return of the function block the output CONFIRM is set to TRUE  the elements  EMCY_ERR maintain the emergency error information of the node corresponding  to the CiA Draft Standard 301  If however the output CONFIRM is set to FALSE   then the receiving buffer of the network layer does not contain any emergency  messages for the node in question     The function block always returns the first emergency message entered into the  receiving buffer    oldest message   the message is subsequently erased from the  receiving buffer  Thus every mergency message can only be read one time by the  PLC program  The function blocks CAN_RECV_EMCY_DEV and  CAN_RECV_EMCY both access the same receivin
51. abling or locking the function block  NETNUMBER  USINT  Network number    SYNC_MODE    SYNC_TIME  TIME                   Output description    Output for signal service completion by the function block    Error code corresponding to the data type     CIA405_CANOPEN_KERNEL_ERROR       The function block CAN_ENABLE_SYNC is used to enable or lock the generation  of cyclical SYNC messages through the PLC  When enabled the control unit  generates a SYNC message between two sequential PLC cycles  if the time  elapsed between the last SYNC message and the new one is longer than the time  specified at the SYNC_TIME input  If the time elapsed since the last SYNC is less  than the SYNC_TIME  then no new SYNC message is generated     The input value SYNC_TIME   0 causes the control unit to conclude each PLC  cycle with a SYNC message  In this case the network process image exchange  occurs in synchronization with the process image exchange for the local inputs  and outputs of the PLC    At the end of the PLC cycle the control unit always tests the time requirements for send   ing a SYNC message  The time given at the input SYNC_TIME is therefore the mini   mum time between two sequential SYNC messages  The real time interval between two  SYNC messages can therefore vary in a worst case by the length of an PLC cycle   Tsync  worst case    SYNC_TIME   TPLC Zyklus   This function block is only available on control units in  PLC with CANopen Master   mode and can only be used as alternative
52. age  Data byte of the received CAN message    BYTE Data byte of the received CAN message    The function block CAN_SDO_READ8 is used to read the object entries of a node  currently being used by the SDO transfer  The SDO transfer is always executed in  the background for synchronization between the function block and the PLC program  has to be applied while using both parameters ENABLE and CONFIRM  If the output  CONFIRM is set to TRUE upon the return of the function block  the elements DATAO  through DATA7 receive the individual bytes of the object entry that was read  The  output ATALENGTH reports the number of valid data bytes  beginning at DATAO    The network layer supports only a single SDO transfer through the PLC program  at any one time  After the start of the SDO transfer by setting ENABLE to TRUE   the SDO channel is locked  preventing use by other components  The lock state is  maintained until the SDO function block is called again by setting the ENABLE  input to FALSE after completion of the data transfer    A call of the function block with DEVICE   0 leads to an access of the local Object  Dictionary of the PLC  Thus values from the local Object Dictionary can also be read     CAN_SDO_READ_STR  FB for reading strings from the Object Dictionary of a node via SDO transfer   CAN_SDO_READ_STR                                        DEVICE  gt  CONFIRM  INDEX  gt  ERROR  SUBINDEX  gt  ERRORINFO   SDOTYPE  gt  RXDATA    ENABLE  gt  RXLENGTH  RXDATA  gt   MAXLENGTH  g
53. agent allows the user to fill all the  four pages  and also to decide which page will be transferred in the next PROFIBUS  telegram  using the PROFI_SEND_TO_MASTER   In this mode it is possible to  send 976 bytes to the master     CU 02 can manage a total amount of 350 data bytes max    considering MASTER_IN   MASTER_OUT         84       Chapter 5   Profibus          PROFIBUS LINE    PROFIBUS MASTER       IEC 61131 3  User Application       The third is the non paged mode with a data integrity control  in this case the  user updates always the data in the page 2 and using the function block  PROFI_SEND_TO_MASTER  where in this case the parameter PAGE is  meaningless  the CPU will copy all the data in the page 1 before to send the  PROFIBUS telegram to the master  In this way the user control directly the data  sent to the master  and it is not possible that a page is sent before the user does  not finish to fill all the data of the page        PROFIBUS LINE       PROFIBUS MASTER    PROFI_SEND_TO_MASTER    IEC 61131 3  User Application       85    Sigmadue   Function Block Firmware Library    5 1 1 PROFI ENABLE  FB Prototype PROFI_ENABLE    ADDR  gt   MASTER_IN  gt   MASTER_OUT     gt   PAGED     gt         OPRS       Input Parameters                                  Label Type Description Range  SLAVE_ID USINT Profibus Slave Node Address 0    255  MASTER_IN USINT Master Input Byte Number 0    244  MASTER_OUT   USINT Master Output Byte Number 0    244  PAGED BOOL Page Mode Ena
54. al Function Blocks    1 4 1 CTRL_PID  FB Prototype    SP  MEAS  gt   M_RES     gt   PB   gt   Tl   TD       oc   gt   OCRB     gt   BMP_MV     gt   DBMP     gt   ACT_Type  gt   STOP_TI  gt     Input parameters    CTRL_PID           OUT                                              Label Type Description  SP REAL Setpoint value  0 0    100 0   default value   0 0   MEAS REAL Measure value  0 0    100 0   default value   0 0   M_RES REAL Manual Reset  0 0    100 0   default value   50 0   PB REAL Proportional Band     default value   5 0   TI REAL Integral Time  seconds   default value   180 0   TD REAL Derivative Time  seconds   default value   40 0   OC REAL Overshoot Control  default value   1 0   OCRB REAL Overshoot Control Relative Band  default value   0 5   Val for the BUMPLESS functionalit fault  BMP_MV  REAL e or the BU SS functionality  defau  DBMP BOOL BUMPLESS command input  default value   FALSE   ACT_Type   BOOL PID Action Type  default value   FALSE   i   calculation  STOP TI BOOL cun i 5  the integral calculatio  Output parameters  Label Type Description  OUT REAL Controller Output  0 0   100 0   default value   0 0        Description    This function block implements the PID algorithm typically used by the Ascon con     trollers  It needs as input the process variables  SP and MEAS  in     format  the  parameters  PB  TI  TD  M_RES  OC  OCRB  ACT_ Type   and the bumpless  parameters  BMP_MV and DBMP   As output provides the control value MV in  0 0    100 0 rang
55. ange  CH_IN USINT Channel number 1   8                Output description       Label Type Description Range       0  OK    CERB DIE DISGUION KSSHIE 2  Wrong Channel Number indication                   Description The function block reset the counter value of the specified digital input  In case of  error it returns an error code        103    FB Prototype    Chapter 12  TC_Calibrate  for MP 01 unit only     Function Block to recalculate the compensation caused by the sensor break  detection method     TC_CALIBRATE    EXEC_CALIB     gt    BOOL USINT       gt  OPRS  CHANNEL         USINT    Input description             Label Type Description Range  EXEC_CALIB BOOL Command flag TRUE  FALSE  CHANNEL USINT Channel number li 2             Output description                   Label Type Description Range  0  OK  OPRS BYTE 1  TC input channel not present 0    2  2  Wrong Channel Number indication          104     1    2      3    4    5    6    7      8    9     Appendix A  Reference documents       Infoteam OpenPCS programming system     user manual     version 6 0 english     IEC 61131 3  Programming Industrial Automation Systems        Karl Heinz  John  Michael Tiegelkamp   Springer      Ascon Firmware Function Block Library         IEC 61131 3 Function Block Library          Estensioni per gestire porte di comunicazione dell    ambiente OpenPCS    V1 0      Maurizio Grassi   CANopen Extension for IEC61131     Software manual        Edition March 2005      Systec Electronic      
56. ble TRUE FALSE   Output Parameters  Label Type Description Range  0  OK  l 1  Init Error  OPRS USINT Execution Result 2  Size Error  3  Hardware Error                      Description This function block allows the user to create an instance of the PROFIBUS agent  on the CU 02 unit  The user must provide the node address  SLAVE_ID   the  number of output bytes for the master  MASTERL_IN   from the CU 02 to the  master PROFIBUS   and the number of input bytes for the data coming from the  master  MASTER_OUT   from the master PROFIBUS to CU 02   It is important to  note that it is a user responsibility to take care about the total dimensions of the  PROFIBUS telegrams  as specified in the PROFIBUS specification     The user may specify also the mode for the data exchange with the master using  the PAGED input  as reported in the following table           Exchange   PAGED Memory Space Used Use of  mode PROFI_SEND_TO_MASTER   Basic FALSE   M20000 0     M20243 0  NO  Paged TRUE  M20000 0     M21243 0  YES  Non paged  mode with a  data integrity FALSE    M20244 0     M20487 0  YES  control                      Notes  1  To enable and start the Profibus communications  this Function Block must be  called only one time   2 CU 02 can manage a total amount of 350 data bytes max    considering MASTER_IN   MASTER_OUT         86    5 1 2  FB Prototype    Description    5 1 3  FB Prototype    Description    Chapter 5   Profibus    PROFI_STATUS  PROFI_STATUS    USINT       gt  STATUS  USINT
57. ck for 16 digital value blocks reading     MODBUS_GET_DIGITAL_SLAVE    SLAVE_ID     gt    USINT ARRAY 1    16  OF BOOL       gt  OUT  ADDRESS     gt    UINT USINT    gt  OPRS    Input description                            Label Type Description Range  SLAVE_ID  USINT Agent in question  slave 1 or slave 2    1 2  ADDRESS  UINT Starting address 1  128  Output description   Label Type Description Range  OUT  ARRAY 1    16  OF BOOL  Vector holding the 16 readings  TRUE FALSE  OPRS   USINT Execution result 0  1 2  3 4                      The Function Block reads the 16 bit blocks in the memory locations dedicated to  the digital I O  If a block exceeding the I O dedicated size is read  the bits beyond  such limit are set to zero  Starting from the initial address  the digital values are  read and made available in a 16 element vector     The OPRS parameter can acquire the following values                 Value Meaning  0 Block execution terminated successfully  1 Illegal address  3 Invalid protocol  different from 1 or 2              The error condition with value 1 has the highest priority and if the condition occurs  other possible errors are not diagnosed        42    3 3 5    FB Prototype    Description    Chapter 3   Serial communications    MODBUS_SET_DIGITAL_SLAVE  Function Block for digital I O writing     MODBUS_SET_DIGITAL_SLAVE    SLAVE_ID     gt    USINT USINT       gt  OPRS  ADDRESS     gt    UINT  DATA     BOOL       Input description                               
58. com   PORT    0         close_serial_com   PORT    1      open_serial_com      PORT   0    BAUD   baud    PARITY   parity   DATA   data_length   STOP   stop_bit   PROTOCOL   ali   oprs    OPRS     if oprs  gt  0 then   error    true   end_if     open_serial_com     PORT     BAUD   baud    PARITY   parity   DATA   data _ length   STOP   stop_bit   PROTOCOL SS   oprs   OPRS      if oprs  gt  0 then  error    true   end_if     modbus_slave_setting                  CHANNEL   as  NODE_ID   node_id   TIMEOUT   timeout  oprs   OPRS      if oprs  gt  0 then   error    true    end_if    end_if    It must be noted how before opening the serial ports  the Function Block is called  to close them  From a logical point of view this might seem incorrect  but the open  functions are designed to return an error if the port is already busy  If during the  development stage the ports are not closed before downloading a new version of  the firmware  they remain busy  and the system will not allow them to be used  when the program is launched        49    Sigmadue   Function Block Firmware Library    3 4 6 Master code  This task controls modbus master communication     Variable declaration       VAR_EXTERNAL                baud   USINT   parity   USINT    data length   USINT   stop_bit   USINT   init_port  BOOL   error  BOOL    node _id   USINT        next_step  BOOL   sequence_read  ARRAY  1  5  OF WORD   sequence_write  ARRAY  1  5  OF WORD           END_VAR       VAR_GLOBAL    END_VAR       VA
59. d according to their priority level     Trk DTRK   AutoMan DAM   Aux DAUX   Depending on these digital inputs  the functionality of the module changes as follows     e If none of these digital signals are active  the module doesn   t alter the con   trol output signal  from the PID module      e lf DTRK  Tracking  is active  the output OUT assumes the value of the ana   log input TRK     e If the DAM input is active  and DTRK is inactive   the current outputs are  not driven any longer according to the PID outputs  but they are changed  only from the UP and DOWN commands  When the DAM and one of the  two UP or DOWN commands are active  every cycle of the PLC the output  of the function block moves  up or down  by the AM_SL quantity    e  f DAUX  Aux  is active  and both DAM and DTRK are inactive   the output  OUT assumes the value of the analog input AUX        1 4 3 CTRL_HCMV    FB Prototype    Description    Chapter 1   AsconCTRLFb Embedded                                                    CTRL_HCMV  MVH     gt    gt  OUTH  MVC     gt      OUTC  DBND     gt      gt  OUTHC  DTRK  gt      gt  DBMP  TRK gt      gt  OVERLAP  DAM     gt   UP  gt   DOWN     gt   AM_SL  gt   DAUX  gt   AUX  gt   Input parameters  Label Type Description  Analog input  corresponding to the control output  also  MVH REAL  named manipulated output  of the Heat PID module   Value in  0 0     100 0   default value   0 0   Analog input  corresponding to the control output  also  MVC REAL  named manipula
60. d by MV  In this case the output ALARM will be active  The same situ   ation occurs if the passed duty cycle is grater then TCYCLE     TMIN  in this case  the function block modifies the length of the generated pulse in order to maintain  the duty cycle at the required value  and it forces the output to be FALSE for a time  equal to TMIN  Also in this case the output ALARM will be active     ASCON recommends the use of this function block in a cyclic task inside the  OpenPCS programming tool        14    Example task    Chapter 1   AsconCTRLFb Embedded    The following is a simple task example in which a proportional time output control  is implemented  In this case the used Function Blocks are     CTRL_PID for the control   CTRL_MV for manual automatic station and tracking and aux commands   CTRL_TPO for the particular used output   Remarks     1        setpoint       setpoint  and    meas    variables must be already scaled in the range   0 0     100 0      the chosen PID action is the REVERSE action which is default for the    Function Block  the corresponding input has not been assigned      for manual command the output variation speed has been set to one unit  for every task work cycle     the proportional signal time has been set to 20 seconds              nol    O     ti       td                  ocrb    cmd_trk       trk_val       CTRL_PID    SP MV  MEAS  M_RES  PB   TI   TD   Oc  OCRB  BMP_     DBMP  ACT_     STOP_TI             cmd_man       cmd_up       i    cmd_d
61. e           Chapter 1   AsconCTRLFb Embedded    Here is reported a detailed description of the parameters                 Parameter Description   SP Setpoint Value in  0 0    100 0    MEAS Measure Value in  0 0    100 0    PB Proportional band coefficient that multiplies the error  SP   MEAS    M RES Manual reset  It is the control output value when PV   MEAS in a    PD only algorithm  lack of the integral term    TI Integral time value  It is the time required by the integral term to   generate an output equivalent to the proportional term  TD Derivative time  It is the time required by the proportional term P to    Overshoot control  It is the span of the action of the overshoot con     repeat the output provided by the derivative term D    trol  Setting lower values  1 00    0 01  the overshoot generated by a             OC set point change is reduced  The overshoot control does not affect  the effectiveness of the PID algorithm   Setting 1 the overshoot control is disabled   OCRB Overshoot control relative band  It defines a zone across the setpoint  where the PID algorithm is not affected by the overshoot control   BMP_MV _  Value used for the BUMPLESS calculation   DBMP Digital Input indicating when must be performed the adjustment of  the PID terms for the BUMPLESS functionality   ACT_Type   Selection of the control output direction  direct  True  or inverse  False    STOP_TI   External command to stop the integral calculation   MV Controller Output Value              
62. e    ERR_CODE 1 Invalid datatype selection  ERR_CODE 2 Last writing memory location out of range                ERR_CODE 31          90    Chapter 6   Real Time Clock    6 1 3 MEMCPY_I_TO_M  FB Prototype MEMCPY_I_TO_M  DEST_ADDR     UDINT BYTE    gt  OPRS    SOURCE_ADDR     UDINT  MEM_SIZE       UDINT    Input description    Label Type Description Range    DEST_ADDR  M memory destination address  num  a o    All admitted  addresses       SOURCE_ADDR  l  input  source address  num        Amount of bytes to be copied    The value  combined with the  destination address  DEST_ADDR    MEM_SIZE UDINT   MEM_SIZE   cannot exceed the last  0    43000  memory location available for the  specific memory type    I  M or Q   num              Output description    ERROR  BYTE    Description This function block performs a copy of a desired amount of bytes from a valid  l  input memory area to a desired  M memory location     Default Values     apatite Vatu  DEST_ADDR   SOURCE  AOD   MEM SE po oOo i S    Reference Table    Po e             0 0K   OPRS 1   Source area outside the allowed address   2   Destination area outside the allowed address       91    Sigmadue   Function Block Firmware Library    6 1 4 MEMCPY_M_TO_M  FB Prototype MEMCPY_M_TO_M    DEST_ADDR       UDINT BYTE       gt  OPRS  SOURCE_ADDR       UDINT  MEM_SIZE       UDINT    Input description    Type Description Range     M memory destination address All available  DES TAPER  num  addresses    All admitted  addresses       
63. e USINT   Minutes to be set  num     59  Hour       Month_day  USINT  Day of month to be set  num      91  Week_day  USINT   Day of week to be set  num  Sat  Month USINT   Month to be set  num     12    Year to be set  evaluated as  Year USINT   5990   YEAR  e g  11 means 2011  num           0   0   USINT  Hours to be set  num  0    23   1   1   1       00    255                   Description This function block can be used to setup the internal Real Time Clock available  within the sigmadue CPU models  It is not necessary to assign all the values  together but it can be done parameter by parameter accordingly the bit mask  specified with the SETUP function block input  see the above    Reference table       If desired  it is possible to set all the parameters together by setting the SETUP  value to 16 7F  hex  or 2 1111111  bin     It is not necessary to set just one parameter at a time  they can all be assigned in  a single call by setting the setup mask to OxF or 0x7     Default Values     I     SETUP   MINUTE   HOUR   MONTH_DAY  WEEK_DAY    MONTH  YEAR    Default Value                         Reference Table    0 16 01 or 2 1   1 16 02 or 2 10 MINUTE   2 16 04 or 2 100 HOUR   3 16 08 or 2 1000 MONTH_DAY  4   5   6                16 10 or 2 10000 WEEK_DAY    16 20 or 2 100000 MONTH    16 40 or 2 1000000 YEAR  7 16 80 or 2 10000000 N A                 96    Chapter 8  Watchdog    The Ascon CPU units are equipped with a watchdog mechanism controlled by two  function blocks  
64. e errors are not diagnosed        40    3 3 3    FB Prototype    Description    Chapter 3   Serial communications    MODBUS_SET_DWORD_DATA  Function Block enabling to write in two contiguous registers  4 bytes      MODBUS_SET_DWORD_DATA                                     SLAVE_ID     gt    USINT USINT    gt  OPRS  ADDRESS       UINT  DATA       DWORD  Input description  Label Type Description Range  SLAVE_ID   USINT Agent in question  slave 1 or slave 2  1 2  ADDRESS   UINT Starting address 1  4095  DATA DWORD   Value to be written in two contiguous registers  Output description  Label Type Description Range  OPRS  USINT Execution result 0  1 2 3 4             The Function Block writes a 32 bit value in the registers  using two locations with   two bytes each  Starting from the specified input address the 4 contiguous bytes   are used to hold the value  A 32 bit value can be written in the last 4 bytes of the   memory area dedicated to the registers if the maximum value of the allowed input  address is 4095     The OPRS parameter can acquire the following values                 Value Meaning  0 Block execution terminated successfully  1 Illegal address  3 Invalid protocol  different from 1 or 2           The error condition with value 1 has the highest priority and if the condition occurs    other possible errors are not diagnosed        41             Sigmadue   Function Block Firmware Library    3 3 4    FB Prototype    Description    MODBUS_GET_DIGITAL_SLAVE  Function Blo
65. e mapping saved more than other models  function block  returns the current network is identical to that stored in memory     CANOPEN_NETWORK_STATUS    The following block can receive information about the network status in relation to a  series of events which might have involved going to change its topology   configuration  or proper operation     CANOPEN_NETWORK_STATUS    EN       BOOL BOOL       gt  ENO  ARRAY OF BYTE       gt  DEVICE_STATUS  BYTE    gt  NETWORK_STATUS    Input description    BOOL _  Enable In TRUE FALSE          63    Sigmadue   Function Block Firmware Library    Description    4 1 7    FB Prototype    Description       Output description    Description Range    Enable Out TRUE FALSE  ARRAY    DEVICE STATUS OF BYTE Status for each module    NETWORK_STATUS  BYTE Status of the entire network                The status device contains an array of bytes for each index contains information on  events involving the forms corresponding to the addresses  The audit event starts  from the call CanOPEN_Net_Control_Start  The information is encoded in bits in the  table below    Information Code  No significant event 0x0000  Error in the diagnostic protocol 0x0001  The module has sent a message to boot up 0x0002  The module has changed its been in the automation of communication  0x0004  The module has sent an emergency message 0x0008                Network_status for the legend of the output status is as follows     informate te          No significant event on the 
66. e maximum cycle time of the application to avoid  side effects      If something happens and the timer cannot be reset  basically it  reaches 0  the digital output will be deactivated by forcing it to 0  opened      Default Values    Default Value    WD_ENABLE FALSE       97    Sigmadue   Function Block Firmware Library    Input Default Value  WD_TIMER_VALUE    0       WD_TIMEOUT_MODE  Reference Table       0       WD_TIMEOUT_MODE    System operations when WD timer expires       0  1  SigmaPAC CU 02     System reset  same as power cycle     The CPU opens the onboard Alarm output and the  watchdog timeout event is stored       1  uPAC MP 01           The CPU opens the DO1 output  if enabled  and the  watchdog timeout event is stored  please refer to the     MP 01 User Manual    on how to enable the DO1 as  watchdog output         98       Chapter 8   Watchdog    8 1 2  FB Prototype    Description    WATCHDOG_STATUS    UINT  BOOL    WATCHDOG_STATUS        WD_TIMER      WD_EXPIRED    Output description                   Label Type Description Range  WD_TIMER UINT Actual timer value  WD_EXPIRED  BOOL Timer status             This function block can be used to monitor the watchdog status available within  the sigmadue CPU models  When the function block is used  and the watchdog  function is not used to control the specific digital output  it return a status at TRUE  if something happens and the timer cannot be reset  basically it reaches 0   The  status then can be used to perfor
67. e number of characters to be writen    INT             USINT  Network number    Description  Output for signal service completion by the function block    Error code corresponding to the data type     CIA405_CANOPEN_KERNEL_ERROR       SDO abord code of the communication partner  corresponding to the data type    CIA405_SDO_ERROR        TXDATA STRING  String variables for storing the characters to be written    The function block CAN_SDO_WRITE STR is used to write strings to the Object  Dictionary of a node using SDO transfer  The SDO transfer is always executed in  the background  thus the procedure described in section 4 1 3 for synchronization  between the function block and the PLC program has to be applied while using  both parameters ENABLE and CONFIRM    The string to be written to the Object Dictionary must be given to the element  TXDATA  The input TXLENGT specifies the number of valid characters  If this  value is 0  then the length of the character sequence in the string TXDATA is  determined internally  corresponds to LEN TXDATA   and is appled as the number  of characters to be written  In this case the entire string contents are written    The network layer suppors only a single SDO transfer through the PLC program at  any one time  After the start of the SDO transfer by setting ENABLE to TRUE  the  SDO channel is locked  preventing use by other components  The lock state is  maintained until the SDO function block is called again by setting the ENABLE  input to 
68. e shown below     Variable declaration          VAR_EXTERNAL             init_port_mb_tcp   BOOL   error_mb_tcp   BOOL                 END_VAR       VAR_GLOBAL                                        END_VAR   VAR  mb_tcp_oprs   USINT   init_mb_tcp   ENABLE_MODBUS_TCP_SERVER   close_mb_tcp   CLOSE_MODBUS_TCP_SERVER    END_VAR   Task code    if init_port_mb_tcp then    init_port_mb_tcp    false   error_mb_tcp    FALSE        close_mb_tcp       init_mb_tcp    SERVER_PORT   503   USE_SECURITY   0                                TIMEOUT   10       mb_tcp_oprs    OPRS     if mb_tcp_oprs  gt  0 then  error_mb_tcp    true    end_if     end_if     Note how  before enabling the agent  the Function Block is called to close it  As far  as the logic sequence of agent control is concerned  this might seem incorrect  but  the open functions have been designed to return an error if the port is already  busy  Consequently  if the agent is not disabled before downloading a new version  of the firmware  the agent will remain occupied and the system will not allow it to  be used when the program is launched        27    Sigmadue   Function Block Firmware Library    2 1 11 Example code  This task works with the registers which are addressed by the Modbus TCP IP  Server agent     Variable declaration          VAR_EXTERNAL             init_port_mb_tcp   BOOL   error_mb_tcp   BOOL   END_VAR          VAR_GLOBAL                                                    END_VAR   VAR  oprs  USINT   status  USI
69. e various function blocks        67    Sigmadue   Function Block Firmware Library    4 1 13 CAN_GET_STATE  Function compent for node state query of various devices   FB Prototype CAN_GET_STATE       DEVICE     gt    USINT BOOL       gt  CONFIRM  ENABLE       WORD WORD       STATE  NETNUMBER     USINT    Input description    DEVICE USINT   Address of the node to be queried       ENABLE WORD   Input for enabling or locking the function block    NETNUMBER_ USINT    Output description    Description    CONFIRM  BOOL  Output for signal service completion by the function block    Node state corresponding to the data type     CIA405_STATE             STATE       Description The function block CAN_GET_STATE is used to enquire the node state for a  specific device  The state query is based on monitoring by Heartbeat or  Lifeguarding  Detailed information on these functions can be found in section 2 3   The return values on the output STATE have the following meaning     UNKNOWN  The CANopen device on the given address supports neither Heartbeat  nor Lifeguarding  thus the state can not be monitored  This state is  also reported on an PLC without a CANopen Master if either no PLC  with a CANopen Master is available in the network that supports a  state transmission as described in section 2 3 or if the Master PLC in  question is in a stop state  PLC program has been halted      NOT_AVAIL  The CANopen device on the given address no longer answers  Heartbeat or Lifeguarding queries and i
70. eanings        Value Meaning  No operation   OK   At least one memory value updated  Timeout expired   Agent error event             wi N     O       The Oprs parameter can acquire the following values        Value Meaning  No operation   OK   Port not available   Timeout expired   CRC error   Exception                       AI N     O       The conditions coded by the status parameter are not mutually exclusive  i e  a  condition may occur in which a timeout has expired but a new memory value has  also been updated  For this reason  the diverse conditions have been coded  according to increasing priority  The condition with value 3 has the highest priority   therefore  if such condition occurs  it will be surely indicated while possible lower  priority conditions will not        38    Chapter 3   Serial communications    3 3 Data access function for Modbus slaves    3 3 1    FB Prototype    Description    Five function blocks are available which grant access to the memory areas  dedicated to the Modbus slaves differently than using percentage variables   Writing and reading whole register and bit blocks are much easier and particularly     e reading in the register dedicated memory area  starting from a definite Modbus  address  both 16 register blocks  available in a 16 element vector  and 4 byte  blocks  available in an 8 element vector     e Writing the value of a single register and indicating the desired Modbus address    e Writing 4 data bytes starting from a desired M
71. ecution terminated successfully  1 Illegal address  3 Invalid protocol  different from 1 or 2           The error condition with value 1 has the highest priority and if the condition occurs  other possible errors are not diagnosed        39    Sigmadue   Function Block Firmware Library    3 3 2 MODBUS_SET_WORD_DATA  Function Block enabling to write a register     FB Prototype    Description    MODBUS_SET_WORD_DATA          SLAVE_ID       USINT USINT       gt  OPRS  ADDRESS       UINT  DATA       WORD  Input description  Label Type Description Range  SLAVE_ID   USINT Agent in question  slave 1 or slave 2    1 2                                  ADDRESS   UINT Register address to be written 1  4096  DATA WORD Value to be written in the register  Output description  Label Type Description Range  OPRS USINT Execution result 0 1 2 3 4          The Function Block enables to write a value in the register specified by the input  address  The block enables to write directly in the memory areas dedicated to the  Modbus slaves without percentage variable declaration  The Function Block has  simply to be called within a cycle and data and addresses to be entered to write on  several registers     The OPRS parameter can acquire the following values                    Value Meaning  0 Block execution terminated successfully  1 Illegal address  3 Invalid protocol  different from 1 or 2        The error condition with value 1 has the highest priority and if the condition occurs  other possibl
72. ed range 1 0     600 0    default value   60 0     Dead band      admitted range 0 0     100 0    default value   2 0     Band value used to consider the target reached       admitted range 0 0     100 0   default value   0 2     Init position      admitted range 0   100 0    default value   0 0     DLY Timeout value  s   default value   0 1     RESETPOS BOOL   Reset Command  default value   FALSE   OUTMODE  BOOL   Output Command  default value   TRUE     Output parameters          MINRES BOOL    INITPOS                         Label Type Description  OPEN BOOL Open valve command  default value   FALSE   CLOSE BOOL Close valve command  default value   FALSE   Calculated valve position      range 0   100 0   Poe PERL  default value   0 0                    This module generates the valve OPEN and CLOSE commands in relation to the   position required by the MV signal and to the internal valve position  This value is   calculated using the TTRAVEL value and the sampling time of the task where this   function block is used  The OPEN  amp  CLOSE commands are set according to MIN   RES and DBND parameters     The DLY parameter specify a timeout that has to be waited before to move the  valve from an already reached position to a new desired one     The OUTMODE command specify if the OPEN or CLOSE command must be  maintained when the valve reaches the 0 0 or 100 0 position  If OUTMODE is  TRUE the command is maintained     The RESETPOS command perform a reset of the function block c
73. emory  or the data of the module which has been scanned at the last compare     CANOPEN_GET_DEVICE_ID    EN   gt      ENO  DEVICE  gt    gt  DEVICE_TYPE  SOURCE         gt  DEVICE_NAME      gt  VENDOR_ID      gt  PRODUCT CODE    gt  OPRS       Input description    Description  Enable In TRUE FALSE  Device of interest    Source of the requested TRUE   Freezed Network   information FALSE   Compared Network                   Output description    Label Type Description Range    ENO Enable Out TRUE FALSE  DEVICE_TYPE Array of the acquired device type  DEVICE_NAME Array of the device names  VENDOR_ID Array of the vendor IDs  PRODUCT CODE Array of the product codes  OPRS Execution results                         OPRS field must be interpreted according to the following table     Information  Acquired data are valid 0x0000  Device address not valid 0x0001  The requested source is not available 0x0002                CANOPEN_NETWORK_COMPARE    It performs a comparison between the connected I O modules network image and  the one already saved into the system memory  with regards to the previously  described parameters     CANOPEN_NETWORK_COMPARE    EN       BOOL BOOL       gt  ENO  ARRAY OF WORD       gt  DEVICE_STATUS  WORD       gt  NETWORK_STATUS    Input description    BOOL Enable In TRUE FALSE          62    Description    FB Prototype             Chapter 4   CanOPEN    Output description    Description Range  Enable Out TRUE FALSE  Comparison result for each    module    Comparis
74. end to another memory area where the  Master agent places the data received in response to its queries  The following  figure illustrates the concept on which this modbus Master protocol  implementation is based     PLC Memory       i Modbus   l Memory direct access Modbus Functions PDU Access              Request to Slave        Function Code  01     Input data area 02 03 04 07  08                                            32 Bytes  Reply from Slave   Q Memory direct access  Request to Slave  with Data  32 Bytes Output data area Write Functions  Function Code  05  06  15  16                                           The supported functions are shown in the following figure     Function Codes    Physical Discrete Inputs Read Discrete Inputs    Bit Read Coils 01    access ri Bits Or Physical Write Single Coil 05          Data Write Multiple Coils OF    Access Physical Input Registers Read Input Register  16 bit in ato Read Holding Registers  si Physical P A Wake single Register  Write Multiple Registers  Read Exception status  Diagnostics                Diagnostics                   44    Chapter 3   Serial communications    The two memory areas designated to input and output data storage are shown in  the table below     Protocol Agent   Protocol Memory Areas PLC Memory Mapping    ModBus Master Input Data  11000 0 to  11031 7  Output Data  Q1000 0 to  Q1031 7    The IEC61131 3 programmer features two Function Blocks   e MODBUS_MASTER_EXECUTE  e MODBUS_MASTER_STATUS  They con
75. es from a valid  M  memory area to a desired  Q memory location        Default Values    Input Default Value    DEST_ADDR  SOURCE_ADDR  MEM_SIZE                Reference Table    I      0   OK     OPRS 1   Source area outside the allowed address   2   Destination area outside the allowed address          93    Sigmadue   Function Block Firmware Library    6 1 6 MEMCPY_Q_TO_M  FB Prototype MEMCPY_Q_TO_M    DEST_ADDR       UDINT BYTE       gt  OPRS  SOURCE_ADDR       UDINT  MEM_SIZE       UDINT    Input description    Label Type Description Range    DEST_ADDR UDINT    M memory destination address  num     SOURCE_ADDR  Q  input  source address  num     All available  addresses    All admitted  addresses       Amount of bytes to be copied    The value  combined with the  destination address  DEST_ADDR    MEM_SIZE MEM_SIZE   cannot exceed the last  memory location available for the  specific memory type    I  Mor Q   num     Output description       0    43000       Label  Tyre  ERROR JBVTE    Description This function block performs a copy of a desired amount of bytes from a valid  Q       memory area to a desired  M memory location     Default Values     input Default Value       DEST_ADDR  SOURCE_ADDR    MEM  MEM_SIZE o    Reference Table       BE e  esse SACE       0 0K   OPRS 1   Source area outside the allowed address   2   Destination area outside the allowed address       94    Chapter 7  Real Time Clock    The Ascon CPUs are equipped with a clock powered by the unit batte
76. esentation regarding the 32 bit floating point numbers     Sign  0   positive  Exponent calculated as             101    Sigmadue   Function Block Firmware Library    10 1 2 ASCON_REAL_TO_FLATTEN  FB Prototype ASCON_REAL_TO_FLATTEN    Input description    Description Range       Number to be converted into a REAL  38 38  INREAL   REAL   alue  num   3 4E          3 4E     Output description    Description Range    Converted 32 bit DWORD number  OUTWORD   DWORD representation  num  0    4294967295     Description This function block performs a conversion from a REAL data type value compliant  to the IEEE 754 specification  which provides the following representation  regarding the 32 bit floating point numbers  into the corresponding 32 bit DWORD  number representation                Sign  0   positive  Exponent calculated as l       102    Chapter 11  Counter Block  for MP 01 unit only     On the MP 01 unit it is possible to combine a counter for each local digital input  in  the configuration session the counter function is enabled  please check the     MP 01User Manual    for details  and in the application code the user can read the  values  A reset function block is provided in order to reset the counter value in the  application code     11 1 RESET _ PULSE COUNTER    The function block reset the counter value of the specified digital input   FB Prototype RESET_PULSE COUNTER       CH_IN  gt    USINT BYTE    gt  OPRS          Input description       Label Type Description R
77. fully   Port not configured for the ASCII serial protocol  Peripheral driver problems   Unavailable number of requested bytes in the input buffer    Number of bytes present in the input buffer less then requested                         56    Chapter 3   Serial communications    3 5 6 SERIAL _IO_WRITE  FB Prototype SERIAL_IO_WRITE    PORT       USINT USINT         OPRS  N_OF_BYTE     gt    USINT  BUFFER     gt    STRING 100     Input parameters    Description  Port on which the serial agent is initiated  admissible  values   uPAC  0  X0  or 1  X1    SigmaPAC  0  X1   1  X3  or 2  X4   Desired amount of bytes to write    BUFFER STRING  100  String containing the bytes to be sent    Output parameters     Output   Wye   Description o  OPRS_ USINT    Description This FB can be used to send a desired amount of bytes within the serial ASCII  agent  The values returned by the    OPRS    parameter are     Value Description  0    Operation executed successfully  1 Port not configured for the ASCII serial protocol  2 Attempt to write a number of bytes that exceeds the allowed limit                               57    Sigmadue   Function Block Firmware Library    3 5 7 SERIAL _IO_WRITE_BYTE  FB Prototype SERIAL_IO_WRITE_BYTE    PORT       USINT USINT       gt  OPRS  N_OF_BYTE       USINT  BUFFER       ARRAY  1   100  of BYTE    Input parameters    Label   Type    Port on which the serial agent is initiated     USINT admissible values     0  X0  or 1  X1      0  X1   1  X3  or 2  X4   US
78. g buffer  This function block is  only available on one control unit in  PLC with CANopen Master  mode                    74    Chapter 4   CanOPEN    4 1 20 CAN _REGISTER_COBID    FB Prototype    Description    4 1 21    FB Prototype    Function block for registering or erasing the receipt of PDOs and CAN Layer 2  messages via the network layer     CAN_REGISTER_COBID       COBID       UINT BOOL       gt  CONFIRM  REGISTER       BOOL WORD       gt  ERROR  ENABLE       BOOL  NETNUMBER     USINT       Input description    Description    COBID of the message to be newly entered into  registration or to be erased from the registration    REGISTER Enter COBID into from registration    BOOL Input for enabling or locking the function block  NETNUMBER USINT Network number    Output description    Description    CONFIRM  BOOL   Output for signal service completion by the function block    State or error code corresponding to the data type     CIA405_CANOPEN_KERNEL_ERROR       The function block CAN_REGISTER_COBID is used for registration of a PDO ora  CAN Layer 2 message for receipt via the network layer or for erasing such a  registration  When the component is called with the REGISTER input set to  TRUE  the COBID  CAN identifier  entered for receiving messages in the network  layers is registered    When the component is called and REGISTER   FALSE  the registration of the  effected COBID is erased  If a component is called and REGISTER   FALSE and  COBID   0  all registrations are
79. he set of addresses that can access the Modbus TCP IP Server  agent when security functions are enabled  Among all settable parameters  one  sets the time the system waits before automatically closing an idle connection        16    Chapter 2   Modbus TCP IP    2 1 Modbus TCP IP Server agent    The Modbus TCP IP Server agent resides in the system Firmware and must be  activated and configured by the user using a number of Function blocks and initial  configuration session menus which are described below  Once the server is  configured  the agent remains operative and grants a client access to specific  memory areas shared with the IEC61131 3 programming environment  The  Modbus TCP IP Server agent shares the memory area with Modbus serial slave  agent  2  which means that the two agents cannot be used at the same time  The  available modbus functions and the memory map shared by the IEC61131 3  environment and communication protocol are shown below     Function Codes    Code  Sub code   hex   Physical Discrete Inputs Read Discrete Inputs    Bit Read Coils    access a Bits Or Physical Write Single Coil    Data Write Multiple Coils             Access Physical Input Registers   Read Input Register  16 bit Read Holding Registers          Internal Registers Or    access  Physical Output Registers    Write Single Register  Write Multiple Registers  Read Exception status  Diagnostics   The protocol   s support data area follows the Modbus native memory model           Diagnostics   
80. hile OUTH is set to  2 0    TRK     50 0    Please  note that the tracking value is not affected by the DBND parameter     e If the DAM input is active  and DTRK is inactive   the current outputs are  not driven any longer according to the PID output  but they are changed  only from the UP and DOWN commands  When the DAM and one of the  two UP or DOWN commands are active  every cycle of the PLC the output  of the function block moves  up or down  by the AM_SL quantity    e  f DAUX  Aux  is active  and both DAUX and DTRK are inactive   the out    puts are set according to the value of the analog input AUX  This signal has  a range from  0 0     100 0  and it drives both OUTH and OUTC  When its  value is in the range 0 0 to 50 0  it means that a Cool action must be taken   therefore  OUTH is set to 0  while OUTC is set to  RCGA   2 0    50 0    AUX   Inversely  when it is in the range 50 0 to 100  OUTC is set to 0  while  OUTH is set to  2 0    AUX     50 0    These values are valid if the DBND of  the phase splitter is set to 0  otherwise they slightly change        10    1 4 5  FB Prototype    Description    Chapter 1   AsconCTRLFb Embedded    CTRL_SRV  CTRL_SRV  MV     gt      OPEN  TTRAVEL     gt      CLOSE  DBND     gt      POS  MINRES     gt   INITPOS     gt   DLY  gt     RESETPOS     gt   OUTMODE     gt        Input parameters      Input   Type Description    Required position      admitted range 0 0     100 0    default value   0 0     Servomotor travel time  s   admitt
81. ion of the node corresponding to  the CIA Draft Standard 301  However  if the output CONFIRM is set to TRUE  the  network layer s receiving buffer does not contain any emergency messages     The function block always returns the first emergency message entered into the  receiving buffer    oldest message   the message is subsequently erased from the  receiving buffer  Thus every emergency message can only be read one time by  the PLC program  The function blocks CAN_RECV_EMCY_DEV and  CAN_RECV_EMCY both access the same receiving buffer    This function block is only available on control units in    PLC with CANopen  Master    mode     CAN_RECV_EMCY_DEV    Function block for reading emergency messages of a specific node from the  receiving buffer of the network layer     CAN_RECV_EMCY_DEV             DEVICE     gt   ENABLE     gt   NETNUMBER     gt     CONFIRM   ERROR  EMCY_ERR_CODE  EMCY_ERR_REGISTER  EMCY_ERR_FIELD1  EMCY_ERR_FIELD2  EMCY_ERR_FIELD3  EMCY_ERR_FIELD4  EMCY_ERR_FIELD5    444444444          73    Sigmadue   Function Block Firmware Library    Description       Input description    Label   Type    DEVICE USINT Node address  1 127   for which the receipt of  emergency messages is to be tested    ENABLE BOOL  Input for enabling or locking the function block  NETNUMBER  USINT  Network number             Output description    Description    Output for signal service completion by the  function block  Error code corresponding to the data type     CIA405_CANOPEN_KERNEL
82. ived CAN message    The function block CAN_PDO_READ8 is used to read PDOs and CAN Layer 2  messages from the receiving buffer of the network layer  Only one access of the  message registered with the help of the function block CAN_REGITER_COBID is  supported  If multiple messages with the same COBID are received between two  sequential calls of AN_PDO_READ8  then the most recently received message  overwrites the previous one  Thus only the most current message remains stored  in the receiving buffer  After a read out via the function block CAN_PDO_READ8   the corresponding message gets erased from the network layer s receiving buffer     This prohibits multiple readings of a single message by the PLC program     If the output CONFIRM is set to TRUE upon the return of the function block  then  the elements DATAO to DATA7 contain the individual bytes of the received  message  The output ATALENGTH will then report the number of valid data bytes   beginning withDATAO   However  if the output CONFIRM is set to FALSE  then  the receiving buffer does not contain any messages with the given COBID in the  network layer  With CONFIRM it is possible to differentiate between a valid  message of 0 bytes in length was received as opposed to no message at all    If no message is available  then this is also shown by the error code  NO_VALID_DATA_AVAILABLE on the output ERROR                                69    Sigmadue   Function Block Firmware Library    4 1 15 CAN_PDO_WRITE8    FB Proto
83. ko    counter_ko   1   elsifsequence_read 2   lt  gt  sequence_write 2  then  counter_ko    counter_ko   1   elsifsequence_read 3   lt  gt  sequence_write 3  then  counter_ko    counter_ko   1   elsifsequence_read 4   lt  gt  sequence_write 4  then  counter_ko    counter_ko   1   elsifsequence_read 5   lt  gt  sequence_write 5  then  counter_ko    counter_ko   1   else  counter_ok    counter_ok   1   end_if                       next_step    true     3     the timeout has expired during the last activity required      timeout_err    timeout_err   1   4     an error occurred during the last activity required    err_err    err_err   1   end_case   end_if   end_if   end_if     Slave code   This task works with the registers which are addressed by the slave agent  The  code does not refer to any Function Block controlling the agent since the agent  runs in the background and makes a certain memory area available  while the  IEC1131 3 program only deals with variables in the memory area shared with the  agent  It is however possible     not shown in this example     to obtain information  from the modbus slave agent via the Function Block MODBUS_SLAVE_STATUS     Variable declaration                VAR_EXTERNAL       baud   USINT   parity   USINT   data_length   USINT   stop_bit   USINT   init_port  BOOL   error  BOOL   node_id   USINT           next_step  BOOL   sequence_read  ARRAY  1  5  OF WORD   sequence_write  ARRAY  1  5  OF WORD              END_VAR       VAR_GLOBAL       E
84. l calls of AN_PDO_READ8  then the most recently received message  overwrites the previous one  Thus only the most current message remains stored  in the receiving buffer  After a read out via the function block CAN_PDO_READ8   the corresponding message gets erased from the network layer s receiving buffer     This prohibits multiple readings of a single message by the PLC program     If the output CONFIRM is set to TRUE upon the return of the function block  then  the elements DATAO to DATA7 contain the individual bytes of the received  message  The output ATALENGTH will then report the number of valid data bytes   beginning withDATAO   However  if the output CONFIRM is set to FALSE  then  the receiving buffer does not contain any messages with the given COBID in the  network layer  With CONFIRM it is possible to differentiate between a valid  message of 0 bytes in length was received as opposed to no message at all    If no message is available  then this is also shown by the error code  NO_VALID_DATA_AVAILABLE on the output ERROR           70    Chapter 4   CanOPEN    4 1 16 CAN_RECV_BOOTUP    FB Prototype    Description    Function block for the Bootup messages of any node from the network layers  receiving buffer     CAN_RECV_BOOTUP       ENABLE       BOOL BOOL       gt  CONFIRM  NETNUMBER       USINT USINT       gt  DEVICE  WORD       gt  ERROR    Input description    ENABLE BOOL _  Input for enabling or locking the function block  NETNUMBER  USINT  Network number       
85. lve command  initial value   FALSE   CLOSE BOOL  Close valve command  initial value   FALSE        ERR_STS  BOOL  Error condition  initial value   FALSE   ERR_CODE UINT  Error code  bit mask  0    7   initial value   0   UINT  Out of Range occurrences  value  0    65535  initial value   0              Description This FB provide a servomotor positioner control in close loop mode with 2 digital  commands  OPEN and CLOSE   The FB receives the percentage desired position   MV  and activates the digital commands if the actual position  POT  differs by the  dead band  DBND   In order to properly calculates a correct position value in per        12    Chapter 1   AsconCTRLFb Embedded    centage  it is necessary to set the scale limits  LOW_POT and HIGH_POT   The  target position is considered reached when the actual value is within the HY band     The CLOSE_TIGHT parameter define a deviation band on the 0 0 and 100 0   value  when the MV will be within these areas  the digital commands OPEN and  CLOSE will be maintained forced  The function is disabled with a value of   0 0   The DLY parameter specify a time between two opposite commands when  a position has been already reached     The RESET command perform a reset of the function block when in ERROR mode   THE FB REMAIN IN THIS STATE UNTIL A RESET COMMAND IS  PERFORMED                                  ERR_MODE   Outputs behaviour in case of error    ERR_MODE value Control Output Status   0 Open   FALSE Close   FALSE  1 Open   TRU
86. m a desired action        99    Chapter 9  Random number generators    9 1 Description of the individual Function Blocks    9 1 1 RAND  Function Block needed to have random numbers from 0 to 65535     FB Prototype RAND         UINT   gt  NUMBER       Output description       Label Type Description Range  NUMBER UINT Random number 0  65535                Description Sometimes having random numbers in the 1131 3 program can be useful  This  Function Block generates random numbers ranging from 0 to 65535        100    Chapter 10  Type conversion   FLATTEN IEEE     REAL and vice versa     The following FBs can turn useful to transfer the value of a floating point variable  via modbus protocol  Particularly  it is possible to convert a REAL variable to its  single byte equivalent ina DWORD variable and vice versa  before sending it via  modbus line  The byte equivalent of a variable is indicated as FLATTEN     10 1 Description of the individual Function Blocks    10 1 1 ASCON_FLATTEN_TO_REAL  FB Prototype ASCON_FLATTEN_TO_REAL    Input description      Type     Description      Range         32 bit ee TENORS coc So SSOSTO number representation  INDWORD   DWORD to be converted  num  0    4294967295    Output description    Type Description  OUTREAL   REAL Converted REAL value  num   3 4E738    3 4E 38    Description This function block performs a conversion from a DWORD variable into a REAL  data type value compliant to the IEEE 754 specification  which provides the  following repr
87. n  the return of the function block  the string given as element RXDATA contains the  character sequence of the read object entry  The output RXLENGTH gives thereby  the number of read characters  corresponds LEN RXDATA        The network layer suppors only a single SDO transfer through the PLC program at  any one time  After the start of the SDO transfer by setting ENABLE to TRUE  the  SDO channel is locked  preventing use by other components  The lock state is  maintained until the SDO function block is called again by setting the ENABLE  input to FALSE after completion of the data transfer     A function block call with DEVICE   0 leads to an access of the local Object  Dictionary of the PLC  Thus values from the local Object Dictionary can also be read        WORD       ERRORINFO DWORD             CAN_SDO_WRITE8  Function block for writing object entries of a node by way of an SDO transfer   CAN_SDO_WRITE8             CONFIRM  WORD       gt  ERROR  DWORD       ERRORINFO    COBID     gt   INDEX  gt   SUBINDEX     gt   ENABLE  gt   DATAO     gt    DATA1  gt   DATA2  gt    DATA3  gt    DATA4  gt    DATA5  gt    DATA6     gt    DATA7  gt   DATALENGTH  gt   NETNUMBER     gt     Input description    Label  Type    COBID of the message to be newly entered into  CORIO DINI registration or to be erased from the registration    INDEX WORD  Number of the index entry to be read  SUBINDEX BYTE Number of the subindex entry to be read                      77    Sigmadue   Function Block
88. nce of calls for the TRUE FALSE  implementation of block                Address of the device to be analyzed    Description Range  Enable Out TRUE FALSE  End of execution  Error Code  ERR_INFO  DWORD  Details of the errors occurred Po                   4 1 9 CANOPEN_SCAN_DEVICE_ID  It scans the specified device address and replace it into the network image created    by the system using the  CanOPEN_Network_Compare  FB  It must be called  cyclically until the end of operations   FB Prototype CANOPEN_SCAN_DEVICE_ID  EN   gt     ENABLE     gt   DEVICE  gt         ENO       CONFIRM  WORD       gt  ERROR  DWORD       ERR_INFO        Input description  Label Type Description Range    Enable In TRUE FALSE    It manages the sequence of calls for the TRUE FALSE  implementation of block             Description  Enable Out TRUE FALSE  End of execution  Error Code  Details of the errors occurred                         65    Sigmadue   Function Block Firmware Library    4 1 10 CAN_ENABLE_CYCLIC_SYNC    FB Prototype    Description    Function block for enabling or locking cyclical SYNC messages   CAN_ENABLE_CYCLIC_SYNC    SYNC_MODE  gt   SYNC_TIME  gt   ENABLE     gt   NETNUMBER     gt            CONFIRM  WORD       gt  ERROR    Input description    Label Description    TRUE   Enable generation of cyclical SYNC messages  FALSE   Lock generation of cyclical SYNC messages    Time between two sequential SYNC messages  or 0 for  a SYNC message after each PLC cycle    ENABLE BOOL Input for en
89. nd the Heat output  are defined by a set of digital inputs  as listed  above  ordered according to their priority level     Trk  AutoMan    Aux    DTRK    DAM    DAUX       Sigmadue   Function Block Firmware Library    Depending on these digital inputs  the functionality of the module changes as follows     If none of these digital signals are active  the module does not alter the  control output signals  that are led  unchanged  directly from the input MVC  and MVHto the output OUTH and OUTC  The DBND parameter defines  how the Cool and the Heat channel interact each other  When it is positive   this parameter defines the dead band width  centered around a value 0 of  the output  It means that for each output value included in the deadband  both the OUTC and the OUTH output are 0  When it is negative  the oppo   site occurs  for each value included in the dead band  now named cross  band   both the OUTC and the OUTH are different from 0     If DTRK  Track  is active  the outputs are set according to the value of the  analog input TRK  This signal has a range from   100 0      100 0  and it  drives both OUTH and OUTC  When its value is in the range  100 to 0  it  means that a Cool action must be taken  therefore  OUTH is set to 0  while  OUTC is set to the value of TRK  with the sign inverted  Inversely  when it is  in the range 0 to 100  OUTC is set to 0  while OUTH is set to TRK  Please  note that the tracking value is not affected by the DBND parameter     If the DAM input
90. network 0x0000  Occurred one or more significant events 0x0001  CANOPEN_NET_CONTROL_START    Start the agent that executes the control of events CANopen network storing any  abnormal situations     CANOPEN_NET_CONTROL_START    EN       BOOL BOOL       gt  ENO  START       BOOL       Input description    BOOL   Enable In TRUE FALSE  START BOOL   Enable and disable the Agent TRUE FALSE    Output description       BOOL Enable Out TRUE FALSE    This function block allows you to kick off a staff member who is running the event  control CANopen network storing any abnormal situations  The initiation agent is  obtained by calling the funcion block with the START parameter set to TRUE  but  you can disable the function block chemotherapy agent with the START  parameter set to FALSE        64    Chapter 4   CanOPEN    4 1 8 CANOPEN SCAN DEVICE_COM    Through this function block can run the scan characteristics of a communication  module and replace the current image of the network that the system has gained  during the  CanOPEN_Network_Compare  This function block is not blocking like  everyone else in this library so that it can carry out its function should be called  periodically until it returns a signal logoff     FB Prototype CANOPEN_SCAN_DEVICE_COM  EN     gt    BOOL BOOL       gt  ENO  ENABLE     BOOL BOOL       gt  CONFIRM  DEVICE     gt    BYTE WORD       gt  ERROR    DWORD       ERR_INFO    Input description    Description Range  Enable In TRUE FALSE    It manages the seque
91. ntrol of  over undershoots which may occur when the Setpoint is changed  The available  parameters intended for this purpose are two  O C  and O C rb  The first one  represents the actual control parameter of over undershoots  whereas the second  one defines a band near the setpoint where the PID automatically excludes this  control  In particular  decreasing the O C  value means decreasing the overshoot  effect and accordingly increasing the time needed to reach the Setpoint   Increasing O C rb means increasing the area near the Setpoint where PID returns  to its natural dynamics and accordingly decreasing the time needed to reach the  Setpoint        Chapter 1   AsconCTRLFb Embedded    The two figures below show the effect of the overshoot control algorithm on a  process as a result of setpoint step variation  In the left figure the algorithm is  excluded  O C    1 0                                 The following is a flow chart indicating the required procedure to obtain correct     O C    and    O C rb    parameter values  starting from their default values        0 C  1  O c rb   0 5             No         Overshooting           OK 0 C   0 5                                     Decrease the  O c rb value         Overshooting                 Time  to reach the  SetPoint    Acceptable Too long          Increase the  O c rb value    y    OK                            Decrease the  O c rb value       Sigmadue   Function Block Firmware Library    1 4 Description of the individu
92. ocation out of range    ERR_CODE 1 Invalid datatype selection                ERR_CODE 31             89    Sigmadue   Function Block Firmware Library    6 1 2    FB Prototype    Description       MEMCOPY_TO_M    MEMCOPY_TO_M       MEM_ADDR     gt   DATATYPE  gt   BYTE_VAL  gt    WORD_VAR    gt    DWORD_VAL  gt         gt  ERROR  DWORD       gt  ERR_CODE    Input description    Label Type Description Range    MEM_ADDR no location to be copied 0     43000       0   TO_BYTE   DATATYPE Selection of the desired output data 1  TO_WORD     type  num  2   TO DWORD    8 bit notation value to be copied at  AGILI the desired memory location  num     16 bit notation value to be copied at  WORDEVAL   WORD the desired memory location  num   32 bit notation value to be copied at  BORE aE WORD the desired memory location  num   Output description    ERROR  BOOL  Evorstatus     ERR_CODE  DWORD   Error code  bit mask   16 00 00 00 00     16 FF FF FF FF    This function block performs a copy of a specific data   type value at the desired  valid memory location  The format selected as input data   types refers to the  basic bit mask notation of the data  It needs then to be converted from the original  enumerated data   type  e g  if USINT into BYTE or if INT into WORD or if REAL  into DWORD  etc      Default Values                Input Default Value  MEM_ADDR  DATATYPE  BYTE_VAL  WORD_VAL    DWORD_VAL                Reference Table    Output Description    ERR_CODE 0 Memory location out of rang
93. ocess  is aborted if the timeout expires  The query and response process can also be  intentionally aborted by calling the Function Block with the Rest input set to TRUE           46    3 4 2    FB Prototype    Description    MODBUS _MASTER_STATUS    Chapter 3   Serial communications    Function Block using the Latch and Time functions of the DI 16LV module   MODBUS_MASTER_STATUS       USINT  USINR  USINT  USINT       STATUS  DATAREC  EXCODE  OPRS    Output description                   Label   Type Description Range  Datarec   USINT   Number of bytes received  Excode   USINR  Modbus protocol error code  Oprs USINT   Function Block Execution Result  0 1 4 8 16  see description   Status  USINT   Communication Status 0 1 2 3 4  see description                    Each time the Function Block is executed  all parameters which store the agent status  are reset so that the result returned by the Function Block can be observed as an indi   cation of what has occurred in the period between the last and the current calls    The comparative status and oprs analysis can be used to assess the overall status of  the agent  The Status parameter can acquire the following values associated to the  following meanings        Value Meaning  No operation   OK  Transaction in progress    0  1  2 Available data  3  4             Timeout expired  Agent error event                The Oprs parameter can acquire the following values     Value Meaning  No operation   OK   Port not available   Timeout e
94. odbus address    e Reading 16 bit groups starting from a definite address of the memory area dedi   cated to the digital I O    e Writing a single bit and indicating the corresponding Modbus address     MODBUS_GET_SLAVE_DATA  Function Block for data group reading the memory area dedicated to slave registers     MODBUS_GET_SLAVE_DATA    SLAVE_ID  gt    USINT ARRAY 1   8  OF DWORD       gt  OUT_1  ADDRESS       UINT ARRAY 1    16  OF WORD       gt  OUT_2  USINT       gt  OPRS       Input description                                     Label Type Description Range  SLAVE_ID USINT Agent in question  slave 1 or slave 2    1  2  ADDRESS UINT Starting address 1  4081  Output description   Label Type Description Range  OUT_1 ARRAY 1    8  OF DWORD   16 register vector in 4 bytes  OUT_2 ARRAY 1    16  OF WORD   16 register vector  OPRS USINT Execution result 0  1 2 3 4                Function Block enabling  given a definite initial memory address of register zone   two output vectors holding     e the values of 16 consecutive registers starting from the initial address  The  vector holds therefore 16 elements with 2 bytes each     e the values of 16 consecutive registers starting from the initial address in 4   byte groups  The vector holds therefore 8 elements with 4 bytes each     As the maximum register number is 4096 for each slave  the allowed address  interval ranges from 1 to 4081     The OPRS parameter can acquire the following values                 Value Meaning  0 Block ex
95. ode  and assign  to the POS output the  N TPOS value        Sigmadue   Function Block Firmware Library    1 4 6 CTRL_SRV_POS  FB Prototype CTRL_SRV_POS    MV  gt    POT     gt   TTRAVEL  gt   DBND     gt    HY  gt    DLY     gt   CLOSE_TIGHT     gt   OFR_LIM  gt   LOW_POT     gt   HIGH_POT     gt   RESET  gt   ERR_MODE     gt   ERR_BAND  gt     OPEN  CLOSE  ERR_STS  ERR_CODE  OFR_N    44444       Input parameters    THERET  aamited ange 0 0  1000  a  s   admitted range 0 1     600 0     Dead band      admitted range 0 0     100 0    default value   0 5     Band value used to consider the target reached       admitted range 0 0     100 0   default value   0 2     Delay between 2 opposite commands  s    admitted range 0 1     100 0   default value   0 1     Output maintained band      GLOSELIIGHIE  admitted range 0 0     100 0   default value   0 0     OFR LIM Potentiometer Out of Range maximum occurrences limit  T  num   admitted range 0     65535   default value   0     Potentiometer Low limit  num   POWER  admitted range 0     65535   default value   0 0     Potentiometer High limit  num   admitted range 0     65535   default value   100 0     BOOL  Error conditions Reset  default value   FALSE     Outputs behavior in Error mode  num     admitted range 0     2   default value   0    Out of Range Error band        admitted range 0 0     100 0   default value   0 0                       HIGH_POT                Output parameters     Output  Type Deserisioo    OPEN BOOL  Open va
96. on result for the  entire network       NETWORK_STATUS  WORD          The device status contains an array of word index that contains  for each  information  about the modules found at the corresponding addresses  The information is encoded  in bits in the table below     Information Code    Module not present and not expected from the image in memory  0x0000  Present and corresponding to the image module in memory 0x0001  Present form  but for Different Mapping 0x0002  Present form  but for Different Identities 0x0004  Module present  but not provided by the image in memory 0x0008  Module not present  but expected from the image in memory 0x0010                   Network_status for the legend of the output status is as follows     Information Code    Network identical to the image in memory 0x0000    Network identical to the presence of all modules with the expected  waiting identity but different mapping    Network identical to the presence of all forms  but some elements    0x0001       0x0002    do not match for identity  Network mismatch 0x0004  No network in memory 0x0008  roblems during network scan 0x0010  Module not present  but expected from the image in memory 0x0010                The presence of modules that are not shown in the image of network you have in mind  is ignored for the purposes of carrying identity between this network and the network of  which you have a picture  To be clear if the network this has all the modules with the  same identity and the sam
97. out parame   ter  as explained above  communicates the maximum interval between two con   secutive queries to the agent  If this interval is exceeded  the agent does not  modify its operation  but simply indicates that the timeout has expired the next  time the Function Block MODBUS_SLAVE_STATUS is called  To evaluate the  timeout  the counter starts at the end of the execution of current Function Block  and is reset every time a new query is received        37    Sigmadue   Function Block Firmware Library    3 2 2    FB Prototype    Description    MODBUS_SLAVE_STATUS  Function Block checking the status of the Modbus agent     MODBUS_SLAVE_STATUS    CHANNEL       USINT USINT       gt  OPRS  USINT       gt  STATUS    Input description                   Label Type Description Range  Channel   USINT Agent in question  Slave 1 or Slave2    1 2  Output description   Label Type Description Range  Oprs USINT Function Block Execution Result  0  1  4  8  see description   Status   USINT Communication Status 0  1  2  3  see description                 Each time the Function Block is executed  all parameters which store the agent sta   tus are reset so that the result returned by the Function Block can be observed as an  indication of what has occurred in the period between the last and the current calls     The comparative status and oprs analysis can be used to assess the overall  status of the agent  The status parameter can acquire the following values  associated to the following m
98. own       cmd_aux  aux_val                                        l10       CTRL_MV    MV OUT  DTRK DBMP  TRK   DAM   UP   DOWN   AM_SL   DAUX   AUX       CTRL_TPO                                                          a                   Chapter 2  MODBUS TCP IP    The Ascon CPU modules implement a Modbus TCP IP Server agent which can be  configured and accessed in the OpenPCS programming environment  It is also  possible to partially configure the agent during the configuration session run when  the CPU is started up with the VT100 terminal  The Modbus TCP IP agent can be  accessed externally over the Ethernet network via the unit 10 base T port  In the  system FW  the Modbus TCP IP protocol activities have an execution interval of  100 ms  This means  for instance  that a client running a query must allow for a  response timeout of no less than 100 ms  The Modbus TCP IP agent can handle  up to 10 TCP IP connections at a time  It is also possible to set a parameter which  determines the maximum number of processable messages per cycle  so that any  additional messages are processed by the next cycle  The user can also define two  groups of IP addresses  The first group is called the    priority connection pool      which constitutes the set of addresses whose connections will not be terminated  when the system receives a request for a new connection and the 10 available  connections are already all occupied  The second group is the    security address  pool     which is t
99. pics and applicable national standards     The functions in OpenPCS made available by Ascon hardware can be  managed through the Infoteam product  which enables a procedure to define  Function Blocks to be directly used in the IEC61131 3 programming  environment and to be executed by calling a function implemented in the  firmware on the CPU card  These Function Blocks for example will enable to  manage communication through the auxiliary serial ports according to Modbus  protocol or to use the I O digital ports on the cards     Using this manual    Specifications within the text of this manual are given in the International  System of Units  SI   with non SI equivalents in parentheses     Fully Capitalized words within the text indicate markings found on the equipment     Words in bold style within the text indicate markings found in the Configuration  Tools     Warnings  Cautions and Notes are used to emphasize critical instructions     DANGER     Indicates an imminently hazardous situation which  if not avoided  will result in  death or serious injury     WARNING    Indicates a potentially hazardous situation which  if not avoided  could result in  death or serious injury        vii    ASCON libraries    A    Note     Purpose    A    Caution  Indicates a potentially hazardous situation which  if not avoided  may result in  minor or moderate injury  or property damage     Highlights important information about an operating procedure or the equipment     The present document
100. port  X1  RS232 RS485 port  X0           RS232 port  X3  RS485 port  X1   RS485 port  X4                    The following numbers classify the protocols that are valid for both CU 02 and MP 01     0  ASCII serial communication  1  Slave 1  2  Slave 2  3 Master       30    Chapter 3   Serial communications    3 1 1 OPEN _ SERIAL COMM  Function Block enabling to initialise a port     FB Prototype OPEN_SERIAL_COMM    PORT  gt   BAUD     gt   PARITY  gt   DATA  gt   STOP  gt   PROTOCOL     gt         gt  OPRS       Input description       Label Type Description Range  CU 02 Serial port selection variable 0 1 2  MP 01 Serial port selection variable 0  1       Port USINT                                     Baud USINT   Communication baud rate  see table   O  1 2  3 4 5 6  0  none   Parity USINT   Parity bit configuration 1  Even   2  Odd  Data USINT   No  of bits 7 8  Stop USINT   Number of stop bits 1 2  0  Serial ASCII  1  Slavel   Protocol  USINT   Port protocol 2  Slave2  3  Master  Output description  Label Type Description Range  0  Ok   1  port not available   Oprs USINT Execution Result 2  protocol not available   3  invalid configuration   4  non existent protocol                   Description This function configures the serial communication port and also sets the protocol  to be used on it  The following table links the baud rate value to be entered in the  function block with the set baud rate     Baudrate             19200  38400  57600  115200                      31 
101. ption Setting the input ACQUIRE to TRUE it is possible to run the command to capture    and save the network image  Recalling the function block with the ACQUIRE  value set to FALSE erases from the memory a memory dump prebviously saved        59    Sigmadue   Function Block Firmware Library    FB Prototype    Description       When you want to scan the image of the current network  it is not necessary to  erase the memory image currently stored    The 5 return arrays of this function block contain the identity information of the  modules found on the network during the autolearn    All the array elements correspond to the module with address equal to the index  if an  identity field is not implemented it will be filled with ZERO  The SAVED_DEVICE  array  in particular when has value TRUE  indicates that at a particular address  there  is a module connected or if it has value FALSE  that no modules have been detected     CANOPEN_DEVICE_COMPARE    It compares the characteristics of an I O module already recognized and saved by  the system  between the two network images  flash and RAM memory      CANOPEN_DEVICE_COMPARE    EN       BOOL BOOL       gt  ENO  ENABLE       BOOL BOOL       gt  CONFIRM  DEVICE       BYTE WORD       gt  ERROR    DWORD     ERR_INFO    Input description    Label _  Type    BOOL  Enable In TRUE FALSE       BYTE  Address of the device to be analyzed       Output description    Label Type Description Range    Enable Out TRUE FALSE  STATUS  WORD  Result of 
102. rk  requested FALSE   Compared Network  Defines which part of the   LE i TRUE   TPDO  communication information FALSE   RPDO  necessary to pass    Enable In TRUE FALSE                   Enable Out    PDO index  ARRAY OF WORD   oxFFFF no PDO     ARRAY OF DWORD  COB_ID of the mapped PDOs    Trasmission Type  cna OD nie of the mapped PDOs    ARRAY OF DWORD  Mapping of the objects in PDOs  ARRAY OF DWORD  Mapping of the objects in PDOs  ARRAY OF DWORD  Mapping of the objects in PDOs  ARRAY OF DWORD  Mapping of the objects in PDOs  ARRAY OF DWORD  Mapping of the objects in PDOs  ARRAY OF DWORD  Mapping of the objects in PDOs  ARRAY OF DWORD  Mapping of the objects in PDOs  ARRAY OF DWORD  Mapping of the objects in PDOs  WORD Function block execution result                                           Each of the output arrays is composed of 4 elements  The field OPRS must be interpreted according to the following table     Recovered data valid 0x0000    Device address not valid 0x0001  Requested source not available 0x0002             61    Sigmadue   Function Block Firmware Library    4 1 4    FB Prototype    4 1 5    FB Prototype       CANOPEN_GET_DEVICE_ID    Using this Function Block is possble to obtain the identity information of a module in  the same form saved by the system  to obtain these information the system uses the  Function Blocks  CanOPEN_Network_Compare  and  CanOPEN_ Autolearn      l e   you can obtain identity data from a module from the network image stored in  m
103. ry which is thus  always active  Two function blocks  RTC_SETUP and RTC_GET_VALUES  are  used to configure and read the clock  The clock sets the time and date as follows    e Seconds   e Minutes   e Hours   e Day of month   e Day of week   e Month   e Year     The clock only stores the last two digits of the year  Hence  the year 2008 is  expressed as the number 8     7 1 Description of the individual Function Blocks    7 1 1 RTC_GET_VALUES                         FB Prototype RTC_GET_VALUES       SECONDS       MINUTE     HOUR       gt    MONTH_DAY       gt  WEEK_DAY       MONTH       YEAR  Output description   Label Type Description Range   Seconds USINT Actual seconds read 0    59  Minute USINT Actual minutes read 0    59  Hour USINT Actual hours read 0    23  Month_day   USINT Actual day of month read 1   31  Week_day  USINT Actual day of week read 1   7  Month USINT Actual month read 1   12  Year USINT Actual mear read 00    99                      Description This function block can be used to verify the Real Time Clock date and time val   ues available within the sigmadue CPU models        95    Sigmadue   Function Block Firmware Library    7 1 2 RTC_SETUP                   FB Prototype RTC_SETUP  SETUP  gt   SECONDS  gt   MINUTE  gt   HOUR     gt   MONTH_DAY  gt   WEEK_DAY  gt   MONTH  gt   YEAR  gt   Input description  Label Type Description Range  Setup BYTE   Mask defining the data to be set  bit  16 00    16 7F  Seconds USINT   Seconds to be set  num  su 59  Minut
104. s can be maintained at the same time  by the Modbus TCP IP Server agent  When all available connections are  occupied  the system must make a choice when a new connection is requested   Based on the principle that every new connection request must be satisfied  a  process must be implemented which selects the connection to be closed to make  room for a new one  The first candidates for disconnection are all those addresses  which DO NOT belong to the    priority connection pool     The selection is further  refined by identifying the connection which has been longest inactive     Application example of the Modbus TCP IP Server agent   This section describes the code of a simple application which initialises the  Modbus TCP IP Server agent and periodically increments the value of 4 registers  which can be read by a client  The example also shows the call to other Function  Blocks controlling the agent        26    2 1 9    2 1 10    Chapter 2   Modbus TCP IP    Global application variables  The program tasks share a number of global variables which are code declared  as follows     VAR_GLOBAL    init_port_mb_tcp  BOOL    true   error_mb_tcp  BOOL   END_VAR       The variables init_port_mb_tcp and error_mb_tcp check that the initialisation  Function Blocks are only called once  while the others are called only if the  initialisation has terminated successfully     HW port initialisation  This task initialises the agent  The task code variable declaration  and executable code ar
105. s therefore no longer  available to the system     OTHER  With the exception of the state values UNKNOWN and NOT_AVAIL  the return values match the corresponding definitions of the CiA  Draft Standard 301     The call of the function block with DEVICE   0 delivers the local node state of the  local PLC        68    Chapter 4   CanOPEN    4 1 14 CAN_PDO_READ8  Function block for reading a node   s object entries by way of an SDO transfer   CAN_PDO_READ8    FB Prototype    Description       CONFIRM  ERROR  ERRORINFO  DATAO   DATA1   DATA2  DATA3  DATA4  DATAS  DATA6  DATA7  DATALENGTH    COBID  gt   ENABLE      NETNUMBER     gt     SISKSIKIKKKAK       Input description  Description    COBID of the message to be newly entered into  registration or to be erased from the registration    BOOL  Input for enabling or locking the function block  NETNUMBER  USINT  Network number    Output description    UINT                   Description   Output for signal service completion by the function block   Error code corresponding to data type  ERROR WORD l   C1A405 CANOPEN  KERNEL ERROR   ERRORINFO  DWORD  Reserved for additional error information  Data byte of the received CAN message  Data byte of the received CAN message  Data byte of the received CAN message  Data byte of the received CAN message  Data byte of the received CAN message  Data byte of the received CAN message  Data byte of the received CAN message  Data byte of the received CAN message  DATALENGTH  USINT  Length of the rece
106. t     NETNUMBER     gt        Input description    Description  DEVICE Address of the node to be read  INDEX Number of the index entry to be read                   SUBINDEX Number of the subindex entry to be read       76    Description    4 1 23    FB Prototype       Chapter 4   CanOPEN       Type of the SDO transfer mode to be used  corresponding to the data type  CAN_SDO_TYPE     BOOL    Input for enabling or locking the function block  STRING  String variables for storing the read characters    Limit to the number of characters to be read  with 0 the  INT buffer length of the transmitted string is calculated internally  and used as a limt to the number of characters to be read    SDOTYPE USINT                Description    BOOL  Output for signal service completion by the function block    Error code corresponding to the data type     CIA405_CANOPEN_KERNEL_ERROR       SDO abord code of the communication partner  corresponding to the data type    CIA405_SDO_ERROR       RXDATA STRING  String variables for storing the read characters  RXLENGTH Length of the character sequence read    The function block CAN_SDO_READ_STR is used to read the strings from a node s  Object Dictionary utilizing SDO transfer  The SDO transfer is always executed in the  background  thus the procedure described in section 4 1 3 for synchronization  between the function block and the PLC program has to be applied while using both  parameters ENABLE and CONFIRM  If the output CONFIRM is set to TRUE upo
107. t    UINT       Input description                Label Type Description Range  IP_ADDR STRING Client IP address  CLIENT_PORT UINT Client port  SERVER_PORT UINT Server port             Output description       Label Type Description Range       Connection   USINT Communication Position   0   9   0  Ok   1  Server not available  2  Invalid IP address  4  Inactive connection       Oprs USINT Execution Result                   This Function Block indicates the presence of the connection uniquely defined by  three input parameter values in one of the 10 available positions        22    2 1 5    FB Prototype    Description    Chapter 2   Modbus TCP IP    MB_TCP_GET_CONN_CONFIG  Function Block reporting the characteristics of an active connection in one of the  10 available positions     MB_TCP_GET_CONN_CONFIG    CONNECTION     gt  STRING IP_ADDR  UINT CLIENT_PORT  UINT SERVER_PORT  USINT OPRS       Input description       Label Type Description Range       CONNECTION   USINT Connection whose configuration is to be    recovered 0   9             Output description                      Label Type Description Range  IP_ADDR STRING Client IP address  CLIENT_PORT   UINT Client port  SERVER_PORT   UINT Server port  0  Ok  Oprs USINT Execution Result 1 1  2  No connection             This Function Block indicates whether the position specified by the input connec   tion is currently occupied by an active connection or not  Furthermore  if the con   nection is active  it reports the three 
108. tecnologic com sales ascontecnologic com       INDEX    Note  The Digital Inputs and Outputs of the MP 01 Control Unit are explained in the     MP 01 User Manual       Preface rie bella vii  Chapter 1   AsconCTRLFb Embedded                               1   Wal   PUIPOSE  erine banta a ce Aa eee 1   152   DESCHIBIOM spl er rr ae oe chee hie eet eas Mite oe 1   13  RID  mplementationi asides josie elia ao age ares Boar 1   1 4 Description of the individual Function Blocks                     4   1 4 1 CTRE PID  ost puntan teeta Phe toes eten 4   1 4 2 A Soe ted are ese Ge ate Aa 6   1 4 3 GERESHOMV siria sa ats Re Mahe aes 7   1 4 4 CTRESSPLEMV axes ented zona rene dei ele ELA 9   1 4 5 CTRL SAY  gt  e ai Li aa dea 11   1 4 6 CTRLESSRV POS ire eri 12   1 4 7 CTRL TRO sr an 14   i Example taski ssaa toi fai Leave 15  Chapter 2   MODBUS TCP IP 0  Aa 16   2 1 Modbus TCP IP Server agent                     17   2 1 1 ENABLE _MODBUS_TCP_SERVER                    20   2 1 2 CLOSE_MODBUS_TCP_SERVER                     20   2 1 3 MB  TCP  CONN USTATUS     cic veo She dwell ot aces 2 21   2 1 4 MB_TCP_GET_CONN_BY_ADDR                     22   2 1 5 MB_TCP_GET_CONN_CONFIG ira 23   2 1 6 MB_TCP_CLOSE_CONN              0s 24   2 1 7 Configurations using the Terminal VT100 initial setup session   25   2 1 8 Application example of the Modbus TCP IP Server agent    26   2 1 9 Global application variables                  27   2 1 10 HW port initialisation LL 27   2 1 11 Example code ariana 2
109. ted output  of the Cool PID module   Value in  0 0     100 0   default value   0 0   Deadband  with range from   10 0      10 0   DAND EAL  default value   0 0   DTRK BOOL   Digital Tracking Command  default value   FALSE   TRK REAL   Tracking signal   100 0   100 0   default value   0 0   DAM BOOL   Digital AutoMan Command  default value   FALSE   UP BOOL  Manual Up Command  default value   FALSE   DOWN BOOL   Manual Down Command  default value   FALSE   AM_SL REAL   Manual Delta Value  default value   0 1   DAUX BOOL   Digital Auxiliary Command  default value   FALSE   AUX REAL   Auxiliary Signal   100 0   100 0   default value   0 0   Output parameters  Label Type Description  OUTH REAL _   Control Output for HEAT  0 0     100 0   default value   0 0   OUTC REAL   Control Output for COOL  0 0     100 0   default value   0 0   Control Output for visualization   100 0     100 0   OUTAG PERL  default value   0 0   DBMP BOOL  BUMPLESS command  default value   FALSE   Active if both OUTH and OUTC are active  OVERLAP   BOOL    default value   FALSE                    This module is an Output station for an Heat Cool loop  providing the functionali   ties the operator needs to interact with the loop  The loop is controlled by two  PIDs  connected downstream to this module  each one is dedicated to one chan   nel  The module provides auto manual track aux operating mode  and the com   mands for incrementally set the output  The operating modes  that are unique for  both the Cool a
110. the module comparison  OPRS WORD   Function block execution result                   The device status contains a word with the information of the comparison between  the analized module and the image saved in flash memory  The information is  coded using the bits as explained in the table that follows     Information Code  Module present and correspondent to the image memory 0x0001  Module present  but different for mapping 0x0002  Module present but different for identity 0x0004  Module present  but not expected by the image in memory 0x0008    Module not present  but expected by the image in memory 0x0010                   60    Chapter 4   CanOPEN    4 1 3    FB Prototype    Description       CANOPEN_GET_DEVICE_COM_PAR    If used in conjunction with  CanOPEN_Network_Compare  and  CanOPEN_Autolearn    it returns the I O module mapping information stored by the previously by the system   It should be used after the network scan has been saved into the memory     CANOPEN_GET_DEVICE_COM_PAR    EN     BOOL  DEVICE  gt  ARRAY OF WORD  SOURCE     gt  ARRAY OF DWORD  PDO TYPE     gt  ARRAY OF BYTE  ARRAY OF DWORD   ARRAY OF DWORD   ARRAY OF DWORD    ENO  PDO_NUM  COB_ID  TRASM_TYPE  MAP1  MAP2  MAP3  MAP4  MAP5  MAP6  MAP7  MAP8  OPRS    ARRAY OF DWORD  ARRAY OF DWORD  ARRAY OF DWORD  ARRAY OF DWORD  ARRAY OF DWORD   WORD    Vebddbdditddy       Input description    Type Description Range  Enable In TRUE FALSE  Enquired Device    Source of the information  TRUE   Autolearned Netwo
111. trol communications with the slaves connected to the modbus network        One important consideration must be borne in mind when using the modbus  master agent  When calling MODBUS_MASTER_EXECUTE function  one of the  supported modbus functions must be assigned as a parameter  Thus  the agent  interprets the byte sequence to be read from the Input Data memory area or to be  placed in the Output Data Memory Area  If a function is assigned which processes  registers  the two input and output memory areas are interpreted as follows     ERE Input Area Output Area  First register involved in communication  IW1000 0  QW1000 0  Second register involved in communication    IW1002 0  QW1002 0    Third register involved in communication  1W1004 0  QW1004 0    Fourth register involved in communication  1IW1006 0  QW 1006 0    If instead a function is assigned which processes individual bits  the two input and  output memory areas are interpreted as follows              Input Area Output Area  Syntax Syntax    First bit involved in communication  1X1000 0  QX1000 0    Description       Second bit involved in communication  IX1000 1  QX1000 1  Third bit involved in communication  1X1000 2  QX1000 2  Fourth bit involved in communication  1X1000 3  QX1000 3             The programmer is completely responsible for properly filling the output data area  before sending a message and reading the input data area after the transaction is  completed  The programmer can use the function block  MOD
112. type    Description    Function block for sending PDOs and CAN Layer 2 messages throught the  network layer     CAN_PDO_WRITE8    CONFIRM  ERROR  ERRORINFO  DATAO   DATA1   DATA2   DATA3   DATA4   DATAS   DATA6   DATA7  DATALENGTH    COBID     gt   ENABLE     gt   NETNUMBER        SIIKSIKIKKK4K       Input description    Description    COBID of the message to be newly entered into  CORID ai registration or to be erased from the registration       ENABLE BOOL Input for enabling or locking the function block       NETNUMBER   USINT  Network number             Output description    Label  CONFIRM Output for signal service completion by the function block       ERROR Error code corresponding to data type     CIA405_CANOPEN_KERNEL_ERROR       Reserved for additional error information       Data byte of the received CAN message       Data byte of the received CAN message       Data byte of the received CAN message       Data byte of the received CAN message       Data byte of the received CAN message  Data byte of the received CAN message       Data byte of the received CAN message       Data byte of the received CAN message          Length of the received CAN message    The function block CAN_PDO_READ8 is used to read PDOs and CAN Layer 2  messages from the receiving buffer of the network layer  Only one access of the  message registered with the help of the function block CAN_REGITER_COBID is  supported  If multiple messages with the same COBID are received between two  sequentia
113. v  Ascon _ _Sigmadue CU 02  amp  MP O1   Ovi  TECNOLOGIC Firmware Function Blocks Library    Function Block Library     Cosa M U  CU02 FFBL 06 11 05    Cod  J50   636     1ACU02   E          Copyright    2007  2011 Ascon Tecnologic Srl    All rights reserved    No part of this document may be stored in a retrieval system  or transmitted in  any form  electronic or mechanical  without prior written permission of Ascon  Tecnologic Srl     Ascon has used the best care and effort in preparing this manual and believes  that the information contained in this publication is accurate    As Ascon Tecnologic continues to improve and develop products  the information  contained in this manual may also be subject to change  Ascon Tecnologic  reserves the right to change such information without notice    Ascon Tecnologic makes no warranty of any kind  expressed or implied  with  regard to the documentation contained in this manual  Ascon Tecnologic shall  not be liable in any event   technical and publishing error or omissions   for any  incidental and consequential damages  in connection with  or arising out of the  use of this manual     sigmadue    gammadue   and deltadue    are trademarks of Ascon Tecnologie Srl     All other trade names or product names are trademarks or registered trademarks     Ascon Tecnologic srl    Headquarters  via Indipendenza 56  Milan office  Via Falzarego 9 11   27029 Vigevano  PV  20021 Baranzate  MI   Phone  39 02 333 371 Fax  39 02 350 4243    www ascon
114. values which uniquely identify it  namely   Client IP address and port and Server port        23    Sigmadue   Function Block Firmware Library    2 1 6 MB_TCP_CLOSE_CONN  Function block closing one of the 10 active connections     FB Prototype MB_TCP_CLOSE_CONN    CONNECTION       USINT USINT       gt  OPRS    Input description       Label Type Description Range                CONNECTION USINT Connection to be closed 0  9       Output description       Label Type Description Range       0  Ok   1  Server not available  2 No connection   4  Inactive connection    Oprs USINT Execution Result                   Description This Function Block closes the connection associated with one of the 10 available  positions        24    2 1 7    Note     Chapter 2   Modbus TCP IP    Configurations using the Terminal VT100 initial setup session   The VT100 terminal is used in the initial configuration session to specify the group  of addresses making up the    priority connection pool    and the    security address  pool     Two other parameters  controlling the execution of the Modbus TCP IP  Server agent  can also be configured  the number of messages processable per  cycle and the TCP connection idle time after which the connection is closed     The Control Unit configuration session is described in the    User Manual specific  for the CPU model in use   The main configuration menu is shown in the picture below     Ascon S p a     SigmaPAC Control Unit    Device configuration    MAIN MEN
115. xpired    0  1  2  4 CRC error  8  1                Exception  6 Error  see ExCode                The conditions coded by the status parameter are not mutually exclusive  i e  a  condition may occur in which a timeout has expired but a new memory value has  also been updated  For this reason  the diverse conditions have been coded  according to increasing priority  The condition with value 4 has the highest priority   therefore  if such condition occurs  it will be surely indicated while possible lower  priority conditions will not        47    Sigmadue   Function Block Firmware Library    3 4 3    3 4 4    3 4 5    Application example of the modbus communication port   This section describes the code of a simple application which controls two serial  ports  one of which is configured as a master and the other as a slave  The  program is divided into 3 tasks  one to initialise the ports  one to execute the  master activities and one to execute the slave activities  The slave task must  cyclically assign 5 different values to 5 registers  while the master task must  acquire the content of the five registers via modbus protocol and compare them  with the values they should have according to the slave operations  If the values  read in the registers and those assigned by the slave are the same  the master  increments a counter and goes to the next step     Global application variables  The program   s tasks share a number of global variables which are code declared  as follows  
    
Download Pdf Manuals
 
 
    
Related Search
    
Related Contents
Brochure  RAV232 Rako RS232 to Rakom RF Interface  Administrator`s Manual  Pelco FR85081 Satellite Radio User Manual  乳房用X線装置及び乳房撮影定位装置−安全について JIS Z 4751-2  Nady Systems DKW User's Manual  D-Link DHP-328AV/E    Sencor SDF 1270 digital photo frame    Copyright © All rights reserved. 
   Failed to retrieve file