Commit 471c7737 authored by Claes Sjofors's avatar Claes Sjofors

Plc compile with all warnings, and data pointer type pwr_tVoid added (refs #20)

parent b49c9cb5
......@@ -46,6 +46,7 @@
#include "rt_plc.h"
#include "rt_gdh.h"
#include "co_time.h"
#include "rt_plc_bcomp.h"
#define ODD(a) (((int)(a) & 1) != 0)
#define EVEN(a) (((int)(a) & 1) == 0)
......
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. 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
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview 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 Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#ifndef rt_plc_bcomp_h
#define rt_plc_bcomp_h
#include "rt_plc.h"
#include "pwr_basecomponentclasses.h"
void RunTimeCounterFo_init( pwr_sClass_RunTimeCounterFo *object);
void RunTimeCounterFo_exec( plc_sThread *tp, pwr_sClass_RunTimeCounterFo *object);
void CompModePID_Fo_init( pwr_sClass_CompModePID_Fo *object);
void CompModePID_Fo_exec( plc_sThread *tp, pwr_sClass_CompModePID_Fo *object);
void CompPID_Fo_init( pwr_sClass_CompPID_Fo *object);
void CompPID_Fo_exec( plc_sThread *tp, pwr_sClass_CompPID_Fo *object);
void CompOnOffBurnerFo_exec( plc_sThread *tp, pwr_sClass_CompOnOffBurnerFo *object);
void CompOnOffZoneFo_exec( plc_sThread *tp, pwr_sClass_CompOnOffZoneFo *object);
#endif
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. 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
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview 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 Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#ifndef misc_h
#define misc_h
#include "rt_plc.h"
#include "pwr_miscellaneousclasses.h"
void Misc_PingPongFo_init( pwr_sClass_Misc_PingPongFo *object);
void Misc_PingPongFo_exec( plc_sThread *tp, pwr_sClass_Misc_PingPongFo *object);
void Misc_DemoPattern_exec( plc_sThread *tp, pwr_sClass_Misc_DemoPattern *object);
#endif
......@@ -45,6 +45,7 @@
#include "rt_gdh.h"
#include "rt_plc.h"
#include "co_time.h"
#include "misc.h"
#define BASE_SPEED 10
#define MAX_ANGLE 60
......
......@@ -34,6 +34,10 @@
* General Public License plus this exception.
*/
#ifndef nmps_h
#define nmps_h
#include "rt_plc.h"
#define NMPS_CELL_MAXSIZE 120 /* Number of dataobject in
......@@ -105,3 +109,40 @@ typedef struct {
int nmps_RemoveData( pwr_tObjid objid);
int nmps_RemoveAndDeleteData( pwr_tObjid objid);
void NMpsCell_init( pwr_sClass_NMpsCell *object);
void NMpsCell_exec( plc_sThread *tp, pwr_sClass_NMpsCell *object);
void NMpsStoreCell_init( pwr_sClass_NMpsStoreCell *object);
void NMpsStoreCell_exec( plc_sThread *tp, pwr_sClass_NMpsStoreCell *object);
void NMpsOutCell_exec( plc_sThread *tp, pwr_sClass_NMpsOutCell *object);
void NMpsTrp_exec( plc_sThread *tp, pwr_sClass_NMpsTrp *object);
void NMpsTrpRR_exec( plc_sThread *tp, pwr_sClass_NMpsTrpRR *object);
void NMpsTrpFF_exec( plc_sThread *tp, pwr_sClass_NMpsTrpFF *object);
void DataSelect_exec( plc_sThread *tp, pwr_sClass_DataSelect *object);
void NMpsMirrorCell_init( pwr_sClass_NMpsMirrorCell *object);
void NMpsMirrorCell_exec( plc_sThread *tp, pwr_sClass_NMpsMirrorCell *object);
void DataFWrite_exec( plc_sThread *tp, pwr_sClass_DataFWrite *object);
void DataFRead_exec( plc_sThread *tp, pwr_sClass_DataFRead *object);
void NMpsCell60_init( pwr_sClass_NMpsCell60 *object);
void NMpsCell60_exec( plc_sThread *tp, pwr_sClass_NMpsCell60 *object);
void NMpsCell120_init( pwr_sClass_NMpsCell120 *object);
void NMpsCell120_exec( plc_sThread *tp, pwr_sClass_NMpsCell120 *object);
void NMpsStoreCell60_init( pwr_sClass_NMpsStoreCell60 *object);
void NMpsStoreCell60_exec( plc_sThread *tp, pwr_sClass_NMpsStoreCell60 *object);
void NMpsStoreCell120_init( pwr_sClass_NMpsStoreCell120 *object);
void NMpsStoreCell120_exec( plc_sThread *tp, pwr_sClass_NMpsStoreCell120 *object);
void CellDisp_init( pwr_sClass_CellDisp *object);
void CellDisp_exec( plc_sThread *tp, pwr_sClass_CellDisp *object);
void CellDispMir_init( pwr_sClass_CellDispMir *object);
void CellDispMir_exec( plc_sThread *tp, pwr_sClass_CellDispMir *object);
void CellUpdate_init( pwr_sClass_CellUpdate *object);
void CellUpdate_exec( plc_sThread *tp, pwr_sClass_CellUpdate *object);
void DispLink_exec( plc_sThread *tp, pwr_sClass_DispLink *object);
void RunningTime_exec( plc_sThread *tp, pwr_sClass_RunningTime *object);
void datacnv_init( pwr_sClass_datacnv *object);
void datacnv_exec( plc_sThread *tp, pwr_sClass_datacnv *object);
void DataRequest_exec( plc_sThread *tp, pwr_sClass_DataRequest *object);
void DataRcv_exec( plc_sThread *tp, pwr_sClass_DataRcv *object);
void DataSend_exec( plc_sThread *tp, pwr_sClass_DataSend *object);
#endif
......@@ -44,6 +44,7 @@
#include "pwr_nmpsclasses.h"
#include "rt_plc.h"
#include "co_time.h"
#include "nmps.h"
#define ODD(a) (((int)(a) & 1) != 0)
#define EVEN(a) (((int)(a) & 1) == 0)
......
......@@ -53,6 +53,7 @@
#include "rt_gdh.h"
#include "rt_plc.h"
#include "nmps_cnv.h"
#include "nmps.h"
#define ODD(a) (((int)(a) & 1) != 0)
#define EVEN(a) (((int)(a) & 1) == 0)
......
......@@ -1858,7 +1858,7 @@ Possible return values:
FUNCTION_BODY
// --- check if service device is open
if (!hDevice->hServiceWriteDevice) return (E_IF_PAPI_NOT_INITIALIZED);
if (!hDevice || !hDevice->hServiceWriteDevice) return (E_IF_PAPI_NOT_INITIALIZED);
return(profi_write_service(hDevice->hServiceWriteDevice,pSdb,pData));
}
......@@ -1900,7 +1900,7 @@ Possible return values:
FUNCTION_BODY
// --- check if service device is open
if (!hDevice->hServiceReadDevice) return (E_IF_PAPI_NOT_INITIALIZED);
if (!hDevice || !hDevice->hServiceReadDevice) return (E_IF_PAPI_NOT_INITIALIZED);
return(profi_read_service(hDevice->hServiceReadDevice,pSdb,pData,pDataLength));
}
......
......@@ -1143,6 +1143,8 @@ static pwr_tStatus IoAgentClose (
INT16 result; /* !!! local result variable !!! */
local = (io_sAgentLocal *) ap->Local;
if ( !local) return IO__SUCCESS;
hDevice = (T_PROFI_DEVICE_HANDLE *) ap->Local;
sdb.comm_ref = 0;
sdb.layer = DP;
......
......@@ -1055,6 +1055,7 @@ int CnvWblToH::check_typename( char *type_volume, char *type_name)
"pwr_tPrivMask",
"pwr_tProString40",
"pwr_tDataRef",
"pwr_tVoid",
"pwr_tConfigStatusEnum",
""};
......
......@@ -251,6 +251,11 @@ typedef pwr_tUInt32 pwr_tMask; //!< Mask type.
*/
typedef pwr_tInt32 pwr_tEnum; //!< Enumeration type.
/*_*
@aref viod Void
*/
typedef void pwr_tVoid; //!< Void type.
//! Object identity type.
/*_*
@aref objid Objid
......
......@@ -166,6 +166,7 @@ typedef enum {
pwr_eTix_ProString = 32, /* Basic type */
pwr_eTix_DisableAttr = 33, /* Basic type */
pwr_eTix_DataRef = 34, /* Basic type */
pwr_eTix_Void = 35, /* Basic type */
pwr_eTix_
} pwr_eTix;
......@@ -210,6 +211,7 @@ typedef enum {
pwr_eType_ProString = pwr_TypeId(pwr_eTix_ProString),
pwr_eType_DisableAttr = pwr_TypeId(pwr_eTix_DisableAttr),
pwr_eType_DataRef = pwr_TypeId(pwr_eTix_DataRef),
pwr_eType_Void = pwr_TypeId(pwr_eTix_Void),
pwr_eType_ = pwr_TypeId(pwr_eTix_)
} pwr_eType;
......
......@@ -47,7 +47,7 @@
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "rt_plc.h"
#include "rt_plc_arithm.h"
/* PLC RUTINER */
......@@ -359,8 +359,7 @@ void ramp_exec(
@aref filter Filter
*/
void filter_init(object)
pwr_sClass_filter *object;
void filter_init( pwr_sClass_filter *object)
{
object->In = *object->InP;
object->ActVal = object->In;
......@@ -501,8 +500,7 @@ void curve_exec(
@aref adelay Adelay
*/
void adelay_init(object)
pwr_sClass_adelay *object;
void adelay_init( pwr_sClass_adelay *object)
{
object->StoredNumbers = 0;
object->StoInd = -1;
......@@ -563,8 +561,7 @@ void adelay_exec(
@aref pispeed PiSpeed
*/
void pispeed_init(object)
pwr_sClass_pispeed *object;
void pispeed_init( pwr_sClass_pispeed *object)
{
/* Read input */
object->PulsIn = *object->PulsInP;
......
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. 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
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview 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 Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#ifndef rt_plc_arithm_h
#define rt_plc_arithm_h
void sum_exec( plc_sThread *tp, pwr_sClass_sum *object);
void maxmin_exec( plc_sThread *tp, pwr_sClass_maxmin *object);
void limit_exec( plc_sThread *tp, pwr_sClass_limit *object);
void comph_exec( plc_sThread *tp, pwr_sClass_comph *object);
void compl_exec( plc_sThread *tp, pwr_sClass_compl *object);
void select_exec( plc_sThread *tp, pwr_sClass_select *object);
void ramp_init( pwr_sClass_ramp *object);
void ramp_exec( plc_sThread *tp, pwr_sClass_ramp *object);
void filter_init( pwr_sClass_filter *object);
void filter_exec( plc_sThread *tp, pwr_sClass_filter *object);
void speed_exec( plc_sThread *tp, pwr_sClass_speed *object);
void timint_exec( plc_sThread *tp, pwr_sClass_timint *object);
void curve_exec( plc_sThread *tp, pwr_sClass_curve *object);
void adelay_init( pwr_sClass_adelay *object);
void adelay_exec( plc_sThread *tp, pwr_sClass_adelay *object);
void pispeed_init( pwr_sClass_pispeed *object);
void pispeed_exec( plc_sThread *tp, pwr_sClass_pispeed *object);
void DtoMask_exec( plc_sThread *tp, pwr_sClass_DtoMask *object);
void MaskToD_exec( plc_sThread *tp, pwr_sClass_MaskToD *object);
void DtoEnum_exec( plc_sThread *tp, pwr_sClass_DtoEnum *object);
void EnumToD_exec( plc_sThread *tp, pwr_sClass_EnumToD *object);
void Mod_exec( plc_sThread *tp, pwr_sClass_Mod *object);
void Equal_exec( plc_sThread *tp, pwr_sClass_Equal *object);
void NotEqual_exec( plc_sThread *tp, pwr_sClass_NotEqual *object);
void GreaterEqual_exec( plc_sThread *tp, pwr_sClass_GreaterEqual *object);
void GreaterThan_exec( plc_sThread *tp, pwr_sClass_GreaterThan *object);
void LessEqual_exec( plc_sThread *tp, pwr_sClass_LessEqual *object);
void LessThan_exec( plc_sThread *tp, pwr_sClass_LessThan *object);
void IEqual_exec( plc_sThread *tp, pwr_sClass_IEqual *object);
void INotEqual_exec( plc_sThread *tp, pwr_sClass_INotEqual *object);
void IGreaterEqual_exec( plc_sThread *tp, pwr_sClass_IGreaterEqual *object);
void IGreaterThan_exec( plc_sThread *tp, pwr_sClass_IGreaterThan *object);
void ILessEqual_exec( plc_sThread *tp, pwr_sClass_ILessEqual *object);
void ILessThan_exec( plc_sThread *tp, pwr_sClass_ILessThan *object);
void IAdd_exec( plc_sThread *tp, pwr_sClass_IAdd *object);
void IMul_exec( plc_sThread *tp, pwr_sClass_IMul *object);
void ISub_exec( plc_sThread *tp, pwr_sClass_ISub *object);
void IDiv_exec( plc_sThread *tp, pwr_sClass_IDiv *object);
void IMax_exec( plc_sThread *tp, pwr_sClass_IMax *object);
void IMin_exec( plc_sThread *tp, pwr_sClass_IMin *object);
void ISel_exec( plc_sThread *tp, pwr_sClass_ISel *object);
void ILimit_exec( plc_sThread *tp, pwr_sClass_ILimit *object);
void IMux_exec( plc_sThread *tp, pwr_sClass_IMux *object);
void Mux_exec( plc_sThread *tp, pwr_sClass_Mux *object);
void Demux_exec( plc_sThread *tp, pwr_sClass_Demux *object);
void IDemux_exec( plc_sThread *tp, pwr_sClass_IDemux *object);
void Add_exec( plc_sThread *tp, pwr_sClass_Add *object);
void Mul_exec( plc_sThread *tp, pwr_sClass_Mul *object);
void Sub_exec( plc_sThread *tp, pwr_sClass_Sub *object);
void Div_exec( plc_sThread *tp, pwr_sClass_Div *object);
void Max_exec( plc_sThread *tp, pwr_sClass_Max *object);
void Min_exec( plc_sThread *tp, pwr_sClass_Min *object);
void BwShiftLeft_exec( plc_sThread *tp, pwr_sClass_BwShiftLeft *object);
void BwShiftRight_exec( plc_sThread *tp, pwr_sClass_BwShiftRight *object);
void BwRotateRight_exec( plc_sThread *tp, pwr_sClass_BwRotateRight *object);
void BwRotateLeft_exec( plc_sThread *tp, pwr_sClass_BwRotateLeft *object);
#endif
......@@ -45,6 +45,7 @@
#include "pwr.h"
#include "rt_plc.h"
#include "pwr_baseclasses.h"
#include "rt_plc_data.h"
/* Nice functions */
#define ODD(a) (((int)(a) & 1) != 0)
......
......@@ -41,4 +41,15 @@ typedef pwr_tBoolean pwr_sDpDistribute[24];
typedef pwr_tFloat32 pwr_sApDistribute[24];
typedef pwr_tInt32 pwr_sIpDistribute[24];
void DpCollect_exec( plc_sThread *tp, pwr_sClass_DpCollect *object);
void ApCollect_exec( plc_sThread *tp, pwr_sClass_ApCollect *object);
void IpCollect_exec( plc_sThread *tp, pwr_sClass_IpCollect *object);
void DpDistribute_exec( plc_sThread *tp, pwr_sClass_DpDistribute *object);
void ApDistribute_exec( plc_sThread *tp, pwr_sClass_ApDistribute *object);
void IpDistribute_exec( plc_sThread *tp, pwr_sClass_IpDistribute *object);
void DataCollect_exec( plc_sThread *tp, pwr_sClass_DataCollect *object);
void CStoAttrRefP_exec( plc_sThread *tp, pwr_sClass_CStoAttrRefP *object, pwr_sAttrRef *aref);
#endif
......@@ -58,7 +58,7 @@
#include "rt_ini_msg.h"
#include "rt_plc_msg.h"
#include "rt_plc.h"
#include "rt_plc_io.h"
#include "rt_plc_ioarea.h"
#if 0
/*
......
......@@ -39,6 +39,7 @@
#include "pwr_baseclasses.h"
#include "rt_plc.h"
#include "rt_plc_timer.h"
#include "rt_plc_drive.h"
/*_*
Drive
......
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. 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
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview 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 Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#ifndef rt_plc_drive_h
#define rt_plc_drive_h
void drive_exec( plc_sThread *tp, pwr_sClass_drive *object);
void valve_exec( plc_sThread *tp, pwr_sClass_valve *object);
void mvalve_exec( plc_sThread *tp, pwr_sClass_mvalve *object);
void posit_exec( plc_sThread *tp, pwr_sClass_posit *object);
#endif
......@@ -41,6 +41,7 @@
#include "pwr_baseclasses.h"
#include "rt_plc.h"
#include "rt_plc_timer.h"
#include "rt_plc_io.h"
/*_*
PiPos
......
......@@ -34,103 +34,31 @@
* General Public License plus this exception.
*/
#ifndef pwr_h
#include "pwr.h"
#endif
#define UC_NORMAL 0
#define UC_READ 1
#define UC_WRITE 2
#define UC_READ2 3
#define UC_WRITE2 4
#define _z_ ,
/* Direct link table */
typedef struct {
void **Pointer;
pwr_sAttrRef AttrRef;
pwr_tClassId ObjType;
pwr_tUInt32 Size;
pwr_tUInt32 UseCode;
pwr_tUInt32 Offset;
} plc_t_rtdbref;
typedef struct {
pwr_tBoolean ActualValue;
} plc_sClass_Di;
typedef struct {
pwr_tBoolean ActualValue;
} plc_sClass_Do;
typedef struct {
pwr_tBoolean ActualValue;
} plc_sClass_Po;
typedef struct {
pwr_tBoolean ActualValue;
} plc_sClass_Dv;
typedef struct {
pwr_tInt32 RawValue;
} plc_sClass_Co;
typedef struct {
pwr_tFloat32 ActualValue;
} plc_sClass_Ai;
typedef struct {
pwr_tFloat32 ActualValue;
} plc_sClass_Ao;
#ifndef rt_plc_io_h
#define rt_plc_io_h
void pipos_exec( plc_sThread *tp, pwr_sClass_pipos *object);
void count_exec( plc_sThread *tp, pwr_sClass_count *object);
void bcddo_exec( plc_sThread *tp, pwr_sClass_bcddo *object);
void dibcd_exec( plc_sThread *tp, pwr_sClass_dibcd *object);
void gray_exec( plc_sThread *tp, pwr_sClass_gray *object);
void GetDpPtr_init( pwr_sClass_GetDpPtr *o);
void GetDpPtr_exec( plc_sThread *tp, pwr_sClass_GetDpPtr *o);
void GetApPtr_init( pwr_sClass_GetApPtr *o);
void GetApPtr_exec( plc_sThread *tp, pwr_sClass_GetApPtr *o);
void GetIpPtr_init( pwr_sClass_GetIpPtr *o);
void GetIpPtr_exec( plc_sThread *tp, pwr_sClass_GetIpPtr *o);
void StoDpPtr_init( pwr_sClass_StoDpPtr *o);
void StoDpPtr_exec( plc_sThread *tp, pwr_sClass_StoDpPtr *o);
void StoApPtr_init( pwr_sClass_StoApPtr *o);
void StoApPtr_exec( plc_sThread *tp, pwr_sClass_StoApPtr *o);
void StoIpPtr_init( pwr_sClass_StoIpPtr *o);
void StoIpPtr_exec( plc_sThread *tp, pwr_sClass_StoIpPtr *o);
void EnumToStr_init( pwr_sClass_EnumToStr *o);
void EnumToStr_exec( plc_sThread *tp, pwr_sClass_EnumToStr *o);
void StrToEnum_init( pwr_sClass_StrToEnum *o);
void StrToEnum_exec( plc_sThread *tp, pwr_sClass_StrToEnum *o);
typedef struct {
pwr_tFloat32 ActualValue;
} plc_sClass_Av;
typedef struct {
pwr_tInt32 ActualValue;
} plc_sClass_Ii;
typedef struct {
pwr_tInt32 ActualValue;
} plc_sClass_Io;
typedef struct {
pwr_tInt32 ActualValue;
} plc_sClass_Iv;
typedef struct {
pwr_tBoolean ActualValue;
} plc_sClass_BBoolean;
typedef struct {
pwr_tInt64 ActualValue;
} plc_sClass_BInt64;
typedef struct {
pwr_tInt32 ActualValue;
} plc_sClass_BInt32;
typedef struct {
pwr_tInt16 ActualValue;
} plc_sClass_BInt16;
typedef struct {
pwr_tInt8 ActualValue;
} plc_sClass_BInt8;
typedef struct {
pwr_tFloat32 ActualValue;
} plc_sClass_BFloat32;
typedef struct {
pwr_tFloat64 ActualValue;
} plc_sClass_BFloat64;
typedef struct {
char ActualValue[1];
} plc_sClass_BString;
#endif
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. 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
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview 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 Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#ifndef pwr_h
#include "pwr.h"
#endif
#define UC_NORMAL 0
#define UC_READ 1
#define UC_WRITE 2
#define UC_READ2 3
#define UC_WRITE2 4
#define _z_ ,
/* Direct link table */
typedef struct {
void **Pointer;
pwr_sAttrRef AttrRef;
pwr_tClassId ObjType;
pwr_tUInt32 Size;
pwr_tUInt32 UseCode;
pwr_tUInt32 Offset;
} plc_t_rtdbref;
typedef struct {
pwr_tBoolean ActualValue;
} plc_sClass_Di;
typedef struct {
pwr_tBoolean ActualValue;
} plc_sClass_Do;
typedef struct {
pwr_tBoolean ActualValue;
} plc_sClass_Po;
typedef struct {
pwr_tBoolean ActualValue;
} plc_sClass_Dv;
typedef struct {
pwr_tInt32 RawValue;
} plc_sClass_Co;
typedef struct {
pwr_tFloat32 ActualValue;
} plc_sClass_Ai;
typedef struct {
pwr_tFloat32 ActualValue;
} plc_sClass_Ao;
typedef struct {
pwr_tFloat32 ActualValue;
} plc_sClass_Av;
typedef struct {
pwr_tInt32 ActualValue;
} plc_sClass_Ii;
typedef struct {
pwr_tInt32 ActualValue;
} plc_sClass_Io;
typedef struct {
pwr_tInt32 ActualValue;
} plc_sClass_Iv;
typedef struct {
pwr_tBoolean ActualValue;
} plc_sClass_BBoolean;
typedef struct {
pwr_tInt64 ActualValue;
} plc_sClass_BInt64;
typedef struct {
pwr_tInt32 ActualValue;
} plc_sClass_BInt32;
typedef struct {
pwr_tInt16 ActualValue;
} plc_sClass_BInt16;
typedef struct {
pwr_tInt8 ActualValue;
} plc_sClass_BInt8;
typedef struct {
pwr_tFloat32 ActualValue;
} plc_sClass_BFloat32;
typedef struct {
pwr_tFloat64 ActualValue;
} plc_sClass_BFloat64;
typedef struct {
char ActualValue[1];
} plc_sClass_BString;
......@@ -46,9 +46,15 @@
#include "pwr_baseclasses.h"
#include "co_time.h"
#include "rt_plc.h"
#include "rt_plc_io.h"
#include "rt_plc_rt.h"
#include "rt_plc_dirlink.h"
#include "rt_plc_ioarea.h"
#include "rt_plc_timer.h"
#include "rt_plc_arithm.h"
#include "rt_plc_io.h"
#include "rt_plc_pid.h"
#include "rt_plc_data.h"
#include "rt_plc_drive.h"
#include "rt_plc_macro_logic.h"
#include "rt_plc_macro_io.h"
#include "rt_plc_macro_grafcet.h"
......@@ -59,9 +65,11 @@
#include "rt_plc_macro_time.h"
#include "pwr_nmpsclasses.h"
#include "nmps_plc_macro.h"
#include "nmps.h"
#include "pwr_profibusclasses.h"
#include "pwr_remoteclasses.h"
#include "remote_plc_macro.h"
#include "pwr_basecomponentclasses.h"
#include "rt_plc_bcomp.h"
#include "ra_plc_user.h"
......@@ -38,11 +38,6 @@
#define true 1
#define _z_ ,
static pwr_tBoolean *pointer;
static pwr_tBoolean **ppointer;
static pwr_tBoolean test;
static pwr_tBoolean order_old;
/*_*
InitStep
......@@ -128,31 +123,31 @@ static pwr_tBoolean order_old;
#define trans_exec(obj,insteplist,outsteplist,cond) \
{ \
pwr_tBoolean *inpntr[] = insteplist; \
pwr_tBoolean *outpntr[] = outsteplist; \
pwr_tBoolean *inptr[] = insteplist; \
pwr_tBoolean *outptr[] = outsteplist; \
pwr_tBoolean test; \
int idx; \
\
/* Test condition */ \
cond \
if ( obj->Man ) obj->Cond = obj->OpCond; \
if ( obj->Cond ) \
{ \
if ( obj->Man) obj->Cond = obj->OpCond; \
if ( obj->Cond) { \
/* Test if step(s) above are active */ \
test = true; \
ppointer = inpntr; \
while ( test && *ppointer != NULL ) \
{ \
pointer = *ppointer++; \
if ( !*pointer++ ) test = false; \
else if ( !*pointer ) test = false; \
idx = 0; \
while ( test && inptr[idx] != NULL ) { \
if ( !*inptr[idx]) test = false; \
else if ( !*(inptr[idx]+1)) test = false; \
idx++; \
} \
/* Transfer active status to step(s) below */ \
if ( test ) \
{ \
ppointer = inpntr; \
while ( *ppointer != NULL ) \
**ppointer++ = false; \
ppointer = outpntr; \
while ( *ppointer != NULL ) \
**ppointer++ = true; \
if ( test) { \
idx = 0; \
while ( inptr[idx] != NULL ) \
*inptr[idx++] = false; \
idx = 0; \
while ( outptr[idx] != NULL ) \
*outptr[idx++] = true; \
obj->OpCond = false; \
} \
} \
......@@ -164,12 +159,15 @@ static pwr_tBoolean order_old;
*/
#define order_exec(obj,stepobj,chain) \
{ \
pwr_tBoolean order_old; \
order_old = obj->Status[0]; \
obj->Status[0] = stepobj->Status[0]; \
if (obj->Status[0] || order_old || stepobj->Status[0] || stepobj->Status[1]) \
{ \
chain \
}
} \
}
/*_*
DOrder
......
......@@ -191,11 +191,4 @@
obj->Status = false; \
}
/*_*
STRCAT
@aref strcat Strcat
*/
#define Strcat_exec(obj,str1,str2) \
strcpy(obj->ActVal, str1); \
strncat(obj->ActVal, str2, sizeof(obj->ActVal));
......@@ -86,12 +86,12 @@
@aref asup ASup
*/
#define ASup_exec(o, In, con)\
if (o->High && In <= o->CtrlLimit - o->Hysteres \
|| !o->High && In >= o->CtrlLimit + o->Hysteres \
if ((o->High && In <= o->CtrlLimit - o->Hysteres) || \
(!o->High && In >= o->CtrlLimit + o->Hysteres) \
) { \
if (o->Action) o->Action = FALSE; \
if (o->ReturnCheck) { \
time_GetTime(&o->ReturnTime); \
time_GetTime(&o->ReturnTime); \
o->ReturnCheck = FALSE; \
o->ReturnSend = TRUE; \
} \
......@@ -99,9 +99,9 @@
o->TimerCount = 0; \
o->DetectCheck = TRUE; \
} \
} else if (con && (o->High && In > o->CtrlLimit \
|| !o->High && In < o->CtrlLimit) \
) { \
} else if (con && \
((o->High && In > o->CtrlLimit) || \
(!o->High && In < o->CtrlLimit))) { \
if (!o->Action) o->Action = TRUE; \
if (o->AlarmCheck && o->DetectOn && !o->Blocked) { \
if (o->DetectCheck) { \
......
......@@ -44,6 +44,7 @@
#include "pwr_baseclasses.h"
#include "rt_plc.h"
#include "rt_plc_timer.h"
#include "rt_plc_pid.h"
/* PLC RUTINER */
......@@ -54,8 +55,7 @@
@aref inc3p Inc3p
*/
void inc3p_init(object)
pwr_sClass_inc3p *object;
void inc3p_init( pwr_sClass_inc3p *object)
{
object->Acc = 0;
}
......
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. 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
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview 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 Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#ifndef rt_plc_pid_h
#define rt_plc_pid_h
void inc3p_init( pwr_sClass_inc3p *object);
void inc3p_exec( plc_sThread *tp, pwr_sClass_inc3p *object);
void pos3p_exec( plc_sThread *tp, pwr_sClass_pos3p *object);
void out2p_exec( plc_sThread *tp, pwr_sClass_out2p *object);
void mode_exec( plc_sThread *tp, pwr_sClass_mode *object);
void pid_exec( plc_sThread *tp, pwr_sClass_pid *object);
#endif
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. 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
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview 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 Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#ifndef ssabox_h
#define ssabox_h
#include "rt_plc.h"
#include "pwr_ssaboxclasses.h"
#include "ssabox_plc_servoreg.h"
#include "ssabox_plc_antisway.h"
void PidX_exec( plc_sThread *tp, pwr_sClass_PidX *object);
#endif
......@@ -40,6 +40,7 @@
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "rt_plc.h"
#include "ssabox.h"
#define ODD(a) (((int)(a) & 1) != 0)
#define EVEN(a) (((int)(a) & 1) == 0)
......
......@@ -352,7 +352,7 @@ if [ $OpSys -eq $OpSys_PPC_LINUX ]; then
pwrp_gc="$pwrp_tmp"
# Suppress all warnings, -x
cc_cmd="$cc -c -x c -w $cc_debug -D_REENTRANT -DOS_LINUX -I$pwrinc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
cc_cmd="$cc -c -x c -Wall $cc_debug -D_REENTRANT -DOS_LINUX -I$pwrinc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
FileTypeStr="`echo $vFileType| cut -f $FileTypeIdx -d ,`"
......@@ -365,7 +365,7 @@ elif [ $OpSys -eq $OpSys_X86_LINUX ]; then
# Suppress all warnings, -x
if [ $CurrentOpSys -eq $OpSys ]; then
cc_cmd="$cc -c -x c -w $cc_debug -D_REENTRANT -DOS_LINUX -I$pwrinc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
cc_cmd="$cc -c -x c -Wall $cc_debug -D_REENTRANT -DOS_LINUX -I$pwrinc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
FileTypeStr="`echo $vFileType| cut -f $FileTypeIdx -d ,`"
......@@ -381,7 +381,7 @@ elif [ $OpSys -eq $OpSys_X86_64_LINUX ]; then
# Suppress all warnings, -x
if [ $CurrentOpSys -eq $OpSys ]; then
cc_cmd="$cc -c -x c -w $cc_debug -D_REENTRANT -DOS_LINUX -I$pwrinc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
cc_cmd="$cc -c -x c -Wall $cc_debug -D_REENTRANT -DOS_LINUX -I$pwrinc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
FileTypeStr="`echo $vFileType| cut -f $FileTypeIdx -d ,`"
......@@ -398,7 +398,7 @@ elif [ $OpSys -eq $OpSys_ARM_LINUX ]; then
echo "-- Cross compilation ARM_LINUX"
# Suppress all warnings, -x
cc_cmd="$cc -c -x c -w $cc_debug -D_REENTRANT -DOS_LINUX -I$pwrinc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
cc_cmd="$cc -c -x c -Wall $cc_debug -D_REENTRANT -DOS_LINUX -I$pwrinc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
FileTypeStr="`echo $vFileType| cut -f $FileTypeIdx -d ,`"
......
......@@ -157,7 +157,7 @@ CompileProgram()
CompileWindow()
{
if $cc_cmd -o $pwrp_obj/plc_m${FileName}.o $pwrp_gc/plc_m${FileName}.gc
if $cc_cmd -Wall -o $pwrp_obj/plc_m${FileName}.o $pwrp_gc/plc_m${FileName}.gc
then
echo "-- Plc window compiled for $OsStr $say_debug $ObjectName"
gcg_status=$gcg__success
......@@ -352,7 +352,7 @@ if [ $OpSys -eq $OpSys_PPC_LINUX ]; then
pwrp_gc="$pwrp_tmp"
# Suppress all warnings, -x
cc_cmd="$cc -c -x c -w $cc_debug -D_REENTRANT -DOS_LINUX -DOS_POSIX -I$pwr_inc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
cc_cmd="$cc -c -x c -Wall $cc_debug -D_REENTRANT -DOS_LINUX -DOS_POSIX -I$pwr_inc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
FileTypeStr="`echo $vFileType| cut -f $FileTypeIdx -d ,`"
......@@ -365,7 +365,7 @@ elif [ $OpSys -eq $OpSys_X86_LINUX ]; then
# Suppress all warnings, -x
if [ $CurrentOpSys -eq $OpSys ]; then
cc_cmd="$cc -c -x c -w $cc_debug -D_REENTRANT -DOS_LINUX -DOS_POSIX -I$pwr_inc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
cc_cmd="$cc -c -x c -Wall $cc_debug -D_REENTRANT -DOS_LINUX -DOS_POSIX -I$pwr_inc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
FileTypeStr="`echo $vFileType| cut -f $FileTypeIdx -d ,`"
......@@ -381,7 +381,7 @@ elif [ $OpSys -eq $OpSys_X86_LINUX ]; then
export pwrp_exe=$pwrp_root/bld/x86_linux/exe
export pwrp_lib=$pwrp_root/bld/x86_linux/lib
export pwrp_obj=$pwrp_root/bld/x86_linux/obj
cc_cmd="$cc -c -x c -w -m32 -fPIC $cc_debug -D_REENTRANT -DOS_LINUX -DOS_POSIX -I$pwr_inc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
cc_cmd="$cc -c -x c -Wall -m32 -fPIC $cc_debug -D_REENTRANT -DOS_LINUX -DOS_POSIX -I$pwr_inc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
ldxx="g++ -m32 -fPIC"
FileTypeStr="`echo $vFileType| cut -f $FileTypeIdx -d ,`"
......@@ -401,7 +401,7 @@ elif [ $OpSys -eq $OpSys_X86_64_LINUX ]; then
# Suppress all warnings, -x
if [ $CurrentOpSys -eq $OpSys ]; then
cc_cmd="$cc -c -x c -w $cc_debug -D_REENTRANT -DOS_LINUX -DOS_POSIX -I$pwr_inc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
cc_cmd="$cc -c -x c -Wall $cc_debug -D_REENTRANT -DOS_LINUX -DOS_POSIX -I$pwr_inc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
FileTypeStr="`echo $vFileType| cut -f $FileTypeIdx -d ,`"
......@@ -417,7 +417,7 @@ elif [ $OpSys -eq $OpSys_X86_64_LINUX ]; then
export pwrp_exe=$pwrp_root/bld/x86_64_linux/exe
export pwrp_lib=$pwrp_root/bld/x86_64_linux/lib
export pwrp_obj=$pwrp_root/bld/x86_64_linux/obj
cc_cmd="$cc -c -x c -w -m64 -fPIC $cc_debug -D_REENTRANT -DOS_LINUX -DOS_POSIX -I$pwr_inc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
cc_cmd="$cc -c -x c -Wall -m64 -fPIC $cc_debug -D_REENTRANT -DOS_LINUX -DOS_POSIX -I$pwr_inc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
ldxx="g++ -m64 -fPIC"
FileTypeStr="`echo $vFileType| cut -f $FileTypeIdx -d ,`"
......
......@@ -5,7 +5,7 @@
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* 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.
*
......@@ -4267,7 +4267,7 @@ static void gcg_print_rtdbref(
/* Print direct link command */
if ( reftype == 0) {
IF_PR fprintf( gcgctx->files[GCGM1_RTDBREF_FILE],
"{ (void **)&%c%s, {{%u,%u},0,0,0,0}, %u, sizeof(*%c%s), %ld, 0},\n",
"{ (void **)&%c%s, {{%u,%u},0,0,0, {0}}, %uUL, sizeof(*%c%s), %ld, 0},\n",
prefix,
vldh_IdToStr(0, objdid),
objdid.oix, objdid.vid,
......@@ -4278,7 +4278,7 @@ static void gcg_print_rtdbref(
}
else {
IF_PR fprintf( gcgctx->files[GCGM1_RTDBREF2_FILE],
"{ (void **)&%c%s, {{%u,%u},0,0,0,0}, %u, sizeof(*%c%s), %ld, 0},\n",
"{ (void **)&%c%s, {{%u,%u},0,0,0,{0}}, %uUL, sizeof(*%c%s), %ld, 0},\n",
prefix,
vldh_IdToStr(0, objdid),
objdid.oix, objdid.vid,
......@@ -4302,7 +4302,7 @@ static void gcg_print_artdbref(
/* Print direct link command */
if ( reftype == 0) {
IF_PR fprintf( gcgctx->files[GCGM1_RTDBREF_FILE],
"{ (void **)&%c%s, {{%u,%u},%u,%u,%u,%u}, %u, sizeof(*%c%s), %ld, %u},\n",
"{ (void **)&%c%s, {{%u,%u},%uUL,%u,%u,{%u}}, %uUL, sizeof(*%c%s), %ld, %u},\n",
prefix,
vldh_AttrRefToStr(0, attrref),
attrref.Objid.oix, attrref.Objid.vid, attrref.Body,
......@@ -4315,7 +4315,7 @@ static void gcg_print_artdbref(
}
else {
IF_PR fprintf( gcgctx->files[GCGM1_RTDBREF2_FILE],
"{ (void **)&%c%s, {{%u,%u},%u,%u,%u,%u}, %u, sizeof(*%c%s), %ld, %u},\n",
"{ (void **)&%c%s, {{%u,%u},%uUL,%u,%u,{%u}}, %uUL, sizeof(*%c%s), %ld, %u},\n",
prefix,
vldh_AttrRefToStr(0, attrref),
attrref.Objid.oix, attrref.Objid.vid, attrref.Body,
......@@ -5701,6 +5701,18 @@ int gcg_comp_rtnode(
(timebase+i)->prio, (timebase+i)->scantime,
(timebase+i)->plc_count);
/* Prototypes */
for ( k = 0; k < (timebase+i)->plc_count; k++ ) {
fprintf( files[0],
"void %c%s_init( int DirectLink, plc_sThread *tp);\n",
GCG_PREFIX_MOD, vldh_IdToStr(0, (timebase+i)->plclist[k]));
}
for ( k = 0; k < (timebase+i)->plc_count; k++ ) {
fprintf( files[0],
"void %c%s_exec( plc_sThread *tp);\n",
GCG_PREFIX_MOD, vldh_IdToStr(0, (timebase+i)->plclist[k]));
}
/* Init */
fprintf( files[0],
"void plc_p%d_init( int DirectLink, plc_sThread *tp){\n",
......@@ -6137,6 +6149,18 @@ int gcg_comp_m0( vldh_t_plc plc,
fprintf( files[ GCGM0_MODULE_FILE ],
"#include \"%s\"\n", PLCINC);
/* Print pototype declarations for the exec and init function */
for ( i = 0; i < (int)ldhwind_count; i++)
{
fprintf( files[ GCGM0_MODULE_FILE ],
"void %c%s_init( int DirectLink, plc_sThread *tp);\n",
GCG_PREFIX_MOD, vldh_IdToStr(0, *(ldhwindlist + i)));
}
fprintf( files[ GCGM0_MODULE_FILE ],
"void %c%s_exec( plc_sThread *tp);\n",
GCG_PREFIX_MOD, vldh_IdToStr(0, *ldhwindlist));
fprintf( files[ GCGM0_MODULE_FILE ],
"void %c%s_init( int DirectLink, plc_sThread *tp){\n",
GCG_PREFIX_MOD, vldh_IdToStr(0, plc->lp.oid));
......@@ -6399,9 +6423,9 @@ int gcg_comp_m1( vldh_t_wind wind,
"void %c%s_init( int DirectLink, plc_sThread *tp){\n",
GCG_PREFIX_MOD, vldh_IdToStr(0, wind->lw.oid));
IF_PR fprintf( gcgctx->files[ GCGM1_MODULE_FILE ],
"if (DirectLink == 1)\n plc_rtdbref( &rtdbref, tp);\n");
"if (DirectLink == 1)\n plc_rtdbref( (struct plc_rtdbref (*)[]) &rtdbref, tp);\n");
IF_PR fprintf( gcgctx->files[ GCGM1_MODULE_FILE ],
"else if (DirectLink == 2)\n plc_rtdbref( &rtdbref2, tp);\n");
"else if (DirectLink == 2)\n plc_rtdbref( (struct plc_rtdbref (*)[]) &rtdbref2, tp);\n");
IF_PR fprintf( gcgctx->files[ GCGM1_MODULE_FILE ],
"else\n {\n#include \"%s%s\"\n }\n}\n\n",
gcgctx->filenames[ GCGM1_REF_FILE ], GCEXT);
......@@ -7702,6 +7726,10 @@ int gcg_comp_m15( gcg_ctx gcgctx, vldh_t_node node)
if ( wind_found )
{
/* Print the window execute command */
IF_PR fprintf( gcgctx->files[GCGM1_DECL_FILE],
"void %c%s_exec(plc_sThread *tp);",
GCG_PREFIX_MOD,
vldh_IdToStr(0, windowobjdid));
IF_PR fprintf( gcgctx->files[GCGM1_CODE_FILE],
"%c%s_exec( tp);\n",
GCG_PREFIX_MOD,
......@@ -8115,6 +8143,10 @@ int gcg_comp_m16( gcg_ctx gcgctx, vldh_t_node node)
else if ( wind_found )
{
/* Print execute command for the subwindow */
IF_PR fprintf( gcgctx->files[GCGM1_DECL_FILE],
"void %c%s_exec(plc_sThread *tp);",
GCG_PREFIX_MOD,
vldh_IdToStr(0, windobjdid));
IF_PR fprintf( gcgctx->files[GCGM1_CODE_FILE],
"%c%s_exec( tp);",
GCG_PREFIX_MOD,
......@@ -8210,6 +8242,10 @@ int gcg_comp_m16( gcg_ctx gcgctx, vldh_t_node node)
else if ( wind_found )
{
/* There should be an activity window */
IF_PR fprintf( gcgctx->files[GCGM1_DECL_FILE],
"void %c%s_exec(plc_sThread *tp);",
GCG_PREFIX_MOD,
vldh_IdToStr(0, windobjdid));
IF_PR fprintf( gcgctx->files[GCGM1_CODE_FILE],
"%c%s_exec( tp);\n",
GCG_PREFIX_MOD,
......@@ -8893,6 +8929,10 @@ int gcg_comp_m17( gcg_ctx gcgctx, vldh_t_node node)
else
{
/* Print the window execute command */
IF_PR fprintf( gcgctx->files[GCGM1_DECL_FILE],
"void %c%s_exec(plc_sThread *tp);",
GCG_PREFIX_MOD,
vldh_IdToStr(0, windowobjdid));
IF_PR fprintf( gcgctx->files[GCGM1_CODE_FILE],
" ,%c%s_exec( tp);",
GCG_PREFIX_MOD,
......@@ -9800,6 +9840,10 @@ int gcg_comp_m24( gcg_ctx gcgctx, vldh_t_node node)
else
{
/* Print the window execute command */
IF_PR fprintf( gcgctx->files[GCGM1_DECL_FILE],
"void %c%s_exec(plc_sThread *tp);",
GCG_PREFIX_MOD,
vldh_IdToStr(0, windowobjdid));
IF_PR fprintf( gcgctx->files[GCGM1_CODE_FILE],
"%c%s_exec( tp);,\n",
GCG_PREFIX_MOD,
......@@ -10935,6 +10979,10 @@ int gcg_comp_m33( gcg_ctx gcgctx, vldh_t_node node)
if ( wind_found )
{
/* Print the window execute command */
IF_PR fprintf( gcgctx->files[GCGM1_DECL_FILE],
"void %c%s_exec(plc_sThread *tp);",
GCG_PREFIX_MOD,
vldh_IdToStr(0, windowobjdid));
IF_PR fprintf( gcgctx->files[GCGM1_CODE_FILE],
"%c%s_exec( tp);\n",
GCG_PREFIX_MOD,
......@@ -12322,7 +12370,7 @@ int gcg_comp_m41( gcg_ctx gcgctx, vldh_t_node node)
else
{
IF_PR fprintf( gcgctx->files[GCGM1_REF_FILE],
"%c%s->%sP = %c%s;\n",
"%c%s->%sP = (pwr_tInt32 *)%c%s;\n",
GCG_PREFIX_REF,
vldh_IdToStr(0, node->ln.oid),
bodydef[i].Par->Param.Info.PgmName,
......@@ -12618,7 +12666,7 @@ int gcg_comp_m43( gcg_ctx gcgctx, vldh_t_node node)
/* The Out parameter will contain the pointer to the
referenced object */
IF_PR fprintf( gcgctx->files[GCGM1_REF_FILE],
"%c%s->Out = %c%s;\n",
"%c%s->Out = (pwr_tVoid *)%c%s;\n",
GCG_PREFIX_REF,
vldh_IdToStr(0, node->ln.oid),
GCG_PREFIX_REF,
......@@ -13052,6 +13100,10 @@ int gcg_comp_m46( gcg_ctx gcgctx, vldh_t_node node)
/* Print the window execute command */
IF_PR fprintf( gcgctx->files[GCGM1_DECL_FILE],
"void %c%s_exec(plc_sThread *tp);",
GCG_PREFIX_MOD,
vldh_IdToStr(0, windowobjdid));
IF_PR fprintf( gcgctx->files[GCGM1_CODE_FILE],
"%c%s_exec( tp)",
GCG_PREFIX_MOD,
......@@ -13470,6 +13522,10 @@ int gcg_comp_m50( gcg_ctx gcgctx, vldh_t_node node)
/* Print the window execute command */
if ( wind_found)
{
IF_PR fprintf( gcgctx->files[GCGM1_DECL_FILE],
"void %c%s_exec(plc_sThread *tp);",
GCG_PREFIX_MOD,
vldh_IdToStr(0, windowobjdid));
IF_PR fprintf( gcgctx->files[GCGM1_CODE_FILE],
"%c%s_exec( tp)",
GCG_PREFIX_MOD,
......@@ -13584,19 +13640,23 @@ int gcg_comp_m51( gcg_ctx gcgctx, vldh_t_node node)
{
int sts;
ldh_tSesContext ldhses;
char cast_str[40];
ldhses = (node->hn.wind)->hw.ldhses;
sts = gcg_comp_m4( gcgctx, node);
if ( EVEN(sts)) return sts;
strcpy( cast_str, "(pwr_tFloat32 *)");
/* Place the pointer to the object in the output */
IF_PR fprintf( gcgctx->files[GCGM1_REF_FILE],
"%c%s->OutDataP = %c%s;\n",
GCG_PREFIX_REF,
vldh_IdToStr(0, node->ln.oid),
GCG_PREFIX_REF,
vldh_IdToStr(1, node->ln.oid));
"%c%s->OutDataP = %s%c%s;\n",
GCG_PREFIX_REF,
vldh_IdToStr(0, node->ln.oid),
cast_str,
GCG_PREFIX_REF,
vldh_IdToStr(1, node->ln.oid));
/* Place the objid of the object in the output */
IF_PR fprintf( gcgctx->files[GCGM1_REF_FILE],
......@@ -14035,6 +14095,10 @@ int gcg_comp_m53( gcg_ctx gcgctx, vldh_t_node node)
if ( node->ln.cid == pwr_cClass_Func)
{
/* Print the window execute command */
IF_PR fprintf( gcgctx->files[GCGM1_DECL_FILE],
"void %c%s_exec(plc_sThread *tp);",
GCG_PREFIX_MOD,
vldh_IdToStr(0, window_objid));
IF_PR fprintf( gcgctx->files[GCGM1_CODE_FILE],
", %c%s_exec( tp)",
GCG_PREFIX_MOD,
......@@ -15075,6 +15139,10 @@ int gcg_comp_m58( gcg_ctx gcgctx, vldh_t_node node)
free((char *) bodydef);
/* Print the window execute command */
IF_PR fprintf( gcgctx->files[GCGM1_DECL_FILE],
"void %c%s_exec(plc_sThread *tp);",
GCG_PREFIX_MOD,
vldh_IdToStr(0, window_objid));
IF_PR fprintf( gcgctx->files[GCGM1_CODE_FILE],
"%c%s_exec( tp);\n",
GCG_PREFIX_MOD,
......
......@@ -509,8 +509,15 @@ int gsx_check_connection(
/* source and destination has to be of the same type */
if ( source_pointer_flag != dest_pointer_flag)
return GSX__CONTYPE;
else if ( source_type != dest_type)
return GSX__CONTYPE;
else if ( source_type != dest_type) {
if ( source_pointer_flag && dest_pointer_flag &&
(source_type == pwr_eType_Float32 || source_type == pwr_eType_Void) &&
(dest_type == pwr_eType_Float32 || dest_type == pwr_eType_Void)) {
/* Ok */
}
else
return GSX__CONTYPE;
}
}
if ( source_pointer_flag)
*conclass = DATA_CONN;
......@@ -779,6 +786,13 @@ int gsx_auto_create(
if ( EVEN(sts)) return sts;
*destpoint = 0;
break;
case pwr_eType_Void:
if ( source_pointer_flag)
sts = foe->gre->create_node( pwr_cClass_GetData,
x, y, dest);
if ( EVEN(sts)) return sts;
*destpoint = 0;
break;
default:
free((char *) bodydef);
return 0;
......
......@@ -131,6 +131,8 @@ static wbl_sSym datatypes[] =
,{ "pwr_eTdix_ObjBodyDefFlags", pwr_eTdix_ObjBodyDefFlags }
,{ "pwr_eType_DataRef", pwr_eType_DataRef }
,{ "pwr_eTix_DataRef", pwr_eTix_DataRef }
,{ "pwr_eType_Void", pwr_eType_Void }
,{ "pwr_eTix_Void", pwr_eTix_Void }
,{ 0, 0 }
};
......
......@@ -4217,6 +4217,12 @@ int GeValueInput::action( grow_tObject object, glow_tEvent event)
break;
}
case glow_eEvent_Key_Escape:
if ( grow_AnnotationInputIsOpen( object, 1)) {
grow_CloseAnnotationInputAll( dyn->graph->grow->ctx);
grow_SetObjectInputFocus( object, 0, event->event);
}
break;
default: ;
}
return 1;
......
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