defcon.klaxon
Lifetime Supporting Member
Hi guys,
I'm experimenting with creating UDTs but am coming across some challenges, and thought I'd ask for some help after some unsuccessful Google searches.
So I've created a UDT for all the different hardware instances in my project; Pump, Ultrasonic Level, Flow Meter, etc. Since each instance has very similar tags, creating one UDT can essentially create all the tags I need, so great. I've also created UDTs for common functions, like ETM and NOS for pumps, and Alarms and include those inside the hardware UDTs. It creates everything I need very nicely, but I'm having issues with getting data into those tags now that they're created. I'll focus on the Alarming UDT for the sake of discussion.
So every alarm in my system has a boolean condition, a time delay to prevent false triggering (DINT), a timer that counts up to that time delay (TON), and then an alarm output (BOOL). In my UDT I've created exactly that, so when I expand the alarm tagname I see:
I'm experimenting with creating UDTs but am coming across some challenges, and thought I'd ask for some help after some unsuccessful Google searches.
So I've created a UDT for all the different hardware instances in my project; Pump, Ultrasonic Level, Flow Meter, etc. Since each instance has very similar tags, creating one UDT can essentially create all the tags I need, so great. I've also created UDTs for common functions, like ETM and NOS for pumps, and Alarms and include those inside the hardware UDTs. It creates everything I need very nicely, but I'm having issues with getting data into those tags now that they're created. I'll focus on the Alarming UDT for the sake of discussion.
So every alarm in my system has a boolean condition, a time delay to prevent false triggering (DINT), a timer that counts up to that time delay (TON), and then an alarm output (BOOL). In my UDT I've created exactly that, so when I expand the alarm tagname I see:
-Alarm.Condition [BOOL]
-Alarm.TimeDelay [DINT]
-Alarm.Timer [TON]
|---Alarm.Timer.PRE
|---Alarm.Timer.ACC
|---Alarm.Timer.EN
|---Alarm.Timer.TT
|---Alarm.Timer.DN
-Alarm.Output [BOOL]
The problem is, I need the Alarm.TimeDelay value to be the Alarm.Timer.PRE value. This was easily done when I manually created every tag and simply aliased the tags. But now I can't do any aliasing with any UDT tags and I'm at a total loss for how to deal with this. Do I have to create a slew of MOV instructions to manually do this? Is there any easier way? It seems very odd that they'd provide this fantastic time saving resource, but then require you to manually move data around instead of being able to alias. Seems very odd to me, but I could be missing something and I'm by no means an AB expert so maybe there's a good reason, I dunno. Hoping there's a better way than manually moving everything. Thanks for any help guys.-Alarm.TimeDelay [DINT]
-Alarm.Timer [TON]
|---Alarm.Timer.PRE
|---Alarm.Timer.ACC
|---Alarm.Timer.EN
|---Alarm.Timer.TT
|---Alarm.Timer.DN
-Alarm.Output [BOOL]