
Programming Examples for FPWIN Pro
52
5.5 Programming Example, FP-FNS Block ProfibusDP
After you install the FNS Library, you can start programming.
1. Create the Data Unit Types (DUTs) for inputs and outputs.
2. Create input and output variables of the type of DUT generated in the previous
step in the global variable list.
3. Generate the configuration data table for inputs and outputs by using the function
FNS_InitConfigDataTable (see page 49). Make sure that the size of the
FNS_InitConfigDataTable output variable corresponds to the DUT.
4. Create pointers of the input, output and
ConfigDataTable
variables and provide
them to the FNS_ProfibusDP function block together with the corresponding
variables.
Data Unit Types (DUTs)
In the following picture you can see all possible data types and how the different variables
(16-bit, 32-bit and 64-bit) can be defined.
64-bit variables are declared by creating a two-dimensional array, whereas the second
dimension must have a size of four. The first dimension specifies the number of elements of
this type.
In this programming example both variables, the input and output process data, consist of
three elements: a 16-bit, a 32-bit and a 64-bit variable:
Summary of Contents for FPSIGMA
Page 1: ...programmable controller FPS FP2 Fieldbus Slave Units Technical Manual ...
Page 7: ......
Page 8: ...Chapter 1 Features and Restrictions ...
Page 11: ......
Page 12: ...Chapter 2 Parts and Functions ...
Page 14: ...FP2 FNS Unit 13 2 2 FP2 FNS Unit ...
Page 25: ......
Page 26: ...Chapter 3 Specifications ...
Page 32: ...Chapter 4 Installation and Wiring ...
Page 48: ...Chapter 5 Programming Examples for FPWIN Pro ...
Page 84: ...Chapter 6 Outline Dimensions ...
Page 85: ...Outline Dimensions 84 6 1 Outline Dimensions of FP2 FNS Unit ...
Page 86: ...Outline Dimensions of FPΣ FNS Unit 85 6 2 Outline Dimensions of FPΣ FNS Unit ...
Page 87: ...Outline Dimensions 86 6 3 Dimensions of the FP FNS Blocks ...