Commit ec025559 authored by Marcus Nordenberg's avatar Marcus Nordenberg Committed by Claes Sjöfors

update profibus api

parent 655f779b
This diff is collapsed.
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#define BUILD_NUMBER 52 #define BUILD_NUMBER 52
#define BUILD_NUMBER_STR "52" #define BUILD_NUMBER_STR "52"
......
/* /******************************************************************************
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************
* * * *
* SOFTING AG * * SOFTING Industrial Automation GmbH *
* Richard-Reitzner-Allee 6 * * Richard-Reitzner-Allee 6 *
* D-85540 Haar * * D-85540 Haar *
* Phone: ++49-89-4 56 56-0 * * Phone: (++49)-(0)89-45656-0 *
* Fax: ++49-89-4 56 56-3 99 * * Fax: (++49)-(0)89-45656-399 *
* * * *
* Copyright (C) SOFTING AG 1995-2003 * * Copyright (C) SOFTING Industrial Automation GmbH 1995-2012 *
* All Rights Reserved * * All Rights Reserved *
* * * *
****************************************************************************** *******************************************************************************
FILE_NAME BUSPARAM.C FILE_NAME BUSPARAM.C
...@@ -55,25 +20,11 @@ MODULE BUSPARAM ...@@ -55,25 +20,11 @@ MODULE BUSPARAM
COMPONENT_LIBRARY PBT LIBs and DLL (16-Bit) COMPONENT_LIBRARY PBT LIBs and DLL (16-Bit)
PBTOOLS DLL (32-Bit) PBTOOLS DLL (32-Bit)
AUTHOR SOFTING AG AUTHOR SOFTING
VERSION 5.00 VERSION 5.21.0.00.release
5.01
5.02 DATE February-1998
5.10
5.11
5.20.0.00.alpha
5.20.0.00.release
5.21.0.00.release
DATE 24-November-1995
31-January-1996
14-July-1996
20-Febrary-1997
18-March-1997
30-July-1997
17-October-1997
27-February-1998
STATUS finished STATUS finished
...@@ -138,7 +89,8 @@ possible return values: ...@@ -138,7 +89,8 @@ possible return values:
FUNCTION_BODY FUNCTION_BODY
switch (baud_rate) { switch (baud_rate)
{
case 0: /* 9,6 KBaud */ case 0: /* 9,6 KBaud */
case 1: /* 19,2 KBaud */ case 1: /* 19,2 KBaud */
case 2: /* 93,75 KBaud */ case 2: /* 93,75 KBaud */
...@@ -242,7 +194,8 @@ possible return values: ...@@ -242,7 +194,8 @@ possible return values:
FUNCTION_BODY FUNCTION_BODY
switch (baud_rate) { switch (baud_rate)
{
case 0: /* 9,6 KBaud */ case 0: /* 9,6 KBaud */
bus_param_ptr->tsl = 100; bus_param_ptr->tsl = 100;
bus_param_ptr->min_tsdr = 30; bus_param_ptr->min_tsdr = 30;
...@@ -365,7 +318,8 @@ possible return values: ...@@ -365,7 +318,8 @@ possible return values:
FUNCTION_BODY FUNCTION_BODY
switch (baud_rate) { switch (baud_rate)
{
case 0: /* 9,6 KBaud */ case 0: /* 9,6 KBaud */
bus_param_ptr->tsl = 125; bus_param_ptr->tsl = 125;
bus_param_ptr->min_tsdr = 30; bus_param_ptr->min_tsdr = 30;
...@@ -481,8 +435,8 @@ possible return values: ...@@ -481,8 +435,8 @@ possible return values:
} }
} }
FUNCTION GLOBAL PB_BOOL CALL_CONV pbt_get_dp_def_bus_param(IN USIGN8 baud_rate, FUNCTION GLOBAL PB_BOOL CALL_CONV pbt_get_dp_def_bus_param(
IN USIGN8 station_addr, IN USIGN16 mode, IN USIGN8 baud_rate, IN USIGN8 station_addr, IN USIGN16 mode,
OUT T_DP_BUS_PARA_SET FAR* bus_param_ptr) OUT T_DP_BUS_PARA_SET FAR* bus_param_ptr)
/*---------------------------------------------------------------------------- /*----------------------------------------------------------------------------
...@@ -510,7 +464,8 @@ possible return values: ...@@ -510,7 +464,8 @@ possible return values:
FUNCTION_BODY FUNCTION_BODY
ret_val = PB_TRUE; ret_val = PB_TRUE;
switch (mode) { switch (mode)
{
case DP_MODE: /* only DP mode */ case DP_MODE: /* only DP mode */
ret_val = pbt_get_bus_param_for_dp(baud_rate, &bus_param); ret_val = pbt_get_bus_param_for_dp(baud_rate, &bus_param);
break; break;
...@@ -524,7 +479,8 @@ possible return values: ...@@ -524,7 +479,8 @@ possible return values:
break; break;
} }
if (ret_val == PB_TRUE) { if (ret_val == PB_TRUE)
{
/* -- set variable busparametes ---------------------------------------- */ /* -- set variable busparametes ---------------------------------------- */
bus_param_ptr->tsl = bus_param.tsl; bus_param_ptr->tsl = bus_param.tsl;
bus_param_ptr->min_tsdr = bus_param.min_tsdr; bus_param_ptr->min_tsdr = bus_param.min_tsdr;
...@@ -583,7 +539,8 @@ possible return values: ...@@ -583,7 +539,8 @@ possible return values:
FUNCTION_BODY FUNCTION_BODY
if (pbt_get_bus_param_for_fms(baud_rate, &bus_param)) { if (pbt_get_bus_param_for_fms(baud_rate, &bus_param))
{
/* -- set variable busparametes -------------------------------------- */ /* -- set variable busparametes -------------------------------------- */
bus_param_ptr->tsl = bus_param.tsl; bus_param_ptr->tsl = bus_param.tsl;
bus_param_ptr->min_tsdr = bus_param.min_tsdr; bus_param_ptr->min_tsdr = bus_param.min_tsdr;
...@@ -607,7 +564,9 @@ possible return values: ...@@ -607,7 +564,9 @@ possible return values:
bus_param_ptr->ident[3] = 0; bus_param_ptr->ident[3] = 0;
return (PB_TRUE); return (PB_TRUE);
} else { }
else
{
return (PB_FALSE); return (PB_FALSE);
} }
} }
...@@ -644,7 +603,8 @@ possible return values: ...@@ -644,7 +603,8 @@ possible return values:
FUNCTION_BODY FUNCTION_BODY
switch (mode) { switch (mode)
{
case DP_MODE: /* only DP mode */ case DP_MODE: /* only DP mode */
ret_val = pbt_get_bus_param_for_dp(baud_rate, &bus_param); ret_val = pbt_get_bus_param_for_dp(baud_rate, &bus_param);
break; break;
...@@ -662,7 +622,8 @@ possible return values: ...@@ -662,7 +622,8 @@ possible return values:
break; break;
} }
if (ret_val == PB_TRUE) { if (ret_val == PB_TRUE)
{
/* -- set variable busparametes ---------------------------------------- */ /* -- set variable busparametes ---------------------------------------- */
bus_param_ptr->tsl = bus_param.tsl; bus_param_ptr->tsl = bus_param.tsl;
bus_param_ptr->min_tsdr = bus_param.min_tsdr; bus_param_ptr->min_tsdr = bus_param.min_tsdr;
...@@ -689,9 +650,9 @@ possible return values: ...@@ -689,9 +650,9 @@ possible return values:
return (ret_val); return (ret_val);
} }
FUNCTION GLOBAL PB_BOOL CALL_CONV pbt_get_fmb_def_bus_param(IN USIGN8 baud_rate, FUNCTION GLOBAL PB_BOOL CALL_CONV pbt_get_fmb_def_bus_param(
IN USIGN8 station_addr, IN PB_BOOL in_ring_desired, IN USIGN16 mode, IN USIGN8 baud_rate, IN USIGN8 station_addr, IN PB_BOOL in_ring_desired,
OUT T_FMB_SET_BUSPARAMETER_REQ FAR* bus_param_ptr) IN USIGN16 mode, OUT T_FMB_SET_BUSPARAMETER_REQ FAR* bus_param_ptr)
/*---------------------------------------------------------------------------- /*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION FUNCTIONAL_DESCRIPTION
...@@ -720,7 +681,8 @@ possible return values: ...@@ -720,7 +681,8 @@ possible return values:
FUNCTION_BODY FUNCTION_BODY
switch (mode) { switch (mode)
{
case DP_MODE: /* only DP mode */ case DP_MODE: /* only DP mode */
ret_val = pbt_get_bus_param_for_dp(baud_rate, &bus_param); ret_val = pbt_get_bus_param_for_dp(baud_rate, &bus_param);
break; break;
...@@ -738,7 +700,8 @@ possible return values: ...@@ -738,7 +700,8 @@ possible return values:
break; break;
} }
if (ret_val == PB_TRUE) { if (ret_val == PB_TRUE)
{
/* -- set variable busparametes ---------------------------------------- */ /* -- set variable busparametes ---------------------------------------- */
bus_param_ptr->tsl = bus_param.tsl; bus_param_ptr->tsl = bus_param.tsl;
bus_param_ptr->min_tsdr = bus_param.min_tsdr; bus_param_ptr->min_tsdr = bus_param.min_tsdr;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -214,8 +214,8 @@ typedef struct DPM_SL_PRM_HEADERtag ...@@ -214,8 +214,8 @@ typedef struct DPM_SL_PRM_HEADERtag
typedef struct DPV0_PRMtag typedef struct DPV0_PRMtag
{ {
unsigned char abUsr_Prm_Data unsigned char abUsr_Prm_Data[MAX_USR_PRM_LEN]; /* user parameter data without
[MAX_USR_PRM_LEN]; /* user parameter data without DPV1-bytes */ DPV1-bytes */
} GNUC_PACKED DPV0_PRM; } GNUC_PACKED DPV0_PRM;
typedef struct DPV1_USR_PRMtag typedef struct DPV1_USR_PRMtag
......
/* /******************************************************************************
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************
* * * *
* SOFTING AG * * SOFTING Industrial Automation GmbH *
* Richard-Reitzner-Allee 6 * * Richard-Reitzner-Allee 6 *
* D-85540 Haar * * D-85540 Haar *
* Phone: ++49-89-4 56 56-0 * * Phone: (++49)-(0)89-45656-0 *
* Fax: ++49-89-4 56 56-3 99 * * Fax: (++49)-(0)89-45656-399 *
* * * *
* Copyright (C) SOFTING AG 1998-2003 * * Copyright (C) SOFTING Industrial Automation GmbH 1995-2012 *
* All Rights Reserved * * All Rights Reserved *
* * * *
****************************************************************************** *******************************************************************************
FILE_NAME DPSGDL.C FILE_NAME DPSGDL.C
...@@ -55,12 +20,12 @@ MODULE DPSGDL ...@@ -55,12 +20,12 @@ MODULE DPSGDL
COMPONENT_LIBRARY PAPI Lib COMPONENT_LIBRARY PAPI Lib
PAPI DLL PAPI DLL
AUTHOR SOFTING AG AUTHOR SOFTING
VERSION 1.20.0.00.release (DP-Slave Stand-Alone for DOS) VERSION 1.30.0.00.release (DP-Slave Stand-Alone for DOS)
5.22.0.00.release (WIN95/WIN98 and WinNT) 5.22.0.00.release (WIN95/WIN98 and WinNT)
DATE 26-February-1999 DATE February-1999
STATUS finished STATUS finished
...@@ -107,7 +72,9 @@ LOCAL_DATA ...@@ -107,7 +72,9 @@ LOCAL_DATA
#pragma check_stack(off) #pragma check_stack(off)
#endif #endif
FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service, FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
IN USIGN8 primitive, IN USIGN8 FAR* data_ptr, OUT INT16 FAR* data_len_ptr) IN USIGN8 primitive,
IN USIGN8 FAR* data_ptr,
OUT INT16 FAR* data_len_ptr)
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
/* FUNCTIONAL_DESCRIPTION */ /* FUNCTIONAL_DESCRIPTION */
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
...@@ -121,29 +88,33 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service, ...@@ -121,29 +88,33 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
FUNCTION_BODY FUNCTION_BODY
switch (primitive) { switch (primitive)
{
/*--- USER REQUESTS ----------------------------------------------------*/ /*--- USER REQUESTS ----------------------------------------------------*/
case REQ: { case REQ:
switch (service) { {
case DPS_INIT_SLAVE: { switch (service)
{
case DPS_INIT_SLAVE:
{
init_slave_req_ptr = (T_DPS_INIT_SLAVE_REQ FAR*)data_ptr; init_slave_req_ptr = (T_DPS_INIT_SLAVE_REQ FAR*)data_ptr;
if ((init_slave_req_ptr->cfg_data_len == 0) if ((init_slave_req_ptr->cfg_data_len == 0) ||
|| (init_slave_req_ptr->cfg_data_len > DP_MAX_CFG_DATA_LEN)) { (init_slave_req_ptr->cfg_data_len > DP_MAX_CFG_DATA_LEN))
result = E_IF_INVALID_DATA_SIZE; {
return (E_IF_INVALID_DATA_SIZE); return (E_IF_INVALID_DATA_SIZE);
} }
if (init_slave_req_ptr->enhanced_init_data_len if (init_slave_req_ptr->enhanced_init_data_len >
> sizeof(init_slave_req_ptr->enhanced_init_data)) { sizeof(init_slave_req_ptr->enhanced_init_data))
result = E_IF_INVALID_DATA_SIZE; {
return (E_IF_INVALID_DATA_SIZE); return (E_IF_INVALID_DATA_SIZE);
} }
*data_len_ptr = sizeof(T_DPS_INIT_SLAVE_REQ) *data_len_ptr = sizeof(T_DPS_INIT_SLAVE_REQ) -
- (sizeof(init_slave_req_ptr->enhanced_init_data) (sizeof(init_slave_req_ptr->enhanced_init_data) -
- init_slave_req_ptr->enhanced_init_data_len); init_slave_req_ptr->enhanced_init_data_len);
break; break;
} /* case DPS_INIT_SLAVE */ } /* case DPS_INIT_SLAVE */
...@@ -151,16 +122,18 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service, ...@@ -151,16 +122,18 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
*data_len_ptr = 0; *data_len_ptr = 0;
break; break;
case DPS_SLAVE_DIAG: { case DPS_SLAVE_DIAG:
{
slave_diag_req_ptr = (T_DPS_SLAVE_DIAG_REQ FAR*)data_ptr; slave_diag_req_ptr = (T_DPS_SLAVE_DIAG_REQ FAR*)data_ptr;
if (slave_diag_req_ptr->ext_diag_data_len > DP_MAX_EXT_DIAG_DATA_LEN) { if (slave_diag_req_ptr->ext_diag_data_len > DP_MAX_EXT_DIAG_DATA_LEN)
result = E_IF_INVALID_DATA_SIZE; {
return (E_IF_INVALID_DATA_SIZE); return (E_IF_INVALID_DATA_SIZE);
} }
*data_len_ptr = sizeof(T_DPS_SLAVE_DIAG_REQ) *data_len_ptr =
- (DP_MAX_EXT_DIAG_DATA_LEN - slave_diag_req_ptr->ext_diag_data_len); sizeof(T_DPS_SLAVE_DIAG_REQ) -
(DP_MAX_EXT_DIAG_DATA_LEN - slave_diag_req_ptr->ext_diag_data_len);
break; break;
} }
...@@ -171,11 +144,9 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service, ...@@ -171,11 +144,9 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
case DPS_CHK_CFG: case DPS_CHK_CFG:
case DPS_SET_PRM: case DPS_SET_PRM:
case DPS_SET_SLAVE_ADD: case DPS_SET_SLAVE_ADD:
result = E_IF_INVALID_PRIMITIVE;
return (E_IF_INVALID_PRIMITIVE); return (E_IF_INVALID_PRIMITIVE);
default: default:
result = E_IF_INVALID_SERVICE;
return (E_IF_INVALID_SERVICE); return (E_IF_INVALID_SERVICE);
} /* switch serivce */ } /* switch serivce */
...@@ -185,8 +156,10 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service, ...@@ -185,8 +156,10 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
/*---- USER RESPONSES --------------------------------------------------*/ /*---- USER RESPONSES --------------------------------------------------*/
case RES: { case RES:
switch (service) { {
switch (service)
{
case DPS_CHK_CFG: case DPS_CHK_CFG:
*data_len_ptr = sizeof(T_DPS_CHK_CFG_RES); *data_len_ptr = sizeof(T_DPS_CHK_CFG_RES);
break; break;
...@@ -195,7 +168,6 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service, ...@@ -195,7 +168,6 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
break; break;
default: default:
result = E_IF_INVALID_SERVICE;
return (E_IF_INVALID_SERVICE); return (E_IF_INVALID_SERVICE);
} /* switch serivce */ } /* switch serivce */
...@@ -206,12 +178,10 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service, ...@@ -206,12 +178,10 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
/*---- WRONG PRIMITIVE -------------------------------------------------*/ /*---- WRONG PRIMITIVE -------------------------------------------------*/
default: default:
result = E_IF_INVALID_PRIMITIVE;
return (E_IF_INVALID_PRIMITIVE); return (E_IF_INVALID_PRIMITIVE);
} /* switch primitive */ } /* switch primitive */
result = E_OK;
return (E_OK); return (E_OK);
} /* dpsgdl_get_data_len */ } /* dpsgdl_get_data_len */
......
/* /******************************************************************************
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************
* * * *
* SOFTING AG * * SOFTING Industrial Automation GmbH *
* Richard-Reitzner-Allee 6 * * Richard-Reitzner-Allee 6 *
* D-85540 Haar * * D-85540 Haar *
* Phone: ++49-89-4 56 56-0 * * Phone: (++49)-(0)89-45656-0 *
* Fax: ++49-89-4 56 56-3 99 * * Fax: (++49)-(0)89-45656-399 *
* * * *
* Copyright (C) SOFTING AG 1995-2003 * * Copyright (C) SOFTING Industrial Automation GmbH 1995-2012 *
* All Rights Reserved * * All Rights Reserved *
* * * *
****************************************************************************** *******************************************************************************
FILE_NAME FDLGDL.C FILE_NAME FDLGDL.C
...@@ -55,11 +20,11 @@ MODULE FDLGDL ...@@ -55,11 +20,11 @@ MODULE FDLGDL
COMPONENT_LIBRARY PAPI Lib COMPONENT_LIBRARY PAPI Lib
PAPI DLL PAPI DLL
AUTHOR SOFTING AG AUTHOR SOFTING
VERSION 5.23.0.00.release VERSION 5.23.0.00.release
DATE 30-October-2000 DATE October-2000
STATUS finished STATUS finished
...@@ -105,7 +70,8 @@ LOCAL_DATA ...@@ -105,7 +70,8 @@ LOCAL_DATA
#pragma check_stack(off) #pragma check_stack(off)
#endif #endif
FUNCTION PUBLIC INT16 fdlgdl_get_data_len(IN INT16 result, /* Service-Result */ FUNCTION PUBLIC INT16 fdlgdl_get_data_len(
IN INT16 result, /* Service-Result */
IN USIGN8 service, /* Service */ IN USIGN8 service, /* Service */
IN USIGN8 primitive, /* Service-Primitive */ IN USIGN8 primitive, /* Service-Primitive */
IN USIGN8 FAR* data_ptr, /* pointer to data */ IN USIGN8 FAR* data_ptr, /* pointer to data */
...@@ -129,20 +95,26 @@ possible return values: ...@@ -129,20 +95,26 @@ possible return values:
*data_len_ptr = 0; *data_len_ptr = 0;
result = E_OK; result = E_OK;
if (primitive == REQ) { if (primitive == REQ)
switch (service) { {
switch (service)
{
case FDLIF_SDA: case FDLIF_SDA:
case FDLIF_SDN: case FDLIF_SDN:
case FDLIF_SRD: { case FDLIF_SRD:
{
T_FDLIF_SDN_SDA_SRD_REQ FAR* req = (T_FDLIF_SDN_SDA_SRD_REQ FAR*)data_ptr; T_FDLIF_SDN_SDA_SRD_REQ FAR* req = (T_FDLIF_SDN_SDA_SRD_REQ FAR*)data_ptr;
*data_len_ptr = sizeof(T_FDLIF_SDN_SDA_SRD_REQ) + req->length; *data_len_ptr = sizeof(T_FDLIF_SDN_SDA_SRD_REQ) + req->length;
} break; }
break;
case FDLIF_REPLY_UPDATE: case FDLIF_REPLY_UPDATE:
case FDLIF_REPLY_UPDATE_MULTIPLE: { case FDLIF_REPLY_UPDATE_MULTIPLE:
{
T_FDLIF_RUP_REQ FAR* req = (T_FDLIF_RUP_REQ FAR*)data_ptr; T_FDLIF_RUP_REQ FAR* req = (T_FDLIF_RUP_REQ FAR*)data_ptr;
*data_len_ptr = sizeof(T_FDLIF_RUP_REQ) + req->length; *data_len_ptr = sizeof(T_FDLIF_RUP_REQ) + req->length;
} break; }
break;
case FDLIF_SET_BUSPARAMETER: case FDLIF_SET_BUSPARAMETER:
*data_len_ptr = sizeof(T_FDLIF_SET_BUSPARAMETER_REQ); *data_len_ptr = sizeof(T_FDLIF_SET_BUSPARAMETER_REQ);
...@@ -177,7 +149,9 @@ possible return values: ...@@ -177,7 +149,9 @@ possible return values:
result = E_IF_INVALID_SERVICE; result = E_IF_INVALID_SERVICE;
break; break;
} }
} else { }
else
{
result = E_IF_INVALID_PRIMITIVE; result = E_IF_INVALID_PRIMITIVE;
} }
......
/* /******************************************************************************
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************
* * * *
* SOFTING AG * * SOFTING Industrial Automation GmbH *
* Richard-Reitzner-Allee 6 * * Richard-Reitzner-Allee 6 *
* D-85540 Haar * * D-85540 Haar *
* Phone: ++49-89-4 56 56-0 * * Phone: (++49)-(0)89-45656-0 *
* Fax: ++49-89-4 56 56-3 99 * * Fax: (++49)-(0)89-45656-399 *
* * * *
* Copyright (C) SOFTING AG 1995-2003 * * Copyright (C) SOFTING Industrial Automation GmbH 1995-2012 *
* All Rights Reserved * * All Rights Reserved *
* * * *
****************************************************************************** *******************************************************************************
FILE_NAME FM7GDL.C FILE_NAME FM7GDL.C
...@@ -55,11 +20,11 @@ MODULE FM7GDL ...@@ -55,11 +20,11 @@ MODULE FM7GDL
COMPONENT_LIBRARY PAPI Lib COMPONENT_LIBRARY PAPI Lib
PAPI DLL PAPI DLL
AUTHOR SOFTING AG AUTHOR SOFTING
VERSION 5.21.0.00.release VERSION 5.21.0.00.release
DATE 27-February-1998 DATE February-1998
STATUS finished STATUS finished
...@@ -111,7 +76,8 @@ LOCAL_DATA ...@@ -111,7 +76,8 @@ LOCAL_DATA
#pragma check_stack(off) #pragma check_stack(off)
#endif #endif
FUNCTION LOCAL INT16 fm7gdl_get_ctxt_data_len(IN USIGN8 service, /* Service */ FUNCTION LOCAL INT16 fm7gdl_get_ctxt_data_len(
IN USIGN8 service, /* Service */
IN USIGN8 primitive /* Service-Primitive */ IN USIGN8 primitive /* Service-Primitive */
) )
...@@ -131,14 +97,18 @@ possible return values: ...@@ -131,14 +97,18 @@ possible return values:
FUNCTION_BODY FUNCTION_BODY
if (service == FM7_ABORT && primitive == REQ) { if (service == FM7_ABORT && primitive == REQ)
{
return (sizeof(T_FM7_ABORT_REQ)); return (sizeof(T_FM7_ABORT_REQ));
} else { }
else
{
return (0); return (0);
} }
} }
FUNCTION LOCAL INT16 fm7gdl_get_crl_data_len(IN USIGN8 service, /* Service */ FUNCTION LOCAL INT16 fm7gdl_get_crl_data_len(
IN USIGN8 service, /* Service */
IN USIGN8 primitive, /* Service-Primitive */ IN USIGN8 primitive, /* Service-Primitive */
IN USIGN8 FAR* data_ptr /* pointer to data */ IN USIGN8 FAR* data_ptr /* pointer to data */
) )
...@@ -169,7 +139,8 @@ possible return values: ...@@ -169,7 +139,8 @@ possible return values:
FUNCTION_BODY FUNCTION_BODY
switch (service) { switch (service)
{
case FM7_LOAD_CRL_LOC: case FM7_LOAD_CRL_LOC:
case FM7_LOAD_CRL_REM: case FM7_LOAD_CRL_REM:
if (primitive == REQ) if (primitive == REQ)
...@@ -179,9 +150,12 @@ possible return values: ...@@ -179,9 +150,12 @@ possible return values:
case FM7_READ_CRL_LOC: case FM7_READ_CRL_LOC:
case FM7_READ_CRL_REM: case FM7_READ_CRL_REM:
if (primitive == REQ) { if (primitive == REQ)
{
return (sizeof(T_READ_CRL_REQ)); return (sizeof(T_READ_CRL_REQ));
} else { }
else
{
T_READ_CRL_CNF FAR* rsp = (T_READ_CRL_CNF FAR*)data_ptr; T_READ_CRL_CNF FAR* rsp = (T_READ_CRL_CNF FAR*)data_ptr;
if (rsp->desired_cr == 0) if (rsp->desired_cr == 0)
...@@ -224,13 +198,16 @@ possible return values: ...@@ -224,13 +198,16 @@ possible return values:
FUNCTION_BODY FUNCTION_BODY
switch (service) { switch (service)
{
case FM7_SET_VALUE_LOC: case FM7_SET_VALUE_LOC:
case FM7_SET_VALUE_REM: case FM7_SET_VALUE_REM:
if (primitive == REQ) { if (primitive == REQ)
{
T_SET_VALUE_REQ FAR* req = (T_SET_VALUE_REQ FAR*)data_ptr; T_SET_VALUE_REQ FAR* req = (T_SET_VALUE_REQ FAR*)data_ptr;
return (sizeof(T_SET_VALUE_REQ) + req->length); return (sizeof(T_SET_VALUE_REQ) + req->length);
} else }
else
return (0); return (0);
case FM7_SET_BUSPARAMETER: case FM7_SET_BUSPARAMETER:
...@@ -241,9 +218,12 @@ possible return values: ...@@ -241,9 +218,12 @@ possible return values:
case FM7_READ_VALUE_LOC: case FM7_READ_VALUE_LOC:
case FM7_READ_VALUE_REM: case FM7_READ_VALUE_REM:
if (primitive == REQ) { if (primitive == REQ)
{
return (sizeof(T_READ_VALUE_REQ)); return (sizeof(T_READ_VALUE_REQ));
} else { }
else
{
T_READ_VALUE_CNF FAR* rsp = (T_READ_VALUE_CNF FAR*)data_ptr; T_READ_VALUE_CNF FAR* rsp = (T_READ_VALUE_CNF FAR*)data_ptr;
return (sizeof(T_READ_VALUE_CNF) + rsp->length); return (sizeof(T_READ_VALUE_CNF) + rsp->length);
} }
...@@ -389,7 +369,8 @@ possible return values: ...@@ -389,7 +369,8 @@ possible return values:
FUNCTION_BODY FUNCTION_BODY
switch (service) { switch (service)
{
case FM7_INITIATE: case FM7_INITIATE:
return (sizeof(T_FM7_INIT_ERR_CNF)); return (sizeof(T_FM7_INIT_ERR_CNF));
...@@ -425,7 +406,8 @@ possible return values: ...@@ -425,7 +406,8 @@ possible return values:
} }
} }
FUNCTION PUBLIC INT16 fm7gdl_get_data_len(IN INT16 result, /* Service-Result */ FUNCTION PUBLIC INT16 fm7gdl_get_data_len(
IN INT16 result, /* Service-Result */
IN USIGN8 service, /* Service */ IN USIGN8 service, /* Service */
IN USIGN8 primitive, /* Service-Primitive */ IN USIGN8 primitive, /* Service-Primitive */
IN USIGN8 FAR* data_ptr, /* pointer to data */ IN USIGN8 FAR* data_ptr, /* pointer to data */
...@@ -448,7 +430,8 @@ possible return values: ...@@ -448,7 +430,8 @@ possible return values:
*data_len_ptr = 0; *data_len_ptr = 0;
switch (service) { switch (service)
{
case FM7_READ_CRL_LOC: case FM7_READ_CRL_LOC:
case FM7_INIT_LOAD_CRL_LOC: case FM7_INIT_LOAD_CRL_LOC:
case FM7_LOAD_CRL_LOC: case FM7_LOAD_CRL_LOC:
...@@ -470,8 +453,8 @@ possible return values: ...@@ -470,8 +453,8 @@ possible return values:
case FM7_SET_VALUE_REM: case FM7_SET_VALUE_REM:
case FM7_READ_VALUE_REM: case FM7_READ_VALUE_REM:
if (result == POS) if (result == POS)
*data_len_ptr *data_len_ptr =
= fm7gdl_get_s_r_value_data_len(service, primitive, data_ptr); fm7gdl_get_s_r_value_data_len(service, primitive, data_ptr);
else else
*data_len_ptr = fm7gdl_get_error_data_len(service); *data_len_ptr = fm7gdl_get_error_data_len(service);
break; break;
...@@ -518,6 +501,7 @@ possible return values: ...@@ -518,6 +501,7 @@ possible return values:
default: default:
return (E_IF_INVALID_SERVICE); return (E_IF_INVALID_SERVICE);
break;
} }
return (E_OK); return (E_OK);
......
This diff is collapsed.
This diff is collapsed.
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************/ /*****************************************************************************/
/* */ /* */
/* SOFTING AG */ /* SOFTING Industrial Automation GmbH */
/* Richard-Reitzner-Allee 6 */ /* Richard-Reitzner-Allee 6 */
/* D-85540 Haar */ /* D-85540 Haar */
/* Phone: (++49)-(0)89-45656-0 */ /* Phone: (++49)-(0)89-45656-0 */
/* Fax: (++49)-(0)89-45656-399 */ /* Fax: (++49)-(0)89-45656-399 */
/* */ /* */
/* Copyright (C) SOFTING AG 1995-2003 */ /* Copyright (C) SOFTING Industrial Automation GmbH 1995-2012 */
/* All Rights Reserved */ /* All Rights Reserved */
/* */ /* */
/*****************************************************************************/ /*****************************************************************************/
...@@ -50,8 +15,8 @@ ...@@ -50,8 +15,8 @@
/* */ /* */
/* Filename : KEYWORDS.H */ /* Filename : KEYWORDS.H */
/* Version : 5.21.0.00.release */ /* Version : 5.21.0.00.release */
/* Date : 27-February-1998 */ /* Date : February-1998 */
/* Author : SOFTING AG */ /* Author : SOFTING */
/* */ /* */
/* Description : This include file defines some keywords which are used */ /* Description : This include file defines some keywords which are used */
/* for structuring and formatting the PROFIBUS source files. These */ /* for structuring and formatting the PROFIBUS source files. These */
......
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.
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.
This diff is collapsed.
...@@ -2150,13 +2150,15 @@ Volume Profibus $ClassVolume 0.0.250.7 ...@@ -2150,13 +2150,15 @@ Volume Profibus $ClassVolume 0.0.250.7
EndObject EndObject
EndObject EndObject
!/** !/**
! @Author Claes Jurstrand ! @Author Claes Jurstrand/Marcus Nordenberg
! @Version 1.0 ! @Version 1.1
! @Group Profibus ! @Group Profibus
! @Summary Configurates a Profibus PCI master card (Softing profiboard) ! @Summary Configurates a Profibus PCI master card (Softing profiboard)
! Configurates a Profibus PCI master card (Softing Profiboard). Available on LynxOS and Linux. ! Configurates a Profibus PCI master card (Softing Profiboard). Available on LynxOS and Linux.
! The object should be named Px, where x is the number of the device, eg P1. ! The object should be named Px, where x is the number of the device, eg P1.
! You can have maximum two buses (master cards) on each system. ! You can have maximum two buses (master cards) on each system. The latest API from Softing
! can only handle one board per process. So you have to make sure to select PlcThread
! objects from different PlcProcess objects.
!*/ !*/
Object Pb_Profiboard $ClassDef 13 16-JAN-2006 09:46:40.51 Object Pb_Profiboard $ClassDef 13 16-JAN-2006 09:46:40.51
Body SysBody 16-JAN-2006 09:46:40.51 Body SysBody 16-JAN-2006 09:46:40.51
......
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