Commit db105fe4 authored by claes's avatar claes

Classes AToDt and CurrentTime added

parent 99fd2831
/*
* Proview $Id: rt_plc_macro_time.h,v 1.2 2006-05-02 07:06:09 claes Exp $
* Proview $Id: rt_plc_macro_time.h,v 1.3 2006-05-09 05:39:00 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -129,6 +129,20 @@
#define DtToA_exec(obj,t) \
time_DToFloat( &obj->ActVal, &t);
/*_*
ATODT
@aref atodt AToDt
*/
#define AToDt_exec(obj, val) \
time_FloatToD( &obj->DTime, val);
/*_*
CURRENTTIME
@aref currentime CurrentTime
*/
#define CurrentTime_exec(obj) \
obj->Time = tp->pp->Node->SystemTime;
/*_*
ATGREATERTHAN
@aref atgreaterthan AtGreaterThan
......
!
! Proview $Id: pwrb_c_atodt.wb_load,v 1.1 2006-05-09 05:39:00 claes Exp $
! Copyright (C) 2005 SSAB Oxelsund AB.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with the program, if not, write to the Free Software
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!
! pwrb_c_atodt.wb_load -- Defines the class AToDt.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_macro_time.h
! @Group Plc,PlcTime
! @Summary Convert an analog value to delta time.
! Convert an analog value to delta time.
! @image orm_atodt_fo.gif
!
! AToDt converts an analog value to a delta time.
!*/
Object AToDt $ClassDef 471
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_Connections
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "AToDt"
EndBody
!/**
! Analog input.
!*/
Object In $Input 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_RTVIRTUAL
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_NOREMOVE
Attr GraphName = "In"
EndBody
EndObject
!/**
! The time converted to a delta time.
!*/
Object DTime $Output 3
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "DTim"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object PlcNode $Buffer 1
Body SysBody
Attr Class = pwr_eClass_PlcNode
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
EndObject
Object GraphPlcNode $GraphPlcNode
Body SysBody
Attr object_type = 11
Attr parameters[0] = 1
Attr parameters[1] = 0
Attr parameters[2] = 1
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 1
Attr graphindex = 0
Attr default_mask[0] = 1
Attr default_mask[1] = 1
Attr segname_annotation = 1
Attr compmethod = 5
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr executeordermethod = 2
Attr objname = "AToDt"
Attr graphname = "AToDt"
EndBody
EndObject
EndObject
EndSObject
!
! Proview $Id: pwrb_c_currenttime.wb_load,v 1.1 2006-05-09 05:39:00 claes Exp $
! Copyright (C) 2005 SSAB Oxelsund AB.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with the program, if not, write to the Free Software
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!
! pwrb_c_atodt.wb_load -- Defines the class AToDt.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_macro_time.h
! @Group Plc,PlcTime
! @Summary Get the current time.
! Get the current time.
! @image orm_currenttime_fo.gif
!
! Current time fetches the current time and returns an absolute time.
!*/
Object CurrentTime $ClassDef 472
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_Connections
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "CurrentTime"
EndBody
!/**
! The current time.
!*/
Object Time $Output 3
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "Tim"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object PlcNode $Buffer 1
Body SysBody
Attr Class = pwr_eClass_PlcNode
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
EndObject
Object GraphPlcNode $GraphPlcNode
Body SysBody
Attr object_type = 11
Attr parameters[0] = 0
Attr parameters[1] = 0
Attr parameters[2] = 1
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 7
Attr graphindex = 1
Attr default_mask[0] = 0
Attr default_mask[1] = 1
Attr segname_annotation = 1
Attr compmethod = 55
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr executeordermethod = 2
Attr objname = "CurrentTime"
Attr graphname = "CurrentTime"
EndBody
EndObject
EndObject
EndSObject
......@@ -126,15 +126,6 @@ palette NavigatorPalette
{
class Pb_DP_Slave
}
menu Modules
{
class Pb_Di
class Pb_Do
class Pb_Ai
class Pb_Ao
class Pb_Ii
class Pb_Io
}
}
menu Remote
{
......@@ -656,13 +647,21 @@ palette PlcEditorPalette
menu Time
{
class AtAdd
class AtEqual
class AtGreaterThan
class AtLessThan
class AToDt
class AtSub
class AtDtSub
class CStoATp
class CStoATv
class CStoDTp
class CStoDTv
class CurrentTime
class DtAdd
class DtEqual
class DtGreaterThan
class DtLessThan
class DtSub
class DtToA
class GetATp
......
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