Commit ce758cd3 authored by Marcus Nordenberg's avatar Marcus Nordenberg

update profibus api

parent 9344a78b
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_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 *
* Richard-Reitzner-Allee 6 *
* D-85540 Haar *
* Phone: ++49-89-4 56 56-0 *
* Fax: ++49-89-4 56 56-3 99 *
* *
* Copyright (C) SOFTING AG 1995-2003 *
* All Rights Reserved *
* *
******************************************************************************
/******************************************************************************
* *
* SOFTING Industrial Automation GmbH *
* Richard-Reitzner-Allee 6 *
* D-85540 Haar *
* Phone: (++49)-(0)89-45656-0 *
* Fax: (++49)-(0)89-45656-399 *
* *
* Copyright (C) SOFTING Industrial Automation GmbH 1995-2012 *
* All Rights Reserved *
* *
*******************************************************************************
FILE_NAME BUSPARAM.C
......@@ -55,25 +20,11 @@ MODULE BUSPARAM
COMPONENT_LIBRARY PBT LIBs and DLL (16-Bit)
PBTOOLS DLL (32-Bit)
AUTHOR SOFTING AG
VERSION 5.00
5.01
5.02
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
AUTHOR SOFTING
VERSION 5.21.0.00.release
DATE February-1998
STATUS finished
......@@ -138,7 +89,8 @@ possible return values:
FUNCTION_BODY
switch (baud_rate) {
switch (baud_rate)
{
case 0: /* 9,6 KBaud */
case 1: /* 19,2 KBaud */
case 2: /* 93,75 KBaud */
......@@ -242,7 +194,8 @@ possible return values:
FUNCTION_BODY
switch (baud_rate) {
switch (baud_rate)
{
case 0: /* 9,6 KBaud */
bus_param_ptr->tsl = 100;
bus_param_ptr->min_tsdr = 30;
......@@ -365,7 +318,8 @@ possible return values:
FUNCTION_BODY
switch (baud_rate) {
switch (baud_rate)
{
case 0: /* 9,6 KBaud */
bus_param_ptr->tsl = 125;
bus_param_ptr->min_tsdr = 30;
......@@ -481,8 +435,8 @@ possible return values:
}
}
FUNCTION GLOBAL PB_BOOL CALL_CONV pbt_get_dp_def_bus_param(IN USIGN8 baud_rate,
IN USIGN8 station_addr, IN USIGN16 mode,
FUNCTION GLOBAL PB_BOOL CALL_CONV pbt_get_dp_def_bus_param(
IN USIGN8 baud_rate, IN USIGN8 station_addr, IN USIGN16 mode,
OUT T_DP_BUS_PARA_SET FAR* bus_param_ptr)
/*----------------------------------------------------------------------------
......@@ -510,7 +464,8 @@ possible return values:
FUNCTION_BODY
ret_val = PB_TRUE;
switch (mode) {
switch (mode)
{
case DP_MODE: /* only DP mode */
ret_val = pbt_get_bus_param_for_dp(baud_rate, &bus_param);
break;
......@@ -524,7 +479,8 @@ possible return values:
break;
}
if (ret_val == PB_TRUE) {
if (ret_val == PB_TRUE)
{
/* -- set variable busparametes ---------------------------------------- */
bus_param_ptr->tsl = bus_param.tsl;
bus_param_ptr->min_tsdr = bus_param.min_tsdr;
......@@ -542,11 +498,11 @@ possible return values:
bus_param_ptr->hsa = HSA;
bus_param_ptr->bp_flag = 0x00;
bus_param_ptr->min_slave_interval = 200; /* [100us] */
bus_param_ptr->poll_timeout = 1000; /* [ 1ms] */
bus_param_ptr->data_control_time = 100; /* [ 10ms] */
bus_param_ptr->poll_timeout = 1000; /* [ 1ms] */
bus_param_ptr->data_control_time = 100; /* [ 10ms] */
bus_param_ptr->master_user_data_len = 34;
memcpy((USIGN8 FAR*)bus_param_ptr->master_class2_name,
(USIGN8 FAR*)"SOFTING PROFIBUS DP MASTER ", 32);
(USIGN8 FAR*)"SOFTING PROFIBUS DP MASTER ", 32);
bus_param_ptr->bus_para_len += bus_param_ptr->master_user_data_len;
}
......@@ -583,7 +539,8 @@ possible return values:
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 -------------------------------------- */
bus_param_ptr->tsl = bus_param.tsl;
bus_param_ptr->min_tsdr = bus_param.min_tsdr;
......@@ -607,7 +564,9 @@ possible return values:
bus_param_ptr->ident[3] = 0;
return (PB_TRUE);
} else {
}
else
{
return (PB_FALSE);
}
}
......@@ -644,7 +603,8 @@ possible return values:
FUNCTION_BODY
switch (mode) {
switch (mode)
{
case DP_MODE: /* only DP mode */
ret_val = pbt_get_bus_param_for_dp(baud_rate, &bus_param);
break;
......@@ -662,7 +622,8 @@ possible return values:
break;
}
if (ret_val == PB_TRUE) {
if (ret_val == PB_TRUE)
{
/* -- set variable busparametes ---------------------------------------- */
bus_param_ptr->tsl = bus_param.tsl;
bus_param_ptr->min_tsdr = bus_param.min_tsdr;
......@@ -689,9 +650,9 @@ possible return values:
return (ret_val);
}
FUNCTION GLOBAL PB_BOOL CALL_CONV pbt_get_fmb_def_bus_param(IN USIGN8 baud_rate,
IN USIGN8 station_addr, IN PB_BOOL in_ring_desired, IN USIGN16 mode,
OUT T_FMB_SET_BUSPARAMETER_REQ FAR* bus_param_ptr)
FUNCTION GLOBAL PB_BOOL CALL_CONV pbt_get_fmb_def_bus_param(
IN USIGN8 baud_rate, IN USIGN8 station_addr, IN PB_BOOL in_ring_desired,
IN USIGN16 mode, OUT T_FMB_SET_BUSPARAMETER_REQ FAR* bus_param_ptr)
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
......@@ -720,7 +681,8 @@ possible return values:
FUNCTION_BODY
switch (mode) {
switch (mode)
{
case DP_MODE: /* only DP mode */
ret_val = pbt_get_bus_param_for_dp(baud_rate, &bus_param);
break;
......@@ -738,7 +700,8 @@ possible return values:
break;
}
if (ret_val == PB_TRUE) {
if (ret_val == PB_TRUE)
{
/* -- set variable busparametes ---------------------------------------- */
bus_param_ptr->tsl = bus_param.tsl;
bus_param_ptr->min_tsdr = bus_param.min_tsdr;
......
This diff is collapsed.
This diff is collapsed.
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 *
* Richard-Reitzner-Allee 6 *
* D-85540 Haar *
* Phone: ++49-89-4 56 56-0 *
* Fax: ++49-89-4 56 56-3 99 *
* *
* Copyright (C) SOFTING AG 1998-2003 *
* All Rights Reserved *
* *
******************************************************************************
/******************************************************************************
* *
* SOFTING Industrial Automation GmbH *
* Richard-Reitzner-Allee 6 *
* D-85540 Haar *
* Phone: (++49)-(0)89-45656-0 *
* Fax: (++49)-(0)89-45656-399 *
* *
* Copyright (C) SOFTING Industrial Automation GmbH 1995-2012 *
* All Rights Reserved *
* *
*******************************************************************************
FILE_NAME DPSGDL.C
......@@ -55,12 +20,12 @@ MODULE DPSGDL
COMPONENT_LIBRARY PAPI Lib
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)
DATE 26-February-1999
DATE February-1999
STATUS finished
......@@ -107,7 +72,9 @@ LOCAL_DATA
#pragma check_stack(off)
#endif
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 */
/*------------------------------------------------------------------------*/
......@@ -121,29 +88,33 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
FUNCTION_BODY
switch (primitive) {
/*--- USER REQUESTS ----------------------------------------------------*/
switch (primitive)
{
/*--- USER REQUESTS ----------------------------------------------------*/
case REQ: {
switch (service) {
case DPS_INIT_SLAVE: {
case REQ:
{
switch (service)
{
case DPS_INIT_SLAVE:
{
init_slave_req_ptr = (T_DPS_INIT_SLAVE_REQ FAR*)data_ptr;
if ((init_slave_req_ptr->cfg_data_len == 0)
|| (init_slave_req_ptr->cfg_data_len > DP_MAX_CFG_DATA_LEN)) {
result = E_IF_INVALID_DATA_SIZE;
if ((init_slave_req_ptr->cfg_data_len == 0) ||
(init_slave_req_ptr->cfg_data_len > DP_MAX_CFG_DATA_LEN))
{
return (E_IF_INVALID_DATA_SIZE);
}
if (init_slave_req_ptr->enhanced_init_data_len
> sizeof(init_slave_req_ptr->enhanced_init_data)) {
result = E_IF_INVALID_DATA_SIZE;
if (init_slave_req_ptr->enhanced_init_data_len >
sizeof(init_slave_req_ptr->enhanced_init_data))
{
return (E_IF_INVALID_DATA_SIZE);
}
*data_len_ptr = sizeof(T_DPS_INIT_SLAVE_REQ)
- (sizeof(init_slave_req_ptr->enhanced_init_data)
- init_slave_req_ptr->enhanced_init_data_len);
*data_len_ptr = sizeof(T_DPS_INIT_SLAVE_REQ) -
(sizeof(init_slave_req_ptr->enhanced_init_data) -
init_slave_req_ptr->enhanced_init_data_len);
break;
} /* case DPS_INIT_SLAVE */
......@@ -151,16 +122,18 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
*data_len_ptr = 0;
break;
case DPS_SLAVE_DIAG: {
case DPS_SLAVE_DIAG:
{
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) {
result = E_IF_INVALID_DATA_SIZE;
if (slave_diag_req_ptr->ext_diag_data_len > DP_MAX_EXT_DIAG_DATA_LEN)
{
return (E_IF_INVALID_DATA_SIZE);
}
*data_len_ptr = sizeof(T_DPS_SLAVE_DIAG_REQ)
- (DP_MAX_EXT_DIAG_DATA_LEN - slave_diag_req_ptr->ext_diag_data_len);
*data_len_ptr =
sizeof(T_DPS_SLAVE_DIAG_REQ) -
(DP_MAX_EXT_DIAG_DATA_LEN - slave_diag_req_ptr->ext_diag_data_len);
break;
}
......@@ -171,11 +144,9 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
case DPS_CHK_CFG:
case DPS_SET_PRM:
case DPS_SET_SLAVE_ADD:
result = E_IF_INVALID_PRIMITIVE;
return (E_IF_INVALID_PRIMITIVE);
default:
result = E_IF_INVALID_SERVICE;
return (E_IF_INVALID_SERVICE);
} /* switch serivce */
......@@ -183,10 +154,12 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
break;
} /* case REQ */
/*---- USER RESPONSES --------------------------------------------------*/
/*---- USER RESPONSES --------------------------------------------------*/
case RES: {
switch (service) {
case RES:
{
switch (service)
{
case DPS_CHK_CFG:
*data_len_ptr = sizeof(T_DPS_CHK_CFG_RES);
break;
......@@ -195,7 +168,6 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
break;
default:
result = E_IF_INVALID_SERVICE;
return (E_IF_INVALID_SERVICE);
} /* switch serivce */
......@@ -203,15 +175,13 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
break;
} /* case RES */
/*---- WRONG PRIMITIVE -------------------------------------------------*/
/*---- WRONG PRIMITIVE -------------------------------------------------*/
default:
result = E_IF_INVALID_PRIMITIVE;
return (E_IF_INVALID_PRIMITIVE);
} /* switch primitive */
result = E_OK;
return (E_OK);
} /* dpsgdl_get_data_len */
......
This diff is collapsed.
This diff is collapsed.
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 */
/* D-85540 Haar */
/* Phone: (++49)-(0)89-45656-0 */
/* Fax: (++49)-(0)89-45656-399 */
/* */
/* Copyright (C) SOFTING AG 1995-2003 */
/* Copyright (C) SOFTING Industrial Automation GmbH 1995-2012 */
/* All Rights Reserved */
/* */
/*****************************************************************************/
......@@ -50,8 +15,8 @@
/* */
/* Filename : KEYWORDS.H */
/* Version : 5.21.0.00.release */
/* Date : 27-February-1998 */
/* Author : SOFTING AG */
/* Date : February-1998 */
/* Author : SOFTING */
/* */
/* Description : This include file defines some keywords which are used */
/* 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.
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