Commit 23672a06 authored by Claes's avatar Claes Committed by Esteban Blanc

Plc class DtoI added

parent 92b4c0c8
...@@ -410,6 +410,12 @@ ...@@ -410,6 +410,12 @@
if (cond) \ if (cond) \
strncpy(obj->ActualValue, in, 80); strncpy(obj->ActualValue, in, 80);
/*_*
DtoI
@aref dtoi DtoI
*/
#define DtoI_exec(obj, in) obj->ActVal = in ? 1 : 0;
/*_* /*_*
AtoI AtoI
@aref atoi AtoI @aref atoi AtoI
......
!
! ProviewR Open Source Process Control.
! Copyright (C) 2005-2020 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.
!
! pwrb_c_dtoi.wb_load -- Defines the class DtoI.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_macro_io.h
! @Group Plc,PlcConversion
! @Summary Convert analog value to integer
! Convert analog value to integer.
! @image orm_dtoi_fo.gif
!
! The DtoI object converts a digital value (pwr_tBoolean) to
! an integer (pwr_tInt32) stored in ActVal.
! The analog value is rounded to closest integer value.
!*/
Object DtoI $ClassDef 720
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_Connections
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "DtoI"
EndBody
!/**
! Digital input that will be converted to integer.
!*/
Object In $Input 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
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
!/**
! Output that contains the integer.
!*/
Object ActVal $Output 3
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr TypeRef = "pwrs:Type-$Int32"
Attr GraphName = "Val"
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 = "DtoI"
Attr graphname = "DtoI"
EndBody
EndObject
EndObject
EndSObject
...@@ -67,6 +67,13 @@ palette NavigatorPalette ...@@ -67,6 +67,13 @@ palette NavigatorPalette
class BoFloatArray100 class BoFloatArray100
class BoString80 class BoString80
} }
menu Light
{
class LightAv
class LightDv
class LightIv
class LightSv
}
} }
menu DataStorage menu DataStorage
{ {
...@@ -1076,6 +1083,7 @@ palette PlcEditorPalette ...@@ -1076,6 +1083,7 @@ palette PlcEditorPalette
class AtoStr class AtoStr
class BCDDo class BCDDo
class DiBCD class DiBCD
class DtoI
class DtoMask class DtoMask
class DtoEnum class DtoEnum
class DtoStr class DtoStr
......
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