It is currently Tue Sep 02, 2014 8:47 am




Post new topic Reply to topic  [ 6 posts ] 
 Writing to database - SPC module 
Author Message
Cadet
Cadet

Joined: Thu Aug 09, 2012 7:03 am
Posts: 8
Post Writing to database - SPC module
In the SPC Module demo provided to use for trial, I am currently seeing if it will fit all the needs we require. I am looking at trying to record more information than the Demo does when recording spc measurements, however I am unable to find which component/Script is responsible to writing the measurements to the sampledata table in the database. Where or how is this done? Current window I am using is the Basic Test Station.


Thu Aug 09, 2012 7:09 am
Profile
Moderator
Moderator

Joined: Thu Nov 19, 2009 5:10 pm
Posts: 182
Post Re: Writing to database - SPC module
The basic Test Station screen setup in the demo uses the Sample Entry component which handles saving the measurement data. It also handles dynamically creating the measurement entry boxes and entry validation based on the sample(test) definition. Look at the Basic Add Sample screen for details on how this is done.

That being said, there are scripting functions that provide support to create and edit samples and the measurements data. This is useful for situations where the Sample Entry component doesn't meet the requirement such as calculations are being done before the measurement data is saved. Or in you case recording other information at the same time.

Refer the SPC Quality -> Scripting -> Scripting Functions -> system.quality.sample.data section of the MES User Manual. Also refer to the Sample object reference.

Here is an example:
Code:
#Create a new sample of the type Viscosity
sample = system.quality.sample.data.getNewByDefName("Viscosity", "OEEDemo\Your Enterprise\Site 1\Packaging\Line 1\Line 1 Quality")

#Add measurement data. Viscosity has a sample size of 3 with 2 attributes of Viscosity and Temperature
sample.setSampleData(1, "Viscosity", "10000")
sample.setSampleData(1, "Temperature", "80")
sample.setSampleData(2, "Viscosity", "10005")
sample.setSampleData(2, "Temperature", "81")
sample.setSampleData(3, "Viscosity", "9995")
sample.setSampleData(3, "Temperature", "79")

#Save the new sample
system.quality.sample.data.updateSample("OEEDemo\Your Enterprise\Site 1\Packaging\Line 1\Line 1 Quality", sample, 1)


In general, just about anything can be done in the SPC module through scripting. The components make it much easier but when they don't do exactly what you want, the script is there to fall back on. SPC scripts functions can be run on the client or the server.

Depending on the additional information you want to record, additional factors may work.
They are user defined data points that are logged along with the sample information. Once they are logged, they can be shown in charts, tables and reports.


Thu Aug 09, 2012 8:17 am
Profile
Cadet
Cadet

Joined: Thu Aug 09, 2012 7:03 am
Posts: 8
Post Re: Writing to database - SPC module
How do I change what table it writes to in the database?


Thu Aug 09, 2012 9:29 am
Profile
Moderator
Moderator

Joined: Thu Nov 19, 2009 5:10 pm
Posts: 182
Post Re: Writing to database - SPC module
You don't. The SPC module creates the tables and indexes automatically. The table structure involves multiple tables and indexes that are optimized for speed when pulling the data out with filters, combining with control limits, etc. and presenting in control charts or other analysis.

You can access the sample data directly from the QUAL_Sample and QUAL_SampleData tables.

What exactly are you trying to accomplish?


Thu Aug 09, 2012 9:39 am
Profile
Cadet
Cadet

Joined: Thu Aug 09, 2012 7:03 am
Posts: 8
Post Re: Writing to database - SPC module
Alright.

Trying to accomplish adding more inputs when doing SPCs like userID, ignore min/max features that block from continuing and various other things that have yet to be required by my employer. Having already had problems with some previous table relationships I was trying to make sure I didn't encounter more moving forward.

Thanks for your help.


Thu Aug 09, 2012 9:52 am
Profile
Moderator
Moderator

Joined: Thu Nov 19, 2009 5:10 pm
Posts: 182
Post Re: Writing to database - SPC module
Yes, table relationships can be a challenge. But they are needed for speed and database size reasons. The tradeoff is as your system grows its performance will degrade.

We already collect userID, product code, shift information and many other items of information along with the sample. From there you can specify any other user defined information that you also want store along with the sample.

You can also add columns to our database tables. The only restriction is that they must accept null values.

Our table structure for the SPC module is straight forward and I'm happy to show you the layout but it is beyond what can be done over the forum. Feel free to call in and ask for Tom.


Thu Aug 09, 2012 10:13 am
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 


Who is online

Users browsing this forum: rlparde@mmm.com and 5 guests


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: