i know nothing about Aoi instructions, but i have questions.
what is the purpose of initializing the aoi?
when you initialize any machine, it needs to be in the home state UNLESS the machine was in a cycle when the power was removed. then you must decide what can happen when the power is restored. for ex. if a part was clamped and external forces were touching the part, what will happen when you start the machine back up? does the part need to remain clamped? if you unclamp the part, will it go flying out of the fixture and hurt someone?
does the system need manual controls to return the unit to its home position safely? i'm not trying to slam you in any way, just bring up my concern when you say initialize.
james
I have never used AOI's but the equivalent in other platforms (FB's), what I have done is pass the first scan bit & the text (or variable containing the text to the FB (AOI) so that you copy the string to the tag inside of the FB (AOI), perhaps if it is going to be fixed text then you do not need to pass it just code it in the AOI and just pass the first pass bit
So add in parameters to the FB
First_Pass_Bit
INIT_String_Val
inside the FB (AOI)
IN_Var = First_Pass
IN_Var = INIT_String
@ James Mcquade
I am doing string manipulation in an AOI. Example, the AOI could produce something like this:
MM:SS where MM and SS are INT type being passed as input parameters and : is a local string in the AOI.
@ parky
I don't want to pass the string from outside into the AOI. I want to initlaize the string variable internally.; something like this:
If not there is the prescan routine of an AOI, which is called on power up and transition from program to run.
You can read about it from page 45 on in manual 1756-PM010
If the default value of a local tag isn't good enough for you then create a pre scan and if not initialized then concatenate, set the initialized tag immediately afterwards. So on first scan if not initialized it will set the default, any other time it will use the current value.
S:FS works if the AOI instance you’re initializing a variable in happens to be unconditionally called on the first scan of the program. This applies to nested AOI instances.
To reliably initialize variables in any AOI, under any circumstance, create a prescan routine.