EasyManua.ls Logo

SEW-Eurodrive IPOS plus - SCOM Communication; Receiver

SEW-Eurodrive IPOS plus
384 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
256
Manual – IPOSplus®
18
SCOM communication
Compiler – Examples
18.7 SCOM communication
The following example shows a program that sends two variables cyclically every 10 ms
via SBus. Another program receives the data that is sent.
With the _SBusCommDef command, you set up a data object for cyclical data transmis-
sion. The send object is described in the variable structure tBusTr, the receive object
is described in TBusRec.
In order to start the cyclical data transmission, you have to call up the _SBusCommOn
function for MOVIDRIVE
®
A and the _SBusCommState function for MOVIDRIVE
®
B.
18.7.1 Receiver
The receiver obtains the data from the SBus and stores it in the variables H305 and
H306.
/*=========================================
Get data object 1025 from SBus and store
the data in variable H305 and H306.
SHELL settings:
P813 SBus Address -> 2
P816 SBus Baudrate -> 500 kBaud
=========================================*/
/*=========================================
IPOS Source file
=========================================*/
#include <constb.h>
#include <iob.h>
// Definition of SCOM structures
SCREC tBusRec;
// Definition of variables
#define Data_Var1x H305
#define Data_Var2x H306
/*=========================================
Main program
=========================================*/
main()
{
// Initialization of SCOM transfer object
tBusRec.ObjectNo = 1060; // object number
tBusRec.Format = 8; // 8 byte
tBusRec.Dpointer = numof(Data_Var1x); // data buffer
// Start SCOM
_SBusCommDef( SCD_REC,tBusRec );
_SBusCommState( SCS_START1 ); // Start cyclic communication MOVIDRIVE B
// _SBusCommOn( ); // Start cyclic communication MOVIDRIVE A
// Main program loop
while(1)
{
}
}
P
i
f
kVA
Hz
n
P
i
f
kVA
Hz
n

Table of Contents