My recipes are made up up several steps, for example
StepType1 to StepType10
Power1 to Power10
Time1 to Time10
Temp1 to Temp10
etc.
I’m using a Recipe View on a screen to select a recipe. Let’s see if this screen shot attaches.
I cannot attach files for some reason, but here’s some of the code
short LastStep = 0
short ProcStepReq
short ProcStep
float Power
int Time
float Temp
short Aux
int Limit
float Holdback
short ProcStep2
float Power2
int Time2
float Temp2
short Aux2
int Limit2
float Holdback2
short G_StepType
short G_HoldbackType
bool G_EndType
macro_command main()
//Pulls data from recipe selection segment to edit/view area
char PartName[20]
char s_steptype[20] = "PROCESS.StepType"
char s_power[20] = "PROCESS.Power"
char s_time[20] = "PROCESS.Time"
char s_temp[20] = "PROCESS.Temp"
char s_aux[20] = "PROCESS.Aux"
char s_limit[20] ="PROCESS.Limit"
char s_index[2]
bool DataEnable = 0
short S_Subpage_Req = 0
GetData(PartName[0], "Local HMI", RECIPE, "PROCESS.PartName")
GetData(ProcStepReq, "Local HMI", "Recipe_Edit_Index", 1)
GetData(LastStep, "Local HMI", "Recipe_Edit_Index_Last", 1)
//Pull Data as a CASE list as Recipe does not support arrays
if (ProcStepReq > 0) and (ProcStepReq < 11) then
DataEnable = 1
S_Subpage_Req = 1
DEC2ASCII(ProcStepReq, s_index[0], 2)
StringCat(s_index[0], s_steptype[0])
StringCat(s_index[0], s_power[0])
StringCat(s_index[0], s_time[0])
StringCat(s_index[0], s_temp[0])
StringCat(s_index[0], s_aux[0])
StringCat(s_index[0], s_limit[0])
end if
SetData(DataEnable, "Local HMI", "R_LOCK_SELECT", 1)
SetData(S_Subpage_Req, "Local HMI", "R_PageSelect", 1)
if (DataEnable > 0) then
GetData(PartName[0], "Local HMI", RECIPE, "PROCESS.PartName")
GetData(ProcStep, "Local HMI", RECIPE, s_steptype[0])
GetData(Power, "Local HMI", RECIPE, s_power[0])
GetData(Time, "Local HMI", RECIPE, s_time[0])
GetData(Temp, "Local HMI", RECIPE, s_temp[0])
GetData(Aux, "Local HMI", RECIPE, s_aux[0])
GetData(Limit, "Local HMI", RECIPE, s_limit[0])
//Push Data
end if
end macro_command
We only access 1 step at a time to create a simpler screen.
I’m trying to build a string so I don’t need a giant CASE array to access all variations and to make modifications easier. However, I get a syntax error (C1) and a device address error (C45) when I attempt to use a string as the target of GetData or SetData.