It is currently Wed Apr 23, 2014 7:24 pm




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 14 posts ] 
 Comments Panel 
Author Message
General
General

Joined: Thu Jan 26, 2012 5:18 pm
Posts: 212
Post Comments Panel
I am looking for any tips or tutorials on how to configure the "comments panel" components.
I set up a few tables in the database that correspond with "what I thought" where used by this component. I am missing something. Was hoping someone out here has used this and had some notes they could share.


Last edited by tailfire on Wed Feb 22, 2012 8:27 pm, edited 1 time in total.

Wed Feb 22, 2012 6:48 am
Profile WWW
General
General

Joined: Thu Jan 26, 2012 5:18 pm
Posts: 212
Post Re: Comments Panel
WOW I found the documentation
http://www.inductiveautomation.com/supp ... syntax.htm

I should read this first... :prayer:


Wed Feb 22, 2012 6:52 am
Profile WWW
Moderator
Moderator

Joined: Sun Apr 02, 2006 2:46 pm
Posts: 1982
Location: Sacramento, CA
Post Re: Comments Panel
Good, let us know if you run into any problems.

_________________
Travis Cox
Inductive Automation
Technical Support Rep.


Wed Feb 22, 2012 1:57 pm
Profile WWW
General
General

Joined: Tue Oct 26, 2010 5:58 pm
Posts: 152
Post Re: Comments Panel
its a long road trying to find the perfect turbo encabulator!


Wed Feb 22, 2012 5:33 pm
Profile
General
General

Joined: Mon Sep 29, 2008 11:38 am
Posts: 302
Post Re: Comments Panel
Call me old fashioned, but I like the feel of the retro encabulator better.
Of course, neither of them beat a good interocitor.. sigh.


Wed Feb 22, 2012 6:52 pm
Profile
Moderator
Moderator

Joined: Thu Mar 30, 2006 10:08 pm
Posts: 1188
Post Re: Comments Panel
Comments panel in the manual linked below:

http://www.inductiveautomation.com/supp ... spanel.htm

_________________
Nathan Boeger, CISSP-ISSAP, CCNP Voice, VCP
Not Another Industrial Blog - My SCADA software blog
"Design Simplicity Cures Engineered Complexity"


Thu Feb 23, 2012 10:17 am
Profile WWW
General
General

Joined: Tue May 31, 2011 6:27 am
Posts: 313
Location: Minnesota
Post Re: Comments Panel
Just to add on to this, here is an example intended to be indexed on a tag path.

MySQL
Code:
CREATE TABLE IF NOT EXISTS `notes` (
  `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `UserName` varchar(45) NOT NULL,
  `TimeStamp` datetime NOT NULL,
  `NoteText` text NOT NULL,
  `TagName` varchar(45) NOT NULL,
  `IsSticky` tinyint(3) unsigned NOT NULL,
  `Attachment` longblob DEFAULT NULL,
  `AttachmentName` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=22 ;


MS SQL (assumes the database is called sqltags)
Code:
USE [sqltags]
GO

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[notes]') AND type in (N'U'))
DROP TABLE [dbo].[notes]
GO

USE [sqltags]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[notes](
   [ID] [int] IDENTITY(1,1) NOT NULL,
   [UserName] [nvarchar](50) NOT NULL,
   [TimeStamp] [datetime] NOT NULL,
   [NoteText] [ntext] NOT NULL,
   [TagName] [nvarchar](255) NOT NULL,
   [IsSticky] [int] NOT NULL,
   [Attachment] [varbinary](max) NULL,
   [AttachmentName] [nvarchar](50) NULL,
CONSTRAINT [PK_notes] PRIMARY KEY CLUSTERED
(
   [ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


Attachments:
Alarm Notes.vwin [10.25 KiB]
Downloaded 90 times


Last edited by Greg.Buehler on Fri Feb 24, 2012 8:21 am, edited 1 time in total.
Thu Feb 23, 2012 11:01 am
Profile
General
General

Joined: Mon Apr 04, 2011 4:40 pm
Posts: 464
Location: Hatfield, PA
Post Re: Comments Panel
Nice example. This is very helpful. :thumb_left:

_________________
There are 10 types of people in this world, those who understand binary and those who don't.

Doug Keller
Electronics Project Manager
Clemens Food Group


Fri Feb 24, 2012 5:09 am
Profile WWW
General
General

Joined: Wed Feb 24, 2010 5:56 pm
Posts: 575
Post Re: Comments Panel
I ended up building my own. We needed to have dropdowns with preconfigured comments, that way we can track calibrations and search for other stuff without having to worry about typos. I also set it up so that the user can use the current timestamp or use a calender component to enter in a manual timestamp if they dont get around to entering the comment in for a few days.


Fri Feb 24, 2012 5:27 am
Profile
General
General

Joined: Mon Apr 04, 2011 4:40 pm
Posts: 464
Location: Hatfield, PA
Post Re: Comments Panel
One problem I found with this example... if you add a note with an attachment it works fine. If you add a note without an attachment it won't accept a null in the Attachment column and throws up an error.

Quote:
Implicit conversion from data type varchar to varbinary(max) is not allowed. Use the CONVERT function to run this query.


Maybe this is just a sql2005 thing? Not sure how to get around this as the Attachment column is set to accept nulls.

_________________
There are 10 types of people in this world, those who understand binary and those who don't.

Doug Keller
Electronics Project Manager
Clemens Food Group


Fri Feb 24, 2012 5:54 am
Profile WWW
General
General

Joined: Tue May 31, 2011 6:27 am
Posts: 313
Location: Minnesota
Post Re: Comments Panel
Duffanator wrote:
One problem I found with this example... if you add a note with an attachment it works fine. If you add a note without an attachment it won't accept a null in the Attachment column and throws up an error.

Quote:
Implicit conversion from data type varchar to varbinary(max) is not allowed. Use the CONVERT function to run this query.


Maybe this is just a sql2005 thing? Not sure how to get around this as the Attachment column is set to accept nulls.


Probably just need to change the table schema to fit your needs. This was tested using MySQL. The MS SQL table hasn't actually been used/tested yet.


Fri Feb 24, 2012 8:17 am
Profile
Trooper
Trooper

Joined: Wed Apr 25, 2012 1:14 am
Posts: 17
Post Re: Comments Panel
I having this problem as well (SQL2008 db) and still working around without a solution.

Another question, how can we getting DataSet of Comments panel while adding a new Note?


Wed Apr 25, 2012 2:24 am
Profile
Moderator
Moderator

Joined: Sun Apr 02, 2006 2:46 pm
Posts: 1982
Location: Sacramento, CA
Post Re: Comments Panel
To get the attachments to work with MS SQL Server you can set the INSERT QUERY 1 to the following:
Code:
INSERT INTO Notes (Note, Username, TStamp, Attachment, Filename, Sticky) VALUES (?, '%s', CURRENT_TIMESTAMP, CAST(? AS VARBINARY(MAX)), ?, ?)
Note the CAST(? AS VARBINARY(MAX)).

_________________
Travis Cox
Inductive Automation
Technical Support Rep.


Wed Apr 25, 2012 7:12 am
Profile WWW
Trooper
Trooper

Joined: Wed Apr 25, 2012 1:14 am
Posts: 17
Post Re: Comments Panel  Topic is solved
Thank you Travis, the solution fixed my problem. :)

Travis.Cox wrote:
To get the attachments to work with MS SQL Server you can set the INSERT QUERY 1 to the following:
Code:
INSERT INTO Notes (Note, Username, TStamp, Attachment, Filename, Sticky) VALUES (?, '%s', CURRENT_TIMESTAMP, CAST(? AS VARBINARY(MAX)), ?, ?)
Note the CAST(? AS VARBINARY(MAX)).


Wed Apr 25, 2012 6:40 pm
Profile
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 14 posts ] 


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: