# Adding data to SPC

**URL:** <https://forum.inductiveautomation.com/t/adding-data-to-spc/8400>\
**Category:** 3rd Party Modules\
**Created:** [May 1, 2014, 1:13pm UTC](https://forum.inductiveautomation.com/t/adding-data-to-spc/8400 "2014-05-01T13:13:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbackus](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tbackus/32/5091_2.png) [@tbackus](https://forum.inductiveautomation.com/u/tbackus)\
**Post date:** [May 1, 2014, 1:13pm UTC](https://forum.inductiveautomation.com/t/adding-data-to-spc/8400/1 "2014-05-01T13:13:31Z")

</div>

Hope this is in the correct forum…

Whats the simple way to add data from a couple of OPC tags   
“QC\_Robot/BERRY\_TEST\_DATA/cmmID”  
“QC\_Robot/BERRY\_TEST\_DATA/cmmODRIM”  
“QC\_Robot/BERRY\_TEST\_DATA/cmmRimHeight”  
  
Into their counterpart SPC Attributes:  
Definition: SVC4020  
Attributes: rimID, rimOD, rimHeight  
Location Path: City\_SPC\Company\Location\QC\_Robots\Robot1\Robot1 Sample

I’ve been banging my head against the wall for a couple of days now, just havn’t been able to complete the links…

P.S.  
I do have a bit in the OPC that when “True” will allow me to trigger this action.

---

<div class="post-metadata">

**Author:** ![Pete.Low](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@Pete.Low](https://forum.inductiveautomation.com/u/Pete.Low)\
**Post date:** [May 7, 2014, 2:44pm UTC](https://forum.inductiveautomation.com/t/adding-data-to-spc/8400/2 "2014-05-07T14:44:56Z")

</div>

Hi,  
This is the correct forum.

What you will need to do is write a script on the tag change of the trigger that creates a new sample from the definition. Once you have the sample you can cycle through the attributes, check the attribute name and assign it the value that is read from the tag.

Check out the training videoes on:  
[inductiveautomation.com/spctrainingvids](http://www.inductiveautomation.com/spctrainingvids)  
and look for the category “SPC SCreens”, “Manual Sample Entry”.

Regards,
