Commit 7276530c authored by claes's avatar claes

I/O-handling routines generalized and some routines moved to rt_io_bus.c

parent b403bf28
/*
* Proview $Id: rt_io_m_pb_ai.c,v 1.6 2008-02-05 08:14:59 claes Exp $
* Proview $Id: rt_io_m_pb_ai.c,v 1.7 2008-02-29 13:18:59 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -44,6 +44,7 @@
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
#include "rt_io_base.h"
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
......
/*
* Proview $Id: rt_io_m_pb_ao.c,v 1.6 2008-02-05 08:14:59 claes Exp $
* Proview $Id: rt_io_m_pb_ao.c,v 1.7 2008-02-29 13:18:59 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -43,6 +43,7 @@
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
#include "rt_io_base.h"
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
......
/*
* Proview $Id: rt_io_m_pb_di.c,v 1.6 2008-02-05 08:14:59 claes Exp $
* Proview $Id: rt_io_m_pb_di.c,v 1.7 2008-02-29 13:18:59 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -43,6 +43,7 @@
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
#include "rt_io_base.h"
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
......
/*
* Proview $Id: rt_io_m_pb_do.c,v 1.6 2008-02-05 08:14:59 claes Exp $
* Proview $Id: rt_io_m_pb_do.c,v 1.7 2008-02-29 13:18:59 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -43,6 +43,7 @@
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
#include "rt_io_base.h"
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
......
/*
* Proview $Id: rt_io_m_pb_dp_slave.c,v 1.11 2008-02-05 08:14:59 claes Exp $
* Proview $Id: rt_io_m_pb_dp_slave.c,v 1.12 2008-02-29 13:15:42 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -44,6 +44,7 @@
#include "pwr_profibusclasses.h"
#include "rt_gdh.h"
#include "rt_io_base.h"
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "co_cdh.h"
......@@ -53,57 +54,6 @@
/* Check if channel should be fetched from diagnostic area,
i.e. channel name starts with "Diag_" */
static int is_diag( pwr_tAttrRef *aref)
{
pwr_tStatus sts;
pwr_tOName name;
char *s;
if ( aref->Objid.oix == 0)
return 0;
sts = gdh_AttrrefToName( aref, name, sizeof(name),
cdh_mName_object | cdh_mName_attribute);
if ( EVEN(sts)) return 0;
if ( (s = strrchr( name, '.'))) {
if ( strncmp( s+1, "Diag_", 5) == 0)
return 1;
}
else if ( strncmp( name, "Diag_", 5) == 0)
return 1;
return 0;
}
pwr_tInt32 GetChanSize(pwr_eDataRepEnum rep)
{
switch (rep) {
case pwr_eDataRepEnum_Int64:
case pwr_eDataRepEnum_UInt64:
case pwr_eDataRepEnum_Float64:
return 8;
break;
case pwr_eDataRepEnum_Bit32:
case pwr_eDataRepEnum_Int32:
case pwr_eDataRepEnum_UInt32:
case pwr_eDataRepEnum_Float32:
return 4;
break;
case pwr_eDataRepEnum_Int24:
case pwr_eDataRepEnum_UInt24:
return 3;
break;
case pwr_eDataRepEnum_Bit16:
case pwr_eDataRepEnum_Int16:
case pwr_eDataRepEnum_UInt16:
return 2;
break;
default:
return 1;
break;
}
}
/*----------------------------------------------------------------------------*\
Init method for the Pb DP slave
......
/*
* Proview $Id: rt_io_m_pb_ii.c,v 1.6 2008-02-05 08:14:59 claes Exp $
* Proview $Id: rt_io_m_pb_ii.c,v 1.7 2008-02-29 13:18:59 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -43,6 +43,7 @@
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
#include "rt_io_base.h"
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
......
/*
* Proview $Id: rt_io_m_pb_io.c,v 1.6 2008-02-05 08:14:59 claes Exp $
* Proview $Id: rt_io_m_pb_io.c,v 1.7 2008-02-29 13:18:59 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -40,6 +40,7 @@
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
#include "rt_io_base.h"
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
......
/*
* Proview $Id: rt_io_m_pb_profiboard.c,v 1.11 2007-05-18 12:00:10 claes Exp $
* Proview $Id: rt_io_m_pb_profiboard.c,v 1.12 2008-02-29 13:18:59 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -46,6 +46,7 @@
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
#include "rt_io_base.h"
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_agent_init.h"
......
/*
* Proview $Id: rt_io_profiboard.c,v 1.2 2007-01-12 13:28:32 claes Exp $
* Proview $Id: rt_io_profiboard.c,v 1.3 2008-02-29 13:15:42 claes Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -38,21 +38,3 @@
#include "pwr.h"
#include "rt_io_profiboard.h"
unsigned short swap16(unsigned short in)
{
unsigned short result = 0;
result = (in << 8) & 0xFF00;
result |= (in >> 8) & 0x00FF;
return(result);
}
unsigned int swap32(unsigned int in)
{
unsigned int result = 0;;
result = (in << 24) & 0xFF000000;
result |= (in << 8) & 0x00FF0000;
result |= (in >> 8) & 0x0000FF00;
result |= (in >> 24) & 0x000000FF;
return(result);
}
/*
* Proview $Id: rt_io_profiboard.h,v 1.2 2007-01-12 13:28:32 claes Exp $
* Proview $Id: rt_io_profiboard.h,v 1.3 2008-02-29 13:16:10 claes Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -27,11 +27,5 @@
#define PB_NO_CON_IND_RECEIVED 4
#define PB_NEG_CONF 5
extern
unsigned short swap16(unsigned short in);
extern
unsigned int swap32(unsigned int in);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment