View Single Post
Old 08-17-2012, 04:16 PM   PM User | #21
SaltineWarrior
New to the CF scene

 
Join Date: Aug 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
SaltineWarrior is an unknown quantity at this point
I think there are more efficient ways to get what you want.... I am involved with Infinity deployments so I am fairly well versed in what you are looking at. I dont think I would attempt to use DMS to create these values. Seems like a great deal of overhead to accomplish something relatively simple.

1.) Depending how you are getting your data to start with you can use your OPC server to calculate the % for you before getting to DMS. We use Kepware as the OPC server and I have the option of creating "advanced tags" which could calculate this number. Then DMS will see this as an available tag and can be used as a provider (alternately you could probably have the math done on the PLC)

2.) You could most likely setup a DEC in SPCEE for each line that contains the two tests with the time and the third test for the %DT. Use last database value for the two time tests and a calculated value for the %DT. Set the DEC to be called every 8 hours (or whatever) and I believe it should open the DEC, grab the values it needs, calculate and close without any user intervention (provided you have pre-selected all the descriptors). This would essentially get you the result you are after with the downside being that project would have to be running on a PC all the time.

3.) If #1 isnt an option you could also use SQL Server to do the work for you. Write a stored procedure to grab the last time values for a given shift, calculate the %DT then insert this data into the infinity tables as a new subgroup/Test. Setup an agent job to run this at the end of every shift for each line and voila you have automated %DT charts. The only thing you need to get right is the F_CRTM, F_EDTM, F_SGTM fields so the times display right in SPCEE. The values for pretty much everything in infinity are the UNIX time the value was created. So the F_SGRP value on an insert is this: DATEDIFF(s, '1/1/1970', GETDATE()) (**If you are using the most updated version they switched the database to UTC time so you will need to adjust the results from the GETDATE depending on what time zone you are in) assuming you are only inserting one row at a time. If you were doing this with a group of rows to enter I would increment the above by the row number in the recordset to ensure each one has a unique F_SGRP. Use the same DATEDIFF(s, '1/1/1970', GETDATE()) for the F_CRTM, F_EDTM, F_SGTM fields, then look up the values you want for the various descriptors.

Anyway hope this helps (or that you have already figured out what you were working on )
SaltineWarrior is offline   Reply With Quote