Post your cool programming tips here

ganutenator

Lifetime Supporting Member
Join Date
May 2002
Location
kansas
Posts
1,440
Example: I forgot how to do that cool copy and XOR thingy to oneshot a bunch of hmi bits at the same time.

Or how you can multiply a word by two to shift all the bits to the left.

Or some cool modulus hmi stuff.

Or.....

This one programmer dude would put oneshots on a rung w/ nothing to the left of them for hmi something or other. Maybe ok if he commented EVER.

Make a false to true instruction in AB operate every scan by resetting the EN bit (EU bit for LIFO is a gotcha here btw).
 
Last edited:
Never use multiple latch / unlatch bits.
Write down the sequence down in order and program it that way so others can follow along as they see the machine run.
Never program for job security. It will ruin your creditability.
Keep things simple for others to understand. use 5 rungs of logic if necessary.
Maintenance is the ones who repairs / debugs the machine, work with them and learn what their capabilities are. Work with them and show them what's going on.

james
 
Anyone else ever do this.
Put the subroutine number in front of the bit or int address for local only registers in a subroutine?
 
Never use multiple latch / unlatch bits.
Write down the sequence down in order and program it that way so others can follow along as they see the machine run.
Never program for job security. It will ruin your creditability.
Keep things simple for others to understand. use 5 rungs of logic if necessary.
Maintenance is the ones who repairs / debugs the machine, work with them and learn what their capabilities are. Work with them and show them what's going on.

james

Just my 2 cents:
I don't think bad/complicated code is written w/ the intent of job security, as it is my opinion that writing simple takes more time and forethought.
 
Never use multiple latch / unlatch bits.
Write down the sequence down in order and program it that way so others can follow along as they see the machine run.
Never program for job security. It will ruin your creditability.
Keep things simple for others to understand. use 5 rungs of logic if necessary.
Maintenance is the ones who repairs / debugs the machine, work with them and learn what their capabilities are. Work with them and show them what's going on.

james

One of the worst side effects of some languages is that you are actually latching the bit.

The good news, is most of the time, this is not retentive after restart.

In the same token, one of the greatest benefits is that you can solve w/o solving the instruction false as well.
 
Last edited:
ganutenator,

I Know for a FACT there is are companies that program for job security!
I had to change several parameters stored in registers in a modicon plc that was written by another company. When the first parameter was changed and we ran the program, we got a totally new machine operation and it crashed the sensors. I don't know what they did to this day, but they did it.

We had to show the plant manager what we did and he called the OEM that programmed the machine for the change. They wanted $9K for the first machine and $5k to change the other 6.

We got the po to build 3 new machines and ended up building 15 more.
that company was no longer allowed to build machines for that corporation and lost several million dollars in business because of it.

I wrote the program for the new machines and allowed the parameters to be changed with no changes in the operation of the machine.

james
 
The XOR thingy is also nice for detecting when a new alarm comes ON in an array of alarm bits. Then use the new alarm for sounding an alarm horn.
 

Similar Topics

I know it is fairly simple to post a screenshot, but many of us have large screens, so perhaps y'all could take the time to trim those screenshots...
Replies
4
Views
515
Good day all. Stupid question incoming (see my handle), but I can't seem to get this last step sorted. Basic story: Ops ruined the PC we were...
Replies
4
Views
742
We are experiencing VM OS corruption after Studio 5000 installation. This has occurred for several VMs. Strangely enough, not every VM is...
Replies
3
Views
1,410
Hi I’m struggling to understand how the LHTTP_post / get work ? I have a url address given to me by the IT , I have to send a works order...
Replies
2
Views
1,234
Hi, Just curious to how the job market is for controls engineers in the UK at the moment? I'm not seeing many jobs advertised, and wondering if...
Replies
9
Views
2,348
Back
Top Bottom