As a simple workaround, I would recommend the following solution:
-
Enable “Bulk Transfer” to send recipe data to a local HMI address within the “Transfer” tab of the recipe database:
-
Then, configure a macro to read from the address specified wihtin the bulk transfer. Here is an example:
macro_command main()
short transfer = 5 // Recipe transfer command
unsigned short sPos[6] = {0, 0, 0, 0, 0, 0} // The data type used in the recipe database is 16-bit Unsigned
short result = 0
SetData(transfer, "Local HMI", RECIPE, "positions.Command") // Transfer recipe data to an LW memory
GetData(result, "Local HMI", RECIPE, "positions.Result") // Check if the command is finished
while result == 0 // Wait for command execution to finish
DELAY(20)
GetData(result, "Local HMI", RECIPE, "positions.Result")
wend
if result == 1 then // Execution success
GetData(sPos[0], "Local HMI", LW, 0, 6) // Retrieve postion data as an array
result = 0
SetData(result, "Local HMI", RECIPE, "positions.Result") // Reset result
else
// Command failed
end if
end macro_command