
262
Manual – IPOSplus®
18
State machine, fieldbus control with emergency mode
Compiler – Examples
/*===================================================
Operating mode is selected with input terminals
DI10 and DI11 and indicated at the outputs
DO10 and DO11.
The following operating modes are possible:
Mode 0: Control and setpoint via field bus
Mode 1: Control via field bus, setpoint added to
analog value 1
Mode 2: Control via terminals, setpoint analog 1
Mode 3: reserved
SHELL settings:
P100 Setpoint source: BIPOL./FIX.SETPT
P101 Control signal source: TERMINALS
P600 ... P604 Binary input DI01 ... DI05: NO FUNCTION
P610 / P611 Binary input DI10 / DI11: IPOS INPUT
P630 / P631 Binary output DO10 / DO11: IPOS OUTPUT
P700 Operating mode 1: ... & IPOS
P870 ... P872 Setpoint description PO1 ... PO3: IPOS PO-DATA
P873 ... P875 Actual value description PI1 ... PI3: IPOS PI-DATA
P876 PO data enable: ON
===================================================*/
/*===================================================
IPOS Source file
===================================================*/
#include <constb.h>
#include <iob.h>
#pragma globals 350 399
// Definition of structures
GSPODATA3 busdata; //structure for fieldbus process data
GSAINPUT analog; //structure for analog values
// Definition of variables
#define modeselect ((InputLevel > > 6) & 0x00000003)
#define setfixedsetpoint _SetSys( SS_N11,speed )
#define activatefixedsetpoint _BitSet( ControlWord, 4 )
#define deactivatefixedsetpoint _BitClear( ControlWord, 4 )
#define enable _BitClear( ControlWord, 1 )
#define rapidstop _BitSet( ControlWord, 1 )
// Declaration of variables
long mode, speed, offset;
P
i
f
kVA
Hz
n
P
i
f
kVA
Hz
n