Commit 2d22681d authored by Claes Sjofors's avatar Claes Sjofors

Added Hilscher CIF 50-PB agent code as well as the Hilscher API.

Updated guide to io systems, both english and swedish version.
parent 428c1cf5
This diff is collapsed.
This diff is collapsed.
/* <St> *******************************************************************
======================== Copyright =====================================
Copyright (C) 2004 Hilscher GmbH
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the program, if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
=========================================================================
cif_types.h
-------------------------------------------------------------------------
CREATETED : D. Tsaava, Hilscher GmbH
DATE : 18.07.2000
PROJEKT : CIF device driver
=========================================================================
DISCRIPTION
Includefile for CIF device driver, DPM layout .
=========================================================================
CHANGES
version name date Discription
March 2001
Juli 2004 Redesigned for the 2.6 Kernel
Copyright changed to GNU Lesser GPL
-------------------------------------------------------------------------
V2.602
******************************************************************** <En> */
#ifndef CIF_TYPES_H
# define CIF_TYPES_H
/* Macros for debugging */
#undef DBG_PRN /* undef it, just in case */
#ifdef CIF_DEBUG
# define CIF_PRN(function, lineno,fmt,args...) printk(fmt,function,lineno,##args)
# define DBG_PRN(fmt,args...) CIF_PRN((__FUNCTION__),(__LINE__),KERN_INFO __FILE__"::%s(L%.4d): "fmt,##args)
#else
# define DBG_PRN(fmt, args...) /* not debugging: nothing */
#endif
#ifndef TRUE
# define TRUE 1
#endif
#ifndef FALSE
# define FALSE 0
#endif
#ifndef BOOL
# define BOOL int
#endif
#endif /* CIF_TYPES_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* <St> *******************************************************************
======================== Copyright =====================================
Copyright (C) 2004 Hilscher GmbH
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the program, if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
========================================================================
FILENAME : RcsDef.h
-------------------------------------------------------------------------
CREATED BY : R.Mayer, Hilscher GmbH
CREATED AT : 10.03.97
PROJECT :
=========================================================================
FUNCTION / CLASSDESCRIPTION:
=========================================================================
CHANGES OF REVISIONS :
Version Name Date Change
-------------------------------------------------------------------------
1.000 RM 10.03.97 Created
******************************************************************** <En> */
// Prevent multiple inclusion
#ifndef __RCSDEF_H__
#define __RCSDEF_H__
#ifdef _cplusplus
extern "C" {
#endif /* _cplusplus */
#define FIRMWARE_DOWNLOAD 1
#define CONFIGURATION_DOWNLOAD 2
/* ======================================================================== */
/* Message definitions */
/* ======================================================================== */
#define RCS_TASK 0x00 /* Number of RCS */
#define PLC_TASK 0x02 /* Number for PLC_TASK */
#define MSG_SYSTEM_TX 0xFF /* Transmitter for system functions number */
#define RCS_B_TASK_STATE 4 // Task state
/************************************************************************** */
/* Genaral RCS commands */
/************************************************************************** */
#define RCS_B_SYSFKT 1
#define RCS_B_TASKFKT 2
#define RCS_B_DIAGNOSE 3
#define RCS_B_STRUCTFNC 4
#define RCS_B_TRACE 5
#define RCS_B_LOADFKT 6
#define RCS_B_DBMFKT 10
/* ----------------------- */
/* Message extension masks */
/* ----------------------- */
#define RCS_FIFO_MSK 0
#define RCS_LIFO_MSK 1
#define RCS_NAK_MSK 2
#define RCS_NORM_MSK 0
#define RCS_FIRST_MSK 4
#define RCS_CONT_MSK 8
#define RCS_LAST_MSK 0x0C
#define RCS_SEQ_MSK 0x0C
/* ------------------ */
/* Mode definitions */
/* ------------------ */
#define MODE_NEUSTART 0 /* Command: B_SYSFKT */
#define MODE_KALTSTART 1 /* Command: B_SYSFKT */
#define MODE_WARMSTART 2 /* Command: B_SYSFKT */
#define MODE_ZYKL_STATUS_STOP 3 /* Command: B_SYSFKT */
#define MODE_FWVERSION 4 /* Command: B_SYSFKT */
#define MODE_GET_PROJ_WERTE_HW 5 /* Command: B_SYSFKT */
#define MODE_GET_PROJ_WERTE_SW 6 /* Command: B_SYSFKT */
#define MODE_SHOW_DYN_SYSSTAT 7 /* Command: B_SYSFKT */
#define MODE_SETTIME 9 /* not implemented yet */
#define MODE_SET_DEVICE_DATA 9 /* not implemented yet */
#define MODE_MODUL_RCS 11 /* Command: B_SYSFKT */
#define MODE_MODUL_LIB 12 /* Command: B_SYSFKT */
#define MODE_MODUL_MCL 13 /* Command: B_SYSFKT */
#define MODE_MODUL_LIB 12 /* Command: B_SYSFKT */
#define MODE_MODUL_MCL 13 /* Command: B_SYSFKT */
#define MODE_DISTRIBUTOR_DRIVER 14 /* Command: B_SYSFKT ->function 1 = insert */
#define MODE_PRINT_DRIVER 15 /* Command: B_SYSFKT */
#define MODE_GET_RCS_ERROR 16 /* Command: B_SYSFKT */
#define MODE_PRINT_DEVICE 1 /* NO mode, only for MENU.H */
#define MODE_PRINT_DEVICE_DRIVER 2 /* NO mode, only for MENU.H */
#define MODE_START_STOP_STAT 0 /* Command: B_TASKFKT */
#define MODE_START_STOP 1 /* Command: B_TASKFKT */
#define MODE_TASK_VERSION 2 /* Command: B_TASKFKT */
#define MODE_ZYKL_STATUS 3 /* Command: B_TASKFKT */
#define MODE_SHOW_FUELLST 4 /* Command: B_TASKFKT */
#define MODE_SHOW_TIMER 5 /* Command: B_TASKFKT */
#define MODE_DIAG_MEM_READ_SINGLE 0x0 /* Command: B_DIAGNOSE */
#define MODE_DIAG_MEM_WRITE_SINGLE 0x1 /* Command: B_DIAGNOSE */
#define MODE_DIAG_IO_READ_SINGLE 0x2 /* Command: B_STRUKTFKT */
#define MODE_DIAG_IO_WRITE_SINGLE 0x3 /* Command: B_STRUKTFKT */
#define MODE_DIAG_ZYKL 0x10 /* Command: B_STRUKTFKT */
#define MODE_DIAG_MEM_READ_ZYKL 0x10 /* Command: B_STRUKTFKT */
#define MODE_DIAG_MEM_WRITE_ZYKL 0x11 /* Command: B_STRUKTFKT */
#define MODE_DIAG_IO_READ_ZYKL 0x12 /* Command: B_STRUKTFKT */
#define MODE_DIAG_IO_WRITE_ZYKL 0x13 /* Command: B_STRUKTFKT */
#define MODE_ZYKL_TASK_STRUK 0 /* Command: B_STRUKTFKT */
#define MODE_INIT_INFO_STRUK 1 /* Command: B_STRUKTFKT */
#define MODE_WRITE_STRUK 2 /* Command: B_STRUKTFKT */
#define MODE_START_TRACE 0 /* Command: B_TRACE */
#define MODE_DEL_TRACE_PUF 1 /* Command: B_TRACE */
#define MODE_UPLOAD_BINAER 0 /* Command: B_LOADFKT */
#define MODE_DOWNLOAD_BINAER 1 /* Command: B_LOADFKT */
#define MODE_UPLOAD_DBM 2 /* Command: B_LOADFKT */
#define MODE_DOWNLOAD_DBM 3 /* Command: B_LOADFKT */
#define MODE_DEL_FLASH 4 /* Command: B_LOADFKT */
#define MODE_GET_FLASH_DIR 5 /* Command: B_LOADFKT */
#define MODE_URLADEN 6 /* Command: B_LOADFKT */
#define MODE_LONG_BINLOAD 7 /* Command: B_LOADFKT */
#define MODE_FREE_DRIVER 8 /* Command: B_LOADFKT */
#define MODE_RESET_DEVICE 10 /* Command: B_LOADFKT */
/* ------------------------------------------------------------------------------------ */
#ifdef _cplusplus
}
#endif
#endif
// ======== eof 'RcsDef.h' ========
......@@ -30,14 +30,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include "keywords.h"
#include "pb_type.h"
#include "pb_conf.h"
#include "pb_if.h"
#include "pb_err.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
......@@ -47,7 +39,6 @@
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
/*----------------------------------------------------------------------------*\
Convert ai from rawvalue to actualvalue.
......
......@@ -28,15 +28,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include "keywords.h"
#include "pb_type.h"
#include "pb_conf.h"
#include "pb_if.h"
#include "pb_err.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
......@@ -46,7 +37,6 @@
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
/*----------------------------------------------------------------------------*\
......
......@@ -28,15 +28,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include "keywords.h"
#include "pb_type.h"
#include "pb_conf.h"
#include "pb_if.h"
#include "pb_err.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
......@@ -46,7 +37,6 @@
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
#define IO_CONVMASK_ALL 0xFFFF
......
......@@ -28,15 +28,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include "keywords.h"
#include "pb_type.h"
#include "pb_conf.h"
#include "pb_if.h"
#include "pb_err.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
......@@ -46,7 +37,6 @@
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
/*----------------------------------------------------------------------------*\
......
......@@ -27,15 +27,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include "keywords.h"
#include "pb_type.h"
#include "pb_conf.h"
#include "pb_if.h"
#include "pb_err.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
......@@ -316,21 +307,13 @@ static pwr_tStatus IoRackRead (
{
pwr_sClass_Pb_Profiboard *mp;
pwr_sClass_Pb_DP_Slave *sp;
T_PROFI_DEVICE_HANDLE *hDevice;
pwr_tUInt16 sts;
pwr_tUInt16 data_len;
hDevice = (T_PROFI_DEVICE_HANDLE *) ap->Local;
sp = (pwr_sClass_Pb_DP_Slave *) rp->op;
mp = (pwr_sClass_Pb_Profiboard *) ap->op;
if (sp->Status == PB__NORMAL && mp->Status == PB__NORMAL && sp->DisableSlave != 1 && mp->DisableBus != 1) {
/* The reading of the process image is now performed at the agent level,
this eliminates the need for board specific code at the rack level. */
data_len = sp->BytesOfInput;
sts = profi_get_data(hDevice, ID_DP_SLAVE_IO_IMAGE, sp->OffsetInputs, &data_len, &sp->Inputs );
}
if (sp->DisableSlave != 1 && mp->DisableBus != 1) {
if (sp->Status == PB__NORMAL) {
......@@ -368,26 +351,12 @@ static pwr_tStatus IoRackWrite (
{
pwr_sClass_Pb_Profiboard *mp;
pwr_sClass_Pb_DP_Slave *sp;
T_PROFI_DEVICE_HANDLE *hDevice;
pwr_tUInt16 sts;
hDevice = (T_PROFI_DEVICE_HANDLE *) ap->Local;
sp = (pwr_sClass_Pb_DP_Slave *) rp->op;
mp = (pwr_sClass_Pb_Profiboard *) ap->op;
// Write the whole I/O output area from local area
if ((sp->Status == PB__NORMAL || sp->Status == PB__NOCONN) &&
mp->Status == PB__NORMAL && (sp->DisableSlave != 1) && (mp->DisableBus != 1)) {
if (sp->BytesOfOutput > 0) {
sts = profi_set_data(hDevice, ID_DP_SLAVE_IO_IMAGE, sp->OffsetOutputs, sp->BytesOfOutput, &sp->Outputs);
if (sts != E_OK) sp->ErrorCount++;
}
}
/* The writing of the process image is now performed at the agent level,
this eliminates the need for board specific code at the rack level. */
if (sp->DisableSlave == 1 || mp->DisableBus == 1) sp->Status = PB__DISABLED;
......
This diff is collapsed.
......@@ -27,16 +27,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include "keywords.h"
#include "pb_type.h"
#include "pb_conf.h"
#include "pb_if.h"
#include "pb_err.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
......@@ -46,7 +36,6 @@
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
/*----------------------------------------------------------------------------*\
......
......@@ -25,15 +25,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include "keywords.h"
#include "pb_type.h"
#include "pb_conf.h"
#include "pb_if.h"
#include "pb_err.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
......@@ -43,7 +34,6 @@
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
/*----------------------------------------------------------------------------*\
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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