SHARE
TWEET

Inducto B

a guest Jul 19th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Option Explicit
  2.  
  3. Type InductoBTags
  4.  
  5.     K_indb_MINTEMP As Tag
  6.     K_indb_TEMP As Tag
  7.     K_rcp_bil_SIZE As Tag
  8.     RcpGrade As Tag
  9.     RcpID As Tag
  10.     STD_CylConstant_RCP_RI_1 As Tag
  11.     STD_CylConstant_RCP_RI_2 As Tag
  12.     STD_CylConstant_RCP_RI_3 As Tag
  13.     STD_CylConstant_RCP_RI_4 As Tag
  14.     STD_CylConstant_RCP_RI_5 As Tag
  15.     STD_CylConstant_RCP_RI_6 As Tag
  16.     STD_CylConstant_RCP_RI_7 As Tag
  17.     STD_CylConstant_RCP_RI_8 As Tag
  18.     STD_CylConstant_RCP_RI_9 As Tag
  19.     STD_CylConstant_RCP_RI_10 As Tag
  20.     STD_CylConstantActual_RCP_RO_1 As Tag
  21.     STD_CylConstantActual_RCP_RO_2 As Tag
  22.     STD_CylConstantActual_RCP_RO_3 As Tag
  23.     STD_CylConstantActual_RCP_RO_4 As Tag
  24.     STD_CylConstantActual_RCP_RO_5 As Tag
  25.     STD_CylConstantActual_RCP_RO_6 As Tag
  26.     STD_CylConstantActual_RCP_RO_7 As Tag
  27.     STD_CylConstantActual_RCP_RO_8 As Tag
  28.     STD_CylConstantActual_RCP_RO_9 As Tag
  29.     STD_CylConstantActual_RCP_RO_10 As Tag
  30.     STD_SpareInt_RCP_RI_1 As Tag
  31.     STD_SpareInt_RCP_RI_2 As Tag
  32.    
  33. End Type
  34.  
  35. Public Type InductoBGroup
  36.  
  37.     DB As InductoBTags
  38.     PLC As InductoBTags
  39.     EDIT As InductoBTags
  40.    
  41. End Type
  42.  
  43. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  44. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  45. ' * * * * * * * * * * * * *  CREATING PATHS TO TAGS FOLDER  * * * * * * * * * * * * * * *
  46. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  47. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  48. Public Function AddInductoBGroup()
  49.  
  50.     Dim strFolder As String
  51.  
  52.     'HMI Tags
  53.     strFolder = "RCP\Inducto_B\"
  54.     AddInductoBTag (strFolder)
  55.    
  56.     'PLC Tags
  57.     strFolder = "PLC\Inducto_B\"
  58.     AddInductoBTag (strFolder)
  59.    
  60.     ' Edit Tags
  61.     ' strFolder = " RCP\Inducto_B"
  62.     ' AllTags.DB = AddInductoBTag(strFolder)
  63.    
  64.    
  65. End Function
  66.  
  67. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  68. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  69. ' * * * * * * * * * * * *   ADDING  HMI  TAGS TO THE GROUP  * * * * * * * * * * * * * * *
  70. ' * * * * * * * * * * Function that adds all the tags to the tag group  * * * * * * * * *
  71. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  72. Function AddInductoBTag(strFolder As String)
  73.  
  74. With ThisDisplay.MyTagGroup
  75.  
  76.     .Add ("{" & strFolder & "RcpID}")
  77.     .Add ("{" & strFolder & "K_indb_MINTEMP}")
  78.     .Add ("{" & strFolder & "K_indb_MINTEMP}")
  79.     .Add ("{" & strFolder & "K_rcp_bil_SIZE}")
  80.     .Add ("{" & strFolder & "RcpGrade}")
  81.     .Add ("{" & strFolder & "STD_CylConstant_RCP_RI_1}")
  82.     .Add ("{" & strFolder & "STD_CylConstant_RCP_RI_2}")
  83.     .Add ("{" & strFolder & "STD_CylConstant_RCP_RI_3}")
  84.     .Add ("{" & strFolder & "STD_CylConstant_RCP_RI_4}")
  85.     .Add ("{" & strFolder & "STD_CylConstant_RCP_RI_5}")
  86.     .Add ("{" & strFolder & "STD_CylConstant_RCP_RI_6}")
  87.     .Add ("{" & strFolder & "STD_CylConstant_RCP_RI_7}")
  88.     .Add ("{" & strFolder & "STD_CylConstant_RCP_RI_8}")
  89.     .Add ("{" & strFolder & "STD_CylConstant_RCP_RI_9}")
  90.     .Add ("{" & strFolder & "STD_CylConstant_RCP_RI_10}")
  91.     .Add ("{" & strFolder & "STD_CylConstantActual_RCP_RO_1}")
  92.     .Add ("{" & strFolder & "STD_CylConstantActual_RCP_RO_2}")
  93.     .Add ("{" & strFolder & "STD_CylConstantActual_RCP_RO_3}")
  94.     .Add ("{" & strFolder & "STD_CylConstantActual_RCP_RO_4}")
  95.     .Add ("{" & strFolder & "STD_CylConstantActual_RCP_RO_5}")
  96.     .Add ("{" & strFolder & "STD_CylConstantActual_RCP_RO_6}")
  97.     .Add ("{" & strFolder & "STD_CylConstantActual_RCP_RO_7}")
  98.     .Add ("{" & strFolder & "STD_CylConstantActual_RCP_RO_8}")
  99.     .Add ("{" & strFolder & "STD_CylConstantActual_RCP_RO_9}")
  100.     .Add ("{" & strFolder & "STD_CylConstantActual_RCP_RO_10}")
  101.     .Add ("{" & strFolder & "STD_SpareInt_RCP_RI_1}")
  102.     .Add ("{" & strFolder & "STD_SpareInt_RCP_RI_2}")
  103.    
  104. End With
  105.  
  106. End Function
  107. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  108. ' * * * * * * * * * * * * * *     COPYING DB/EDIT/PLC TAGS    * * * * * * * * * * * *
  109. 'This function will copy the contents of any  sourch tag (DB/EDIT/PLC) to the required
  110. ' * * * * * * * * * * * * * * * destination tag (DB/EDIT/PLC) * * * * * * * * * * * *
  111. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  112. Function TransferInductoB(strTagDest As String, strTagSrc As String)
  113.     Dim AllTags As InductoBGroup
  114.     Dim TagSrc As InductoBTags
  115.     Dim TagDest As InductoBTags
  116.     AllTags = TGroup.LoadInductoBGroup
  117.    
  118.     '  Getting Source Tag
  119.     Select Case strTagSrc
  120.         Case Is = "Tag"
  121.             TagSrc = AllTags.DB
  122.         Case Is = "edit"
  123.             TagSrc = AllTags.EDIT
  124.         Case Is = "PLC"
  125.             TagSrc = AllTags.PLC
  126.          
  127.     End Select
  128.      
  129.     '   Getting Destination Tag
  130.     Select Case strTagDest
  131.         Case Is = "Tag"
  132.             TagDest = AllTags.DB
  133.         Case Is = "edit"
  134.             TagDest = AllTags.EDIT
  135.         Case Is = "PLC"
  136.             TagDest = AllTags.PLC
  137.     End Select
  138.    
  139.    
  140.     'Copying from source tag to desination tag for each individual tag
  141.     TagDest.K_indb_MINTEMP.Value = TagSrc.K_indb_MINTEMP.Value
  142.     TagDest.K_indb_TEMP.Value = TagSrc.K_indb_TEMP.Value
  143.     TagDest.K_rcp_bil_SIZE.Value = TagSrc.K_rcp_bil_SIZE.Value
  144.     TagDest.RcpGrade.Value = TagSrc.RcpGrade.Value
  145.     TagDest.RcpID.Value = TagSrc.RcpID.Value
  146.     TagDest.STD_CylConstant_RCP_RI_1.Value = TagSrc.STD_CylConstant_RCP_RI_1.Value
  147.     TagDest.STD_CylConstant_RCP_RI_2.Value = TagSrc.STD_CylConstant_RCP_RI_2.Value
  148.     TagDest.STD_CylConstant_RCP_RI_3.Value = TagSrc.STD_CylConstant_RCP_RI_3.Value
  149.     TagDest.STD_CylConstant_RCP_RI_4.Value = TagSrc.STD_CylConstant_RCP_RI_4.Value
  150.     TagDest.STD_CylConstant_RCP_RI_5.Value = TagSrc.STD_CylConstant_RCP_RI_5.Value
  151.     TagDest.STD_CylConstant_RCP_RI_6.Value = TagSrc.STD_CylConstant_RCP_RI_6.Value
  152.     TagDest.STD_CylConstant_RCP_RI_7.Value = TagSrc.STD_CylConstant_RCP_RI_7.Value
  153.     TagDest.STD_CylConstant_RCP_RI_8.Value = TagSrc.STD_CylConstant_RCP_RI_8.Value
  154.     TagDest.STD_CylConstant_RCP_RI_9.Value = TagSrc.STD_CylConstant_RCP_RI_9.Value
  155.     TagDest.STD_CylConstant_RCP_RI_10.Value = TagSrc.STD_CylConstant_RCP_RI_10.Value
  156.     TagDest.STD_CylConstantActual_RCP_RO_1.Value = TagSrc.STD_CylConstantActual_RCP_RO_1.Value
  157.     TagDest.STD_CylConstantActual_RCP_RO_2.Value = TagSrc.STD_CylConstantActual_RCP_RO_2.Value
  158.     TagDest.STD_CylConstantActual_RCP_RO_3.Value = TagSrc.STD_CylConstantActual_RCP_RO_3.Value
  159.     TagDest.STD_CylConstantActual_RCP_RO_4.Value = TagSrc.STD_CylConstantActual_RCP_RO_4.Value
  160.     TagDest.STD_CylConstantActual_RCP_RO_5.Value = TagSrc.STD_CylConstantActual_RCP_RO_5.Value
  161.     TagDest.STD_CylConstantActual_RCP_RO_6.Value = TagSrc.STD_CylConstantActual_RCP_RO_6.Value
  162.     TagDest.STD_CylConstantActual_RCP_RO_7.Value = TagSrc.STD_CylConstantActual_RCP_RO_7.Value
  163.     TagDest.STD_CylConstantActual_RCP_RO_8.Value = TagSrc.STD_CylConstantActual_RCP_RO_8.Value
  164.     TagDest.STD_CylConstantActual_RCP_RO_9.Value = TagSrc.STD_CylConstantActual_RCP_RO_9.Value
  165.     TagDest.STD_CylConstantActual_RCP_RO_10.Value = TagSrc.STD_CylConstantActual_RCP_RO_10.Value
  166.     TagDest.STD_SpareInt_RCP_RI_1.Value = TagSrc.STD_SpareInt_RCP_RI_1.Value
  167.     TagDest.STD_SpareInt_RCP_RI_2.Value = TagSrc.STD_SpareInt_RCP_RI_2.Value
  168.  
  169.  
  170. End Function
  171.  
  172.  
  173. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  174. ' * * * * * * * * * * * * * *       INSERTING ON SAVE       * * * * * * * * * * * * *
  175. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  176. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  177. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  178. Function InductoBInsert(RcpID As String, cnSrc As ADODB.Connection)
  179. Dim strSql As String
  180. Dim cmd As New ADODB.Command
  181. Dim rsSrc As New ADODB.Recordset
  182. Dim AllTags As InductoBGroup
  183. Dim TagSrc As InductoBTags
  184.  
  185.    
  186.     AllTags = TGroup.LoadInductoBGroup
  187.     TagSrc = AllTags.DB
  188.     strSql = " INSERT INTO Inducto_B  VALUES('"
  189.     strSql = strSql & RcpID & "','" & TagSrc.RcpID.Value & "','" & TagSrc.K_indb_TEMP.Value & "','" & TagSrc.K_rcp_bil_SIZE.Value & "','" & TagSrc.RcpGrade.Value & "','" & TagSrc.STD_CylConstant_RCP_RI_1.Value & "','" & TagSrc.STD_CylConstant_RCP_RI_10.Value & "','" & TagSrc.STD_CylConstant_RCP_RI_2 & "','" & TagSrc.STD_CylConstant_RCP_RI_3.Value & "','" & TagSrc.STD_CylConstant_RCP_RI_4.Value & "','" & TagSrc.STD_CylConstant_RCP_RI_5.Value & "','" & TagSrc.STD_CylConstant_RCP_RI_6.Value & "','" & TagSrc.STD_CylConstant_RCP_RI_7.Value & "','" & TagSrc.STD_CylConstant_RCP_RI_8.Value & "','" & TagSrc.STD_CylConstant_RCP_RI_9.Value & "','" & TagSrc.STD_CylConstantActual_RCP_RO_1.Value & "','" & TagSrc.STD_CylConstantActual_RCP_RO_10.Value & "','" & TagSrc.STD_CylConstantActual_RCP_RO_2.Value & "','"
  190.     strSql = strSql & TagSrc.STD_CylConstantActual_RCP_RO_3.Value & "','" & TagSrc.STD_CylConstantActual_RCP_RO_4.Value & "','" & TagSrc.STD_CylConstantActual_RCP_RO_5.Value & "','" & TagSrc.STD_CylConstantActual_RCP_RO_6.Value & "','" & TagSrc.STD_CylConstantActual_RCP_RO_7.Value & "','" & TagSrc.STD_CylConstantActual_RCP_RO_8.Value & "','" & TagSrc.STD_CylConstantActual_RCP_RO_9.Value & "','" & TagSrc.STD_SpareInt_RCP_RI_1.Value & "','" & TagSrc.STD_SpareInt_RCP_RI_2.Value & "')"
  191.     cmd.ActiveConnection = cnSrc
  192.     rsSrc.Open strSql, cnSrc
  193.  
  194.     '(RcpID.  K_indb_TEMP , K_rcp_bil_SIZE, RcpGrade, STD_CylConstant_RCP_RI_1, STD_CylConstant_RCP_RI_10, STD_CylConstant_RCP_RI_2, STD_CylConstant_RCP_RI_3, STD_CylConstant_RCP_RI_4, STD_CylConstant_RCP_RI_5, STD_CylConstant_RCP_RI_6, STD_CylConstant_RCP_RI_7, STD_CylConstant_RCP_RI_8, STD_CylConstant_RCP_RI_9, STD_CylConstantActual_RCP_RO_1, STD_CylConstantActual_RCP_RO_10, STD_CylConstantActual_RCP_RO_2, STD_CylConstantActual_RCP_RO_3, STD_CylConstantActual_RCP_RO_4,STD_CylConstantActual_RCP_RO_5 , STD_CylConstantActual_RCP_RO_6, STD_CylConstantActual_RCP_RO_7, STD_CylConstantActual_RCP_RO_8, STD_CylConstantActual_RCP_RO_9, STD_SpareInt_RCP_RI_1, STD_SpareInt_RCP_RI_2)
  195.  
  196. End Function
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top