Commit 3df84517 authored by Claes Sjofors's avatar Claes Sjofors

Remote RemNodeQCom added for remote messages on QCom

parent adcfaf48
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
ifndef link_rule_mk
link_rule_mk := 1
ifeq ($(PWRE_CONF_MQ),1)
link = $(ldxx) $(elinkflags) $(domap) -o $(export_exe) \
$(export_obj) $(objects) $(rt_msg_eobjs) \
$(pwre_conf_libdir) $(pwre_conf_libpwrremote) $(pwre_conf_libpwrrt) \
$(pwre_conf_libmq) $(pwre_conf_lib)
else
link = echo "Mq not installed"
endif
endif
This diff is collapsed.
...@@ -187,6 +187,30 @@ static void AddTransports() ...@@ -187,6 +187,30 @@ static void AddTransports()
sts = gdh_GetNextObject (objid, &objid); sts = gdh_GetNextObject (objid, &objid);
} }
/* Get and configure all QCom remnodes, one process for each remnode */
sts = gdh_GetClassList (pwr_cClass_RemnodeQCom, &objid);
while ( ODD(sts))
{
sts = gdh_ObjidToPointer(objid, &objref);
sprintf(tp[tpcount].path, "rs_remote_qcom");
tp[tpcount].id = ((pwr_sClass_RemnodeQCom *) objref)->MyQueue;
tp[tpcount].disable = &((pwr_sClass_RemnodeQCom *) objref)->Disable;
tp[tpcount].restart_limit = &((pwr_sClass_RemnodeQCom *) objref)->RestartLimit;
tp[tpcount].restarts = &((pwr_sClass_RemnodeQCom *) objref)->RestartCount;
((pwr_sClass_RemnodeQCom *) objref)->RestartCount = 0;
tp[tpcount].objid = objid;
tp[tpcount].objref = objref;
tp[tpcount].classid = pwr_cClass_RemnodeQCom;
tp[tpcount].cpid = -1;
tp[tpcount].first = true;
remcfgp->RemNodeObjects[tpcount] = objid;
tpcount++;
sts = gdh_GetNextObject (objid, &objid);
}
/* Get and configure all UDP remnodes, one process for each remnode */ /* Get and configure all UDP remnodes, one process for each remnode */
sts = gdh_GetClassList (pwr_cClass_RemnodeUDP, &objid); sts = gdh_GetClassList (pwr_cClass_RemnodeUDP, &objid);
......
!
! Proview Open Source Process Control.
! Copyright (C) 2005-2016 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.
!
! remote_c_remnodeudp.wb_load -- Defines the class RemnodeUDP.
!
SObject Remote:Class
!/**
! @Version 1.0
! @Group Servers,NodeConfiguration
! @Summary Configures communication through a message queue using QCom.
! Configures communication through a message queue using QCom.
!
! Only nodes that is know by QCom can be used by this remnode. Nodes kown
! by QCom is nodes in the same project, or nodes configured with FriendNodeConfig
! objects in the directory volume.
!
! To direct a message from a sending RemTrans to a recieving RemTrans set
! same value (0 - 255) in Address[0] in both sending and receiving RemTrans.
!
! @b Object graph
! @image orm_remnodeqcom_og.png
!
! @b See also
! @classlink RemoteConfig remote_remoteconfig.html
! @classlink RemTrans remote_remtrans.html
!*/
Object RemnodeQCom $ClassDef 34
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "RemnodeQCom"
EndBody
!/**
! Optional description.
!*/
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! Process priority for the transport process. For future use.
!*/
Object Prio $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$Int32"
EndBody
EndObject
!/**
! Number for queue used to receive messages on the current node.
! Can be set to 0 if no receive transactions exist.
!*/
Object MyQueue $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Int32"
EndBody
EndObject
!/**
! Target node for outgoing messages.
!*/
Object TargetNode $Attribute 4
Body SysBody
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
!/**
! QCom queue on target node. Sent messages are directed to this queue.
!*/
Object TargetQueue $Attribute 5
Body SysBody
Attr TypeRef = "pwrs:Type-$Int32"
EndBody
EndObject
!/**
! Scantime in seconds for outgoing RemTrans messages.
! Dynamic change is possible.
!*/
Object ScanTime $Attribute 6
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!/**
! When set, this attribute tells the remote handler not to start
! or restart the process that handles this remote node. If the transport process
! is running while the attribute is set it will terminate. This can be used to force
! a restart of the process.
!*/
Object Disable $Attribute 7
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! This attribute shows how many times the remote handler has restarted the
! transport process that handles this remnode.
! Dynamic change is possible and can be used in order to earn more restarts.
!*/
Object RestartCount $Attribute 8
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt32"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! The restart limit tells the remote handler how many times the transport process
! that handle this remnode can be restarted.
! Dynamic change is possible and can be used in order to earn more restarts.
!*/
Object RestartLimit $Attribute 9
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
!/**
! The restart time is set by the transport process at startup and therefore
! shows the latest (re)starttime.
!*/
Object RestartTime $Attribute 10
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Error counter.
!*/
Object ErrCount $Attribute 11
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt32"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Type of remnode. Used in the RemoteConfig classgraph.
!*/
Object Id $Attribute 12
Body SysBody
Attr TypeRef = "pwrs:Type-$String8"
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Contains the objid for the RemTrans objects for this remnode.
! The objid's are inserted by the remote process.
!*/
Object RemTransObjects $Attribute 13
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 25
EndBody
EndObject
EndObject
Object Template RemnodeQCom
Body RtBody
Attr Prio = 15
Attr MyQueue = 0
Attr TargetQueue = 0
Attr Disable = 0
Attr RestartCount = 0
Attr RestartLimit = 100
Attr ScanTime = 0.1
Attr Id = "QCom"
EndBody
EndObject
EndObject
EndSObject
...@@ -154,8 +154,11 @@ SObject Remote:Class ...@@ -154,8 +154,11 @@ SObject Remote:Class
! [1] - Address Low byte (0 - 255) ! [1] - Address Low byte (0 - 255)
! !
! TCP/ip and UDP/ip ! TCP/ip and UDP/ip
! [0] - Message address part 1 ( 0 - 65535) ! [0] - Message address part 1 (0 - 65535)
! [1] - Message address part 2 ( 0 - 65535) ! [1] - Message address part 2 (0 - 65535)
!
! QCom
! [0] - Message address (0 - 255)
! !
! MODBUS ! MODBUS
! [0] - Slave address ! [0] - Slave address
......
This diff is collapsed.
...@@ -1726,7 +1726,7 @@ int XNav::show_remnode() ...@@ -1726,7 +1726,7 @@ int XNav::show_remnode()
strcpy( th.title[th.table_cnt++], "Description"); strcpy( th.title[th.table_cnt++], "Description");
new ItemTableHeader( brow, this, "Title", &th, NULL, flow_eDest_IntoLast); new ItemTableHeader( brow, this, "Title", &th, NULL, flow_eDest_IntoLast);
for ( int i = 0; i < 8; i++) { for ( int i = 0; i < 9; i++) {
switch ( i) { switch ( i) {
case 0: cid = pwr_cClass_RemnodeUDP; break; case 0: cid = pwr_cClass_RemnodeUDP; break;
case 1: cid = pwr_cClass_RemnodeTCP; break; case 1: cid = pwr_cClass_RemnodeTCP; break;
...@@ -1736,6 +1736,7 @@ int XNav::show_remnode() ...@@ -1736,6 +1736,7 @@ int XNav::show_remnode()
case 5: cid = pwr_cClass_RemnodeModbus; break; case 5: cid = pwr_cClass_RemnodeModbus; break;
case 6: cid = pwr_cClass_RemnodeMQ; break; case 6: cid = pwr_cClass_RemnodeMQ; break;
case 7: cid = pwr_cClass_RemnodeWMQ; break; case 7: cid = pwr_cClass_RemnodeWMQ; break;
case 8: cid = pwr_cClass_RemnodeQCom; break;
} }
sts = gdh_GetClassList( cid, &objid); sts = gdh_GetClassList( cid, &objid);
...@@ -1788,6 +1789,11 @@ int XNav::show_remnode() ...@@ -1788,6 +1789,11 @@ int XNav::show_remnode()
strncpy( description, ((pwr_sClass_RemnodeWMQ *)object_ptr)->Description, strncpy( description, ((pwr_sClass_RemnodeWMQ *)object_ptr)->Description,
sizeof(description)); sizeof(description));
break; break;
case 8:
strncpy( id, ((pwr_sClass_RemnodeQCom *)object_ptr)->Id, sizeof(id));
strncpy( description, ((pwr_sClass_RemnodeQCom *)object_ptr)->Description,
sizeof(description));
break;
} }
t.elem_cnt = 0; t.elem_cnt = 0;
......
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