I'm trying to do my first ever structured text routine and failing miserably. Just to make things interesting, it's also my first foray into UDTs too.
I've created a UDT called Recipe with 71 member tags (if that's the correct term) to hold recipe values. I've created an array called Recipe_DB of data type Recipe of 250 elements to hold the actual recipe data.
I have to scan a barcode containing the part number. The part number is stored as a string data type I've created that has room for the 8 characters of the part number plus a CR - 9 SINTs in total.
My structured text routine should be a simple for loop, stepping through the 250 recipes checking for the bar code part number being equal to the recipe part number then copying the Recipe_DB that matches to the Working_recipe
I'm getting the following errors when I try to verify the routine:
Verifying routine: MainProgram - Recipe_retrieval...
Error: (Pend), Line 2: Missing reference to array element.
Error: (Pend), Line 3, 'Working_recipe': Assignment to tag of specified data type invalid.
Complete - 2 error(s), 0 warning(s)
I'm guessing the errors stem from the way I'm addressing the strings or arrays or both. Can some kind soul cast their eye over the attached program and offer some guidance, please?
I've created a UDT called Recipe with 71 member tags (if that's the correct term) to hold recipe values. I've created an array called Recipe_DB of data type Recipe of 250 elements to hold the actual recipe data.
I have to scan a barcode containing the part number. The part number is stored as a string data type I've created that has room for the 8 characters of the part number plus a CR - 9 SINTs in total.
My structured text routine should be a simple for loop, stepping through the 250 recipes checking for the bar code part number being equal to the recipe part number then copying the Recipe_DB that matches to the Working_recipe
I'm getting the following errors when I try to verify the routine:
Verifying routine: MainProgram - Recipe_retrieval...
Error: (Pend), Line 2: Missing reference to array element.
Error: (Pend), Line 3, 'Working_recipe': Assignment to tag of specified data type invalid.
Complete - 2 error(s), 0 warning(s)
I'm guessing the errors stem from the way I'm addressing the strings or arrays or both. Can some kind soul cast their eye over the attached program and offer some guidance, please?
Last edited: