add on instruction inputs

Brijm

Lifetime Supporting Member
Join Date
May 2006
Location
St. Marys, PA
Posts
645
I have an add on instruction, which I am using inputs as parameters used in the instruction. I have the inputs set up as required and visiable with read/write access.

I'm not changing these values from within the Add on Instruction, but I do want to be able to change these parameters from an HMI.

I set up the AOI and it added the variables for my input parameters according to the AOI user defined type. However if I try to change these tags either from within the HMI or the program, then they revert back to the previously downloaded values. The only way to change the values, is to edit the rung, and then accept the changes.

Do I need to uncheck the required field in the add on instruction? I do want the tags to be generated as part of the AOI variable, and to be able to modify them outside of the add on instruction.
 
Can you export your AOI, zip it and post it here. it's not clear what you are describing.

As a guess it sounds like you assign a literal value (like 4) to an input at programming time. But you want to change this at run time. Instead create a tag of the appropriate type and assign it as the input. Assign whatever you want to the tag value as you program. Then change the tag (which is external to the AOI) using the HMI at runtime as needed.

When I do an AOI which will use a number of external values I create a UDT with all those types in it. In the AOI definition I create an In/Out variable of that UDT type. External to the AOI I create a tag of that UDT type. Then there is only one assignment for the AOI. All the elements of the external tag can be changed at runtime.
 
Last edited:
Can you export your AOI, zip it and post it here. it's not clear what you are describing.

As a guess it sounds like you assign a literal value (like 4) to an input at programming time. But you want to change this at run time. Instead create a tag of the appropriate type and assign it as the input. Assign whatever you want to the tag value as you program. Then change the tag (which is external to the AOI) using the HMI at runtime as needed.

When I do an AOI which will use a number of external values I create a UDT with all those types in it. In the AOI definition I create an In/Out variable of that UDT type. External to the AOI I create a tag of that UDT type. Then there is only one assignment for the AOI. All the elements of the external tag can be changed at runtime.

I think from searching, what I need to do is uncheck the required box in the AOI. The AOI is creating a UDT, and that is what I am trying to address. This is for a calibration routine, and while I have initial values entered according to the specs, I want to be able to change them via the HMI. I know I have done this before with an AOI but I'm unsure why it won't let me write to these sub-elements of the AOI UDT at runtime.
 
If you check "required", you actually have to assign a tag to it. So, for example, let's say your AOI tag is "Motor1" and the input in question is "SpeedSetpoint".

If SpeedSetpoint is "required", you have to assign a tag to it. Let's say you create a tag "Motor1_Speed_SP", and assign it to the AOI.

Now, if you use a HMI to change "Motor1.SpeedSetpoint", it will change the value in the AOI, but the next time it calls the AOI it will look up Motor1_Speed_SP and reassign that value to it. Instead, you would have to use the HMI to change "Motor1_Speed_SP".

However, as you say - if you don't need that tag to be "required", then you can remove that requirement and it will work as normal. Typically, the only tags in my AOI's that are "required" are things like emergency stop inputs - because I'm always going to have an external tag for the e/stop tripped, and then I can just type that tag into every AOI in the code and let the AOI's deal with the e/stop internally.
 

Similar Topics

hey good afternoon ! I have a simple question, I need to import an Add on instruction to a controller that is in operation and cannot stop. Is it...
Replies
6
Views
244
please can someone help me how do i add status bits to the add on instruction in studio 5000 thank you
Replies
2
Views
1,447
Hello all, Is there a way to trend tags associated with AOI? Currently the selection is grayed out. The tag is a local tag and it resides in a...
Replies
8
Views
2,085
I have to create a sample mov template in add on instruction.I just want to know the list of tags which is used to create a mov logic instruction...
Replies
6
Views
2,054
I know this sounds really stupid, but I have a function block program I have written and have been debugging. I have an ADD block that will not...
Replies
10
Views
2,284
Back
Top Bottom