254
Manual – IPOSplus®
18
MoviLink command
Compiler – Examples
18.6.2 Writing a variable via SBus
/*=========================================
Variable H200 of inverter connected via
SBus is written depending on DI17 in task 1:
DI17 = 0 -> -1000
DI17 = 1 -> 1000
=========================================*/
/*=========================================
IPOS Source file
=========================================*/
#include <constb.h>
#include <iob.h>
// Definition of MOVLNK structures
MOVLNK tBus;
MLDATA tBusData;
/*=========================================
Main program
=========================================*/
main()
{
// Initialization of MoviLink for bus transfer
tBus.BusType = ML_BT_SBUS1; // bus type SBus1
tBus.Address = 10; // SBus address 10
tBus.Service = ML_S_WRV; // write volatile
tBus.Index = 11200; // variable H200
tBus.DPointer = numof(tBusData); // data buffer
// Main program loop
while(1)
{
if( DI17 )
{
tBusData.WritePar = 1000;
_MoviLink( tBus );
}
else
{
tBusData.WritePar = -1000;
_MoviLink( tBus );
}
}
}
P
i
f
kVA
Hz
n
P
i
f
kVA
Hz
n