alexbeatle
Member
Good day!
Trying to save changes in the recipe through VBS code.
There is one Recipe with several Recipe/Data Records.
Recipe Records is selected through drop-down menu (tag=PPreselectedDie)
The trick is that, there're 32 Recipe Elements and I'm displaying 12 at a time. There're scroll keys that move the list up and down by one.
So when I'm saving, I need to make sure that they all are saved to the right positions. This is done by the nested for-loops.
RecPPosAxis_Nom - the recipe tag, type=array
PPosAxis_Nom - I/O tag that displays the data on the screen, type=array
Code is executed onClick "Save" button.
However, something doesn't do it.
Could you please have a look.
Thank you,
Alex
Trying to save changes in the recipe through VBS code.
There is one Recipe with several Recipe/Data Records.
Recipe Records is selected through drop-down menu (tag=PPreselectedDie)
The trick is that, there're 32 Recipe Elements and I'm displaying 12 at a time. There're scroll keys that move the list up and down by one.
So when I'm saving, I need to make sure that they all are saved to the right positions. This is done by the nested for-loops.
RecPPosAxis_Nom - the recipe tag, type=array
PPosAxis_Nom - I/O tag that displays the data on the screen, type=array
Code is executed onClick "Save" button.
Code:
Const numcol=32,numrow=12,limit=21
Dim RecipeRecord,x,y,status,count
RecipeRecord=HmiRuntime.SmartTags("PPreselectedDie")
For x = 0 To limit-1
For y = 0 To numrow-1
HmiRuntime.SmartTags("RecPPosAxis_Nom")(x+y)=HmiRuntime.SmartTags("PPosAxis_Nom")(y)
Next
If HmiRuntime.SmartTags("PPosAxis_Nom")(0)<=limit Then
HmiRuntime.SmartTags("PPosAxis_Nom")(0)=HmiRuntime.SmartTags("PPosAxis_Nom")(0)+(numrow-1)
End If
Next
SaveDataRecord 1,RecipeRecord,hmiOverwriteAlways,hmiOff,status
However, something doesn't do it.
Could you please have a look.
Thank you,
Alex