Manual – IPOSplus®
257
18
SCOM communication
Compiler – Examples
18.7.2 Sender
The variables H208 and H209 are transmitted cyclically every 10 ms to another inverter.
The values of H208 and H209 can be changed using input DI17.
DI17 = 0: H208 = 111111 / H209 = 222222
DI17 = 1: H208 = 222222 / H209 = 444444
Task 2 is not implemented in this sample program.
/*=========================================
Variables H208 and H209 are sent cyclic
every 10 ms to another inverter via SBus.
The values of H208 and H209 can be altered
with input DI17.
DI17 = 0: H208 = 111111 / H209 = 222222
DI17 = 1: H208 = 222222 / H209 = 444444
SHELL settings:
P813 SBus Address -> 1
P816 SBus Baudrate -> 500 kBaud
=========================================*/
/*=========================================
IPOS Source file
=========================================*/
#include <constb.h>
#include <iob.h>
// Definition of SCOM structures
SCTRCYCL tBusTr;
// Definition of variables
#define Data_Var1 H208
#define Data_Var2 H209
/*=========================================
Main program
=========================================*/
main()
{
// Initialization of SCOM transfer object
tBusTr.ObjectNo = 1025; // object number
tBusTr.CycleTime = 10; // cycle time
tBusTr.Offset = 0; // offset
tBusTr.Format = 8; // 8 byte
tBusTr.DPointer = numof(Data_Var1); // data buffer
tBusTr.Result = 1111; // default value for control
// Initialize variables
Data_Var1 = 111111;
Data_Var2 = 222222;
// Start SCOM
_SBusCommDef( SCD_TRCYCL,tBusTr );
_SBusCommState( SCS_START1 ); // Start cyclic communication MOVIDRIVE B
// _SBusCommOn( ); // Start cyclic communication MOVIDRIVE A
P
i
f
kVA
Hz
n
P
i
f
kVA
Hz
n