Add On's and Strings

Mike6158

Member
Join Date
Nov 2003
Location
Texas
Posts
44
I've been trying to create an Add On from a routine that I use often. The old way makes use of a UDT with the following structure:

String1 STRING Tag
String2 STRING Description
ATM REAL Float Atmospheric Pressure- PSIA
Pb REAL Float Pressure Base
Tb REAL Float Temperature Base
HW REAL Float Differential Pressure

Etc

I use the String tags in my HMI. I built a faceplate and I use Parameter files to populate the faceplate when I call it. The Faceplate header has the tag on the top line and Description on the bottom line.

Like so-

FI-700
Hot Oil Flow to Heater

I like having the tag and description in the array when I'm troubleshooting and by typing it in the PLC I don't have to type it again if I need to use it in the HMI.

I can create String variables in the Add In but they don't show up in the tag array which makes them useless. I would like to be able to convert a few of my routines to Add Ins but not at the expense of not being able to use a String.

Any thoughts?
 
This is Control Logix ?

If so then just pass the UDT into the AOI as a INOUT parameter

Yes. CLX.

So define my tag as a UDT as always and then reference the String variable in that tag in the Add In? I don't understand how I could do that and have an Add In that was useful for more than one time. Seems like I would end up with my UDT and an Add On Defined structure that is identical... I don't know. Maybe I'm missing something.

I'm running into the same thing with timers. I create them in the Add On but they are only references to timers, not actual timers. I hate to say it but this is one place the S7 eats the CLX platform for lunch. I can create whatever I want (within reason of course) in an S7 function block. Add On's seem to be much more restrictive in their use than FB's.

I should probably just stick with what works.

Thanks
 
i hate to say it but this is one place the s7 eats the clx platform for lunch
+1



The InOUT parameters in the AOI function call are passed by reference.
eg
MyAOIFuntion definition
input parameters
Raw
Healthy​
Inout parameter
MyTag a UDT eg as you have already described​
If you monitor one AOI instance eg FI102_AOI
then you can only see FI102_AOI.Raw and FI102_AOI.Healthy


The beauty of the AOI compared to subroutines is that you can call an AOI from any program in any task

LOCAL Tags in a AOI Exist but are totally hidden from the program and any HMI
So the local timer exists but you cannot monitor it in a program tag list.
 
I have a few routines that would be easier to use as an Add On. The simplest version, if I could get to work, would evaluate the digital output that us used to open a valve and it's open and closed limit switches and place an integer value in a parameter for use in an HMI. I've created the simple little ladder routine that I always use in AOI. Basically there are 6 rungs.

Rung 1- If the output is off and the closed limit switch is not made then start a timer.

Rung 2- If the output is on and the open limit switch is not made then start a timer.

The following is the fail to travel logic. I need to be able to reference the Timer.DN bits in another routine to latch up a failed to travel shutdown. I need to be able to adjust the .PRE value in a tag since valves travel at different speeds. That can't be done in an AOI as near as I can tell

(VW is an integer.)

Rung 3- If the DO is false and the closed limit switch is true and I don't have fail to open or fail to close shutdowns then MOV 0 into VW which is an integer.

Rung 4- If the DO is true and the open limit switch is true and I don't have fail to open or fail to close shutdowns then MOV 1 into VW.

Rung 5- If neither limit switch is true and I don't have fail to open or fail to close shutdowns then MOV 2 into VW.

Rung 6- If either fail to close or fail to open is true then MOV 3 into VW.

Graphically speaking I use a multistate indicator and/or color triggers such that:

0 represents Closed
1 represents Open
2 represents Traveling
3 represents Failed

The beauty of doing this comes during graphic configuration and when there are numerous valves to deal with. I already have the valve in a library. I place it on the screen, select it, hit Ctrl-R and replace the part of the tag in front of the dot with the new tag number. I have a UDT called SDV that I normally use and it has the two STRING tags in it that I mentioned earlier. It also has the fail to travel timers, one shots for buttons, open and close commands, and limit switches. My original intent was to use this UDT in the AOI but that's proving to be nearly impossible because of the strings and timers.

The project that I am working on now has 20 valves so an Add In could be a good solution if I can figure out how to use timers and strings without creating a God aweful mess of my tag database.

Had I just built the ladder and done a search and replace I would have been finished by now :eek:/ Were I using an S7 I would have already imported the routine and built everything. In fairness to AB their PID Enhanced block is pretty good. Better than Siemens PID loops by far.

The more complex routines are 99% math and they work fine with the exception of being able to use Strings.
 
I believe you can create an input parameter data type dint & then inside the AOI MOV the dint to the .pre of the timer. Even give it a default value IIRC.
 
What you are wanting to do is possible in an AOI. For your timer presets, create input parameters that are then passed to the presets of the timers inside the AOI. Instead of trying to access the timer done bits, pass the done bits to output parameters of the AOI. Same thing for the integer.

It's been a while since I've passed strings from an AOI, but it can be done. I believe the string parameter type has to be In/Out.
 
HMI communication

Mike 6158

Are you aware that when you place a UDT on scan with a HMI that usually the whole UDT is sent via the communications. So your wonderful little routine in a large system starts to slow down HMI communications . (I also use the same type of simplicity in my systems)

Depending on the system I sometimes have 2 UDT's One that is for the HMI communications the other for internal stuff. Other times I remap the HMI data into a more communication efficient format (DINT array's) where the values are blocked together at the same update rates. eg Alarms one block, 1 second trends together, 15 second trends together, etc

This is where other systems can beat AB in simplicity of setup but may not always beat the performance of a well designed system. (lets see if other jump in on this because there is heaps of stuff to think about 🤾)

What is the HMI? Citect?
 
What you are wanting to do is possible in an AOI. For your timer presets, create input parameters that are then passed to the presets of the timers inside the AOI. Instead of trying to access the timer done bits, pass the done bits to output parameters of the AOI. Same thing for the integer.

It's been a while since I've passed strings from an AOI, but it can be done. I believe the string parameter type has to be In/Out.

The problem (for me) with this approach is that I'm trying to simplify my life (and databases) with AOI's. I'm probably beating my head against a wall by trying to "force" the Add-On to do what I need. When I drop an Add-on into a rung and assign it a tag I need the tag to contain everything I need to make full use of the functionality. I can make the add-on work without the string tags but I lose functionality. That's not a good compromise for me. Adding external links to tags seems clunky. Unless I'm missing something my tag database becomes larger not smaller.

I had a thought that I'll try in a bit. If I create a UDT that has the same structure as the Add-On Defined data tyoe but includes the timers and string tags can I reference a tag created with the UDT in the Add-On?

Mike 6158

Are you aware that when you place a UDT on scan with a HMI that usually the whole UDT is sent via the communications. So your wonderful little routine in a large system starts to slow down HMI communications . (I also use the same type of simplicity in my systems)

Depending on the system I sometimes have 2 UDT's One that is for the HMI communications the other for internal stuff. Other times I remap the HMI data into a more communication efficient format (DINT array's) where the values are blocked together at the same update rates. eg Alarms one block, 1 second trends together, 15 second trends together, etc

This is where other systems can beat AB in simplicity of setup but may not always beat the performance of a well designed system. (lets see if other jump in on this because there is heaps of stuff to think about 🤾)

What is the HMI? Citect?

PanelView Plus (gold edition... It must be the gold edition based on what they cost) but we are about to switch to a Nematron Panel PC and use RSView SE to configure it. Eventually we may move to ClearSCADA installed on the panel PC and combine two different apps into one.

I've never had timing issues with the PV+ but in my world we don't do anything that's rocket science. I typically don't have more than 20 screens. 4 or 5 trends, a PLC status page, a few screens that require parameter files to populate them (like an alarm and shutdown screen, overview, etc.
 

Similar Topics

I have 2 strings which I need to concatenate to create an identifier for my client but they want a space between them. Both strings are just...
Replies
14
Views
2,711
Im trying to create a level indicator for water Tank i have used the ADD function while the pump is on and level increasing everything works...
Replies
21
Views
192
We are trying to poll data coming from a PLC for remote monitoring we have the IP address of the PLC and the default port number and the path is...
Replies
25
Views
424
Hello The plant is running and there is no shutdown nowadays therefore I can add 1734- AENTR and its card while PLC is in Run? I do not wanna...
Replies
1
Views
115
Back
Top Bottom