Siemens Commissioning PC Stations C79000-G8976-C156-07 User Manual

Page 78

Advertising
background image

6

Using the CP 1616 as a PROFINET IO Controller/Device

78

Commissioning PC Stations - Manual and Quick Start

Release 5/2005

C79000-G8976-C156-07

6.4

installing the PROFINET IO Sample Program
(Suse Linux 9.2)

The “pniotest” sample program is restricted to the use of the CP1616 as controller.

Follow the steps outlined below

1.

Run the “make test” command in the “/host - xxx/” (xxx = version - specific) directory.

2.

Run the “./pniotest“ command in the “/host - xxx/testapps/” directory to start the program.

3.

Settings:

Set the number of modules in pniotest.c in the /host - xxx/testapps/ path.

const PNIO_UINT32 g_deviceInputCount=3;

volatile PNIO_IOXS g_deviceInputState[g_deviceInputCount]=
{PNIO_S_BAD,PNIO_S_BAD,PNIO_S_BAD};

PNIO_UINT32 g_deviceInputLength[g_deviceInputCount] ={ 1, 1, 1};

PNIO_ADDR g_deviceInputAddress[g_deviceInputCount]=

{
{ PNIO_ADDR_LOG, PNIO_IO_IN, 0},
{ PNIO_ADDR_LOG, PNIO_IO_IN, 1},
{ PNIO_ADDR_LOG, PNIO_IO_IN, 2}
};

"

Number of input

modules

"

One PNIO_S_BAD per

input module

"

One “1“ per input

module

"

Address of 1st input

module

"

Address of 2nd input

module

"

Address of 3rd input

module

These settings must also be made for the output modules.

const PNIO_UINT32 g_deviceOutputCount=3;

volatile PNIO_IOXS g_deviceOutputState[g_deviceOutputCount]=
{PNIO_S_BAD,PNIO_S_BAD,PNIO_S_BAD};

PNIO_UINT32 g_deviceOutputLength[g_deviceOutputCount] ={ 1, 1,
1
};

PNIO_ADDR g_deviceOutputAddress[g_deviceOutputCount]=

{
{ PNIO_ADDR_LOG, PNIO_IO_IN, 0},

{ PNIO_ADDR_LOG, PNIO_IO_IN, 1},

{ PNIO_ADDR_LOG, PNIO_IO_IN, 2}
};

"

Number of output

modules

"

one PNIO_S_BAD per

output module

"

One “1“ per output

module

"

Address of 1st output

module

"

Address of 2nd output

module

"

Address of 3rd output

module

Advertising