Commit dd3eb210 authored by Claes Sjofors's avatar Claes Sjofors

IO Buffer channels BiBlob and BoBlob for not IO-copied data added

parent c8615088
This diff is collapsed.
......@@ -357,6 +357,34 @@ pwr_tStatus io_bus_card_init( io_tCtx ctx,
break;
}
case pwr_cClass_ChanBiBlob: {
pwr_sClass_ChanBiBlob *chan_bi = (pwr_sClass_ChanBiBlob *) chanp->cop;
*input_area_offset += *input_area_chansize;
*input_area_chansize = chan_bi->Size;
if ( !chanp->sop || !chan_bi->Size)
continue;
chanp->offset = *input_area_offset;
chanp->size = *input_area_chansize;
chanp->mask = 0;
break;
}
case pwr_cClass_ChanBoBlob: {
pwr_sClass_ChanBoBlob *chan_bo = (pwr_sClass_ChanBoBlob *) chanp->cop;
*output_area_offset += *output_area_chansize;
*output_area_chansize = chan_bo->Size;
if ( !chanp->sop || !chan_bo->Size)
continue;
chanp->offset = *output_area_offset;
chanp->size = *output_area_chansize;
chanp->mask = 0;
break;
}
case pwr_cClass_ChanDo: {
pwr_sClass_ChanDo *chan_do = (pwr_sClass_ChanDo *) chanp->cop;
if (chan_do->Number == 0) {
......@@ -941,6 +969,13 @@ void io_bus_card_read( io_tCtx ctx,
}
break;
}
case pwr_cClass_ChanBiBlob: {
if ( chanp->cop && chanp->sop) {
memcpy( (char *)chanp->vbp, (char *)input_area + cp->offset + chanp->offset,
chanp->SigStrSize);
}
break;
}
}
}
}
......@@ -1404,6 +1439,13 @@ void io_bus_card_write( io_tCtx ctx,
}
break;
}
case pwr_cClass_ChanBoBlob: {
if ( chanp->cop && chanp->sop) {
memcpy( (char *)output_area + cp->offset + chanp->offset, (char *)chanp->vbp,
chanp->SigStrSize);
}
break;
}
}
}
......
!
! 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.
!
! pwrb_c_chanbiblob.wb_load -- Defines the class ChanBiBlob.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Group IO,Channels,NodeConfiguration
! @Summary Configures an buffer input channel
! Configures an buffer input channel.
!
! Channel type for data on distributed bus IO of type arrays and
! strings.
!
! ChanBiBlob objects are configured below a suitable module or card object.
! It should be connected to an attribute of arbitrary type with corresponding
! size.
!
! In the Size attribute, the total size of the channel on the bus in bytes
! should be set.
!*/
Object ChanBiBlob $ClassDef 591
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard
Attr Flags |= pwr_mClassDef_IO
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "ChanBiBlob"
EndBody
!/**
! Optional text.
!*/
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! Name of the attribute where the data is stored.
!*/
Object AttributeChanCon $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$AttrRef"
EndBody
EndObject
!/**
! Total size of bus data area for the channel in bytes.
!*/
Object Size $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
EndObject
Object Template ChanBiBlob
Body RtBody
Attr Size = 0
EndBody
EndObject
Object RtXtt $RtMenu
Object Signal $MenuRef
Body SysBody
Attr ButtonName = "TargetAttribute"
Attr RefAttribute = "SigChanCon"
EndBody
EndObject
EndObject
EndObject
EndSObject
!
! 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.
!
! pwrb_c_chanboblob.wb_load -- Defines the class ChanBoBlob.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Group IO,Channels,NodeConfiguration
! @Summary Configures an buffer input channel
! Configures an buffer input channel.
!
! Channel type for data on distributed bus IO of type arrays and
! strings.
!
! ChanBoBlob objects are configured below a suitable module or card object.
! It should be connected to an attribute of arbitrary type with corresponding
! size.
!
! In the Size attribute, the total size of the channel on the bus in bytes
! should be set.
!*/
Object ChanBoBlob $ClassDef 592
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard
Attr Flags |= pwr_mClassDef_IO
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "ChanBoBlob"
EndBody
!/**
! Optional text.
!*/
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! Name of the attribute from where the data is fetched.
!*/
Object AttributeChanCon $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$AttrRef"
EndBody
EndObject
!/**
! Total size of bus data area for the channel in bytes.
!*/
Object Size $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
EndObject
Object Template ChanBoBlob
Body RtBody
Attr Size = 0
EndBody
EndObject
Object RtXtt $RtMenu
Object Signal $MenuRef
Body SysBody
Attr ButtonName = "TargetAttribute"
Attr RefAttribute = "SigChanCon"
EndBody
EndObject
EndObject
EndObject
EndSObject
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