* [ANN] PROFIBUS-DP Master for RTAI Linux and standard Linux
@ 2003-09-06 1:40 Armin Steinhoff
0 siblings, 0 replies; only message in thread
From: Armin Steinhoff @ 2003-09-06 1:40 UTC (permalink / raw)
Steinhoff Automation and Fieldbus systems offers now an implementation
of a PROFIBUS-DP-Master for RTAI Linux and standard Linux for the
controller boards of Softing. The DP master can be configured by a
Linux based configurator,
so it is possible to work completely under Linux.
The API offers a fast and convenient interface (pointer) to the IO
data of the IO modules. These IO data are mapped into the Linux
memory. Time resolution for standard Linux goes down to 2ms, but has
a remarkable jitter. RTAI Linux provides a time resultion of e.g. 1ms
with a jitter < 10us.
PROFIBUS is a fast serial fieldbus (12Mb/s) with a broad range of
different remote IO modules (digital and analog IOs, motion control,
modular RTUs a.s.o)
( see also: http://www.profibus.com/technology/docu.html )
With a PROFIBUS-DP master it is now possible to turn a Linux system
into a professionel process computer or DCS system.
STEINHOFF Automation and Fieldbus Systems
http://www.steinhoff-automation.com
PS: short RTAI example below ...
// ****** RTAI-Linux example ******
#include <linux/module.h>
// assembly language wrappers.
#include <asm/io.h>
// RTAI header
#include <rtai.h>
#include <rtai_sched.h>
#include <rtai_shm.h>
#define HWIRQ_STACK_SIZE 10000
#define HWIRQ_PRIORITY 2
#define TICK_PERIOD 100000 //0. 1ms
#define STACK_SIZE 1000
// RTAI declaration
static RT_TASK user_task;
//-------- DP related procs
extern void GetInputData(void);
extern void SetOutputData(void);
// IO pointers
static unsigned char * ShmPtr;
static unsigned char * ShmPAA; // input
static unsigned char * ShmPAE; // output
static unsigned char * ShmStat;
// ** cyclic RTAI thread **
static void user_thread(int arg)
{
while(1)
{
GetInputData();
(*(ShmPAA+144))++; // update first byte of slave 11
SetOutputData();
rt_task_wait_period();
}
}
// Initialize the module
int init_module()
{
RTIME tick_period;
rt_mount_rtai();
tick_period = start_rt_timer(nano2count(TICK_PERIOD)); // .1ms
rt_task_init(&user_task, user_thread, 0, STACK_SIZE, 0, 0, 0);
MAP_IO_ptr();
// cyclic start every 1ms
rt_task_make_periodic(&user_task, rt_get_time() + 20*tick_period,
10*tick_period);
printk ("user: start OK ...\n");
return 0;
}
// Cleanup
void cleanup_module()
{
stop_rt_timer();
rt_task_delete (&user_task);
rtai_kfree(0xAAAA);
rt_umount_rtai();
}
##########################################################################
# Send submissions for comp.os.linux.announce to: cola@stump.algebra.com #
# PLEASE remember a short description of the software and the LOCATION. #
# This group is archived at http://stump.algebra.com/~cola/ #
##########################################################################
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-09-06 1:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-06 1:40 [ANN] PROFIBUS-DP Master for RTAI Linux and standard Linux Armin Steinhoff
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox