OT: The most amazing UDT I've ever seen

ASF

Lifetime Supporting Member
Join Date
Jun 2012
Location
Australia
Posts
3,921
I came across a UDT this morning that truly is a sight to behold. A marvel of engineering and software development.

If anyone would like a copy of this UDT, let me know and I will upload it. It's far too good to be kept to myself, I must share it with the world!

Screen Shot 2021-05-19 at 10.20.12 am.png
 
Last edited:
tenor.gif
 
This is like looking at Tarantino's briefcase 💼 ⚡⚡

Truly a marvel. Take note people, this is what bumps you from 5 figures to 7 figures.
 
That's interesting... I wonder if the program was a conversion from a different PLC brand that has a TMR data type for timer and the guy created this for the software to look the same to maintenance looking to troubleshoot?

A bit like using typedef in C to abstract the word size in the processor the code is running on.

C code can run on desktop computers and 8 bit microcontrollers (library depending) and some data types will have 8-bits chars and others will have 32 bit chars (this isn't abstracted from the programmer like in a PLC).
So a common trick is to create a data type that explicitly tells you the size and use that instead of the language data types.
If you move the code to another processor with different word length, you change the definition to match the variable size in that platform and the code works (similar to copying IO into variables and when you need to change an IO point you make the change once).
 
He probably started with TMR, wasn't sure so Googled it.

Then moved onto Vibrator, wasnt sure so Googled it.

Right about then the boss walks in.

New project engineer starts the next day to replace the one who just got sacked for misuse of company internet. Isn't sure what previous guy had done, so just leaves it.
 
That's interesting... I wonder if the program was a conversion from a different PLC brand that has a TMR data type for timer and the guy created this for the software to look the same to maintenance looking to troubleshoot?
Truly a marvel. Take note people, this is what bumps you from 5 figures to 7 figures.

If I were to do this, I would have to make at least three *new* timer UDTs.
TMRA - AD DirectLogic accumulating timer
TMRF - AD DirectLogic fast timer
STMR - AD PAC Suite simple timer

Talk about an increase in my base pay! Bonus for the OffDelay variety.
I could retire early.🍻
 
Soooo... what kind of masterpiece is the next one?
Well, among other things, the Vibrator UDT has four instances of the TMR UDT.

Which means that instead of just addressing e.g. SomeVibrator.Vibrate_Timer.DN, you have to address SomeVibrator.Vibrate_Timer.TMR.DN

I mean maybe they just like repetition? I bet the person who wrote this code says "ATM Machine" ;)
 

Similar Topics

http://www.pas.com/tunewizard I've been using this a lot lately, used to cost $10k but now it is free (hoping you will pay for support or buy...
Replies
15
Views
11,000
It's probaly better than AdvancedHMI. OIBuilder is an HMI software by AutomationIG. The software can run on Window or Linux . It is truly an...
Replies
33
Views
11,842
After 2 years of being a Maintenance Supervisor for a CNC machine shop I finally gave it up and went to 3rd shift as a regular Maint Tech. The...
Replies
7
Views
3,388
Afternoon all, I'm working on setting up a large excel recipe table for porting updates through the Linx Gateway RTD/DDE function into my recipe...
Replies
2
Views
115
I am trying to copy an array of real numbers into a UDT with a real data type element. I have attached a snip below showing my COP instruction...
Replies
4
Views
204
Back
Top Bottom