I am using 8.1.0. I have watched the video for the subject matter and still dont quite understand. What I want to do is execute a stored procedure and have those columns that it returns write to a memory tag so I can them use those tags and compare them to another set of tags for a SpecAudit project that I am working on.
Does this sound like something that could be achived?
Definitely something that can be achieved but I am not sure a transaction group is the most appropriate method of doing it.
Transaction groups are similar to historian/historical data in a tag in that they target certain tags and save values on a predetermined time interval and execution condition (if tagX > 1, then save tags A,B,C values every 1 second for instance).
What I think you might want for, if you’re just trying to update a memory tag to the data returned via a stored procedure, is to setup a gateway timer script (if you want it to run every X seconds) or setup a tag change event (if you want some tag change to drive the execution) and in there you can do something like
Another option might be to run your stored procedure in a named query, then run the named query with system.db.runNamedQuery. It seems easier, at least to me.
I have been thinking about a named query also, mainly because I am more familiar with it. Right now the Stored Procedure, when ran in a Named Query, returns a table with 203 columns and 1 row. I assume i will need 203 memory tags for the data to be stored in?
Right now, our scheduling team lets the production team know what product to run and then they reference that to a listing of what product runs at what spec/rev and enters that as the machine setting in HMI. After that periodically production checks the running settings to the spec/rev. I am trying to automate that check.
Since we dont have a digital input for the spec/rev, that will have to entered manually into a text field that will change parameters in the named query so a comparison can happen, spec/rev against actual values from machine tags. From there I will setup some way for them to be notified, so the issues can be addressed.
I have always used output parameters in my procedures to return data to a TransactionGroup.
Example:
CREATE PROCEDURE ABC
@IN_VALUE1 INT
,@IN_VALUE2 INT
,@OUT_VALUE1 INT = NULL OUTPUT
,@OUT_VALUE2 INT = NULL OUTPUT
,@OUT_VALUE3 INT = NULL OUTPUT
AS
BEGIN
SELECT
@OUT_VALUE1 = <ANYVALUE1>
,@OUT_VALUE2 = <ANYVALUE1>
,@OUT_VALUE3 = <ANYVALUE1>
FROM
Table_XYZ
END
After that you can map those OUTPUT parameters directly in your TransactionGroup