Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
3a72aa92
Commit
3a72aa92
authored
Nov 27, 2013
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remote logg function remote_logg() added, and some doc added
parent
9265ec85
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
384 additions
and
84 deletions
+384
-84
remote/lib/remote/src/remote.h
remote/lib/remote/src/remote.h
+3
-0
remote/lib/remote/src/remote_logg.c
remote/lib/remote/src/remote_logg.c
+76
-0
remote/wbl/remote/src/remote_c_loggconfig.wb_load
remote/wbl/remote/src/remote_c_loggconfig.wb_load
+77
-4
remote/wbl/remote/src/remote_c_remnode3964r.wb_load
remote/wbl/remote/src/remote_c_remnode3964r.wb_load
+2
-2
remote/wbl/remote/src/remote_c_remnodealcm.wb_load
remote/wbl/remote/src/remote_c_remnodealcm.wb_load
+2
-2
remote/wbl/remote/src/remote_c_remnodemodbus.wb_load
remote/wbl/remote/src/remote_c_remnodemodbus.wb_load
+2
-2
remote/wbl/remote/src/remote_c_remnodemq.wb_load
remote/wbl/remote/src/remote_c_remnodemq.wb_load
+2
-2
remote/wbl/remote/src/remote_c_remnoderk512.wb_load
remote/wbl/remote/src/remote_c_remnoderk512.wb_load
+2
-2
remote/wbl/remote/src/remote_c_remnodeserial.wb_load
remote/wbl/remote/src/remote_c_remnodeserial.wb_load
+2
-2
remote/wbl/remote/src/remote_c_remnodetcp.wb_load
remote/wbl/remote/src/remote_c_remnodetcp.wb_load
+2
-2
remote/wbl/remote/src/remote_c_remnodeudp.wb_load
remote/wbl/remote/src/remote_c_remnodeudp.wb_load
+2
-2
remote/wbl/remote/src/remote_c_remnodewmq.wb_load
remote/wbl/remote/src/remote_c_remnodewmq.wb_load
+2
-2
remote/wbl/remote/src/remote_c_remtrans.wb_load
remote/wbl/remote/src/remote_c_remtrans.wb_load
+210
-62
No files found.
remote/lib/remote/src/remote.h
View file @
3a72aa92
...
...
@@ -234,3 +234,6 @@ typedef struct {
int
maxremao
;
/* Number of Ao in subsystem */
int
maxremco
;
/* Number of Pi in subsystem */
}
remnode_item
;
pwr_tStatus
remote_logg
(
int
identity
,
char
*
str
,
int
size
);
remote/lib/remote/src/remote_logg.c
0 → 100644
View file @
3a72aa92
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2013 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.
*/
#include "pwr.h"
#include "co_time.h"
#include "rt_qcom.h"
#include "pwr_remoteclasses.h"
#include "remote.h"
pwr_tStatus
remote_logg
(
int
identity
,
char
*
str
,
int
size
)
{
qcom_sPut
put
;
qcom_sQid
qid
;
char
*
logmsg
;
char
timstr
[
26
];
int
logsize
=
size
+
5
+
sizeof
(
timstr
);
pwr_tStatus
sts
;
time_AtoAscii
(
0
,
time_eFormat_DateAndTime
,
timstr
,
sizeof
(
timstr
));
logmsg
=
malloc
(
logsize
);
*
(
int
*
)
logmsg
=
identity
;
strcpy
(
&
logmsg
[
4
],
timstr
);
strcat
(
&
logmsg
[
4
],
" "
);
strncat
(
&
logmsg
[
4
],
str
,
size
+
1
);
put
.
data
=
logmsg
;
put
.
size
=
logsize
;
put
.
type
.
b
=
qcom_eBtype__
;
put
.
type
.
s
=
qcom_eStype__
;
put
.
reply
.
qix
=
0
;
put
.
reply
.
nid
=
0
;
qid
=
qcom_cNQid
;
qid
.
qix
=
rs_pwr_logg_qix
;
sts
=
qcom_Put
(
&
sts
,
&
qid
,
&
put
);
free
(
logmsg
);
return
sts
;
}
remote/wbl/remote/src/remote_c_loggconfig.wb_load
View file @
3a72aa92
...
...
@@ -33,9 +33,66 @@
! combined work), being distributed under the terms of the GNU
! General Public License plus this exception.
!
! remote_c_
LoggC
onfig.wb_load -- Defines the class LoggConfig.
! remote_c_
loggc
onfig.wb_load -- Defines the class LoggConfig.
!
SObject Remote:Class
!/**
! @Version 1.0
! @Group Servers,NodeConfiguration
! @Summary Configures logging of remote messages and other logging.
! Configures logging of remote messages and other logging.
!
! @b Remote logging
! Remote messages can be logged to file by setting LoggLevel in the
! RemTrans object to a value between 1 and 4.
!
! LoggLevel Description
!
! 0 No logging.
! 1 Logging of time, message lenght and status when an error
! has occured.
! 2 Logging of time, message lenght and status for every message.
! 3 Logging of time, length, status and the first 48 bytes
! in hexadecimal code.
! 4 Logging of time, length, status and the whole message
! in hex code.
!
! The Identity for a LoggConfig object handling the remote logging should
! be set to 90.
!
! @ Other logging
! Other loggings can be made by sending a QCom message to queue
! rs_pwr_logg_qix. The first 32-bit word in the message should be the
! Identity of the LoggConfig object, and the following data the string
! to be logged.
!
! @b Example Logging to LoggConfig with Identity 100
!
! qcom_sPut put;
! qcom_sQid qid;
! char *logmsg;
! int logsize = 80;
! int identity = 100;
! pwr_tStatus sts;
!
! logmsg = malloc(logsize);
! *(int *)logmsg = identity;
! strcpy( &logmsg[4], "Some message");
! put.data = logmsg;
! put.size = logsize;
! put.type.b = qcom_eBtype__;
! put.type.s = qcom_eStype__;
! put.reply.qix = 0;
! put.reply.nid = 0;
! qid = qcom_cNQid;
! qid.qix = rs_pwr_logg_qix;
! qcom_Put(&sts, &qid, &put);
!
! free(logmsg);
!
! @b See also
! @classlink RemTrans remote_remtrans.html
!*/
Object LoggConfig $ClassDef 27
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
...
...
@@ -48,14 +105,17 @@ SObject Remote:Class
Body SysBody
Attr StructName = "LoggConfig"
EndBody
!
!
Parameter Description
!
!
/**
!
Name of log file, eg $pwrp_log/remote.log
!
*/
Object LoggFile $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
!/**
! Obsolete.
!*/
Object NewVersion $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
...
...
@@ -63,11 +123,21 @@ SObject Remote:Class
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
!/**
! Identity is used to direct the logging to a specific
! LoggConfig object. The first word in the log message should
! correspond to this value.
!
! Identity 90 is used for remote logging.
!*/
Object Identity $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
!/**
! Number of loggings written to file since startup.
!*/
Object LoggCount $Attribute 4
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt32"
...
...
@@ -75,6 +145,9 @@ SObject Remote:Class
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
!/**
! Obsolete.
!*/
Object FileOpenCount $Attribute 5
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt32"
...
...
remote/wbl/remote/src/remote_c_remnode3964r.wb_load
View file @
3a72aa92
...
...
@@ -46,8 +46,8 @@ SObject Remote:Class
! @image orm_remnode3964r_og.gif
!
! @b See also
! @classlink RemoteConfig
pwrp
_remoteconfig.html
! @classlink RemTrans
ssab
_remtrans.html
! @classlink RemoteConfig
remote
_remoteconfig.html
! @classlink RemTrans
remote
_remtrans.html
!*/
Object Remnode3964R $ClassDef 1
Body SysBody
...
...
remote/wbl/remote/src/remote_c_remnodealcm.wb_load
View file @
3a72aa92
...
...
@@ -52,8 +52,8 @@ SObject Remote:Class
! @image orm_remnodealcm_og.gif
!
! @b See also
! @classlink RemoteConfig
pwrp
_remoteconfig.html
! @classlink RemTrans
ssab
_remtrans.html
! @classlink RemoteConfig
remote
_remoteconfig.html
! @classlink RemTrans
remote
_remtrans.html
!*/
Object RemnodeALCM $ClassDef 2
Body SysBody
...
...
remote/wbl/remote/src/remote_c_remnodemodbus.wb_load
View file @
3a72aa92
...
...
@@ -46,8 +46,8 @@ SObject Remote:Class
! @image orm_remnodemodbus_og.gif
!
! @b See also
! @classlink RemoteConfig
pwrp
_remoteconfig.html
! @classlink RemTrans
ssab
_remtrans.html
! @classlink RemoteConfig
remote
_remoteconfig.html
! @classlink RemTrans
remote
_remtrans.html
!*/
Object RemnodeModbus $ClassDef 3
Body SysBody
...
...
remote/wbl/remote/src/remote_c_remnodemq.wb_load
View file @
3a72aa92
...
...
@@ -46,8 +46,8 @@ SObject Remote:Class
! @image orm_remnodemq_og.gif
!
! @b See also
! @classlink RemoteConfig
pwrp
_remoteconfig.html
! @classlink RemTrans
ssab
_remtrans.html
! @classlink RemoteConfig
remote
_remoteconfig.html
! @classlink RemTrans
remote
_remtrans.html
!*/
Object RemnodeMQ $ClassDef 4
Body SysBody
...
...
remote/wbl/remote/src/remote_c_remnoderk512.wb_load
View file @
3a72aa92
...
...
@@ -46,8 +46,8 @@ SObject Remote:Class
! @image orm_remnoderk512_og.gif
!
! @b See also
! @classlink RemoteConfig
pwrp
_remoteconfig.html
! @classlink RemTrans
ssab
_remtrans.html
! @classlink RemoteConfig
remote
_remoteconfig.html
! @classlink RemTrans
remote
_remtrans.html
!*/
Object RemnodeRK512 $ClassDef 9
Body SysBody
...
...
remote/wbl/remote/src/remote_c_remnodeserial.wb_load
View file @
3a72aa92
...
...
@@ -46,8 +46,8 @@ SObject Remote:Class
! @image orm_remnodeserial_og.gif
!
! @b See also
! @classlink RemoteConfig
pwrp
_remoteconfig.html
! @classlink RemTrans
ssab
_remtrans.html
! @classlink RemoteConfig
remote
_remoteconfig.html
! @classlink RemTrans
remote
_remtrans.html
!*/
Object RemnodeSerial $ClassDef 6
Body SysBody
...
...
remote/wbl/remote/src/remote_c_remnodetcp.wb_load
View file @
3a72aa92
...
...
@@ -46,8 +46,8 @@ SObject Remote:Class
! @image orm_remnodetcp_og.gif
!
! @b See also
! @classlink RemoteConfig
pwrp
_remoteconfig.html
! @classlink RemTrans
ssab
_remtrans.html
! @classlink RemoteConfig
remote
_remoteconfig.html
! @classlink RemTrans
remote
_remtrans.html
!*/
Object RemnodeTCP $ClassDef 8
Body SysBody
...
...
remote/wbl/remote/src/remote_c_remnodeudp.wb_load
View file @
3a72aa92
...
...
@@ -46,8 +46,8 @@ SObject Remote:Class
! @image orm_remnodeudp_og.gif
!
! @b See also
! @classlink RemoteConfig
pwrp
_remoteconfig.html
! @classlink RemTrans
ssab
_remtrans.html
! @classlink RemoteConfig
remote
_remoteconfig.html
! @classlink RemTrans
remote
_remtrans.html
!*/
Object RemnodeUDP $ClassDef 5
Body SysBody
...
...
remote/wbl/remote/src/remote_c_remnodewmq.wb_load
View file @
3a72aa92
...
...
@@ -54,8 +54,8 @@ SObject Remote:Class
! @image orm_remnodewmq_og.gif
!
! @b See also
! @classlink RemoteConfig
pwrp
_remoteconfig.html
! @classlink RemTrans
ssab
_remtrans.html
! @classlink RemoteConfig
remote
_remoteconfig.html
! @classlink RemTrans
remote
_remtrans.html
!*/
Object RemnodeWMQ $ClassDef 33
Body SysBody
...
...
remote/wbl/remote/src/remote_c_remtrans.wb_load
View file @
3a72aa92
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment