Questions about 90-30 in process of upgrading

Hello,

I have the task of updating an old PLC in a plant. I have a copy of the old program, but it is absent of any names and comments. Given that the cabinet is nearly 35 years old, documentation is also scarce.

It is a somewhat simple LD program with 150 rungs. I do know what the hard-wire I/O are (thanks for wire labels!), so I have filled in those names for %I and %Q variables respectively, then using those knowns to back-fill unknown memory variables.

The existing machine is a 90-30, model 331.

In trying to decipher the old program, a few things I cannot quite wrap my head around.

  • The biggest head-scratcher for me (likely because I lack old school experience) is the use of BIT_SEQ. I've read the description several times, but the concept (or perhaps the implementation here) doesn't click for me.
    • I understand the enable, reset, and direction, but the N and ST parameters escape me a bit, or at least the ones used here. N is a constant, and a large number at 393. The description says that N is "the value that the step number is set to when R is energized" and that N must be between 1 and Length, while Length's legal values are 1-256. Given this, 393 is input very specifically, but it would just default to 256 (max Length) or the Length value of 5 here, unless I'm missing something.
      • I believe the 393 is specifically linked to the start of a cluster of 5 (Length's parameter) BOOLs in %M, from 393-397, which are then linked to %Q outputs.
      • Following this, it seems that they used the BIT_SEQ to turn on the Qs via a crank-style bit manipulation vs traditional LD rung logic.
    • Second, the ST argument. When compiling the program, PAC ME gives warnings on all BIT_SEQ (4 of them) in the program, citing a type mismatch on the ST arguments, as they are all provided as BOOL, but expecting BYTE, WORD, or DWORD.
      • I'm assuming that BYTE, WORD, or DWORDs are just suggestions, and really all that matters is the numerical address provided, in this case marked by SV1_V variable, which is address %M00393 - matching the N argument.

Are my assumptions correct here? It looks like they gave the BIT_SEQ the starting address of 393, which is also the address of the ST argument. The BIT_SEQ cranks through the bits to turn on 5 BOOLs. I can understand the effective/technical result here, but I'm not sure why you would choose this method to activate coils rather than traditional rung logic? Perhaps to minimize number of rungs/instructions for sake of memory limitations?

Another question:
Several times throughout the program, a variable will be OR'd with NOT-itself. Like (if VAR1 == TRUE OR VAR1 != TRUE) THEN ....
Again, given that this, at first glance, seems obtuse, I have to assume this might be some facet/restriction of programming in times long ago that I'm not familiar with. My best guess is adding this chunk in as a sort of marker for human visualization purposes, in lieu of a comment.

Another peculiar thing I've found is the use of %Qs in addresses far above where the hard-wired inputs stop.
For example, this application's I/O cards stop at %Q00036, but there exists %Q00203, 204, and 210 in the program. I assume these are used in place of %M, but why? I do not believe %M memory was exhausted... I understand these may simply be idiosyncrasies of a rouge programmer, but curious of there might be some reason (from before I was born!) giving legitimate cause for this.

One more question: this program has pervasive use of ONDTR TENTHS instruction. I understand the purpose of a delay-on-make function, of course, but the kicker is that ONDTR (as I read it) has a cumulative timer, so that it does not reset to the specified parameter when power flow is broken - it holds its value.
I can understand the utility of this in certain applications, but I'm surprised at the exclusive use of this instruction for all timer functions in the program. A few times, the input trigger is inverted, causing it to auto-reset upon power break, or the output will be wrapped around to the Reset.
Given its exclusive use and occasional go-arounds, I can only assume that a plain delay-on-make might not have existed in this era?

Lastly, can I connect to this PLC live via PAC ME? There is some doubt with my colleagues that PAC ME cannot be connected to a 90-30 of fear that it will 'update' something in the PLC, causing it to no longer work with the old software (MS-DOS style stuff). Is there any validity this? To clarify, we (technicians) have PAC ME, the customer only has old software (LogicMaster? I believe?) so do not want to leave site causing unknown problems for customer.

Thanks for the help and tolerance of my many questions.

  • Hi Matthew!

    Emerson can only provide limited guidance for programming and in practice there are as many options for controlling a machine as there are developers! Here is some advice.

    There is always some risk when working live on a PLC, especially as this Series 90-30 CPU331 is so old. I recommend modernising to PACSystems RX3i which is supported and offers better fault finding and monitoring options. PACSystems RX3i also stores documentation in the PLC so you won't lose this in future.

    Note that very old PLC programs were constrained by memory and speed. So developers used a variety of "tricks" to minimise the amount of logic and enhance performance, usually at the expense of readability. Some old PLC programs were translated from even earlier applications using Instruction List and this can introduce program structures that make little sense in ladder logic. Also today PLC programming is somewhat standardised under IEC 61131-3 and by organisations like PLCOpen but this was not the case in the past.

    The BIT_SEQ instruction is commonly used for providing a sequence, converting a sequence number into a bit that can be used by standard ladder instructions. So yes this reduces the amount of programming required, compared to say using a counter and EQ type instructions, although EQ might be more readable by humans. BIT_SEQ performs a bit sequence shift through a series of contiguous bits (bits) starting at ST and sets the bit pointed to by the sequence number. The bit set moves by direction DIR and amount N whenever the OK input comes on (false to true transition). BIT_SEQ needs instance data like a timer or counter so this is what the R00013 value is. R is reset. See the CPU Programmer’s Reference Manual, GFK-2950, or PAC Machine Edition Help, for more details.

    PAC Machine Edition is strongly typed, but you can override type mismatch issues in the options tab of the project's properties. The developer has to keep track of what the data means and how it is used in the application.

    I don't see why you would OR a value with itself, this is effectively always passing power to the next set of instructions. Possibilities are that the developer wanted to be able to see the status of the bit at all times, or they modified the logic at a later stage but didn't want to completely remove the possibility of changing back at a later date, or some other reason lost in the mists of time.

    %Q is intended for physical outputs but many developers use spare %Q as %M.

    ONDTR accumulates time. The stopwatch timer did exist at the launch of the Series 90-30 but maybe the developer wasn't aware of this or they were used to doing it another way.

    PAC Machine Edition can be used for live monitoring of the data tables and the ladder logic. For ladder logic, the programmer and PLC must be LOGIC EQUAL. You can always force LOGIC EQUAL by uploading from the PLC, but you may lose any documentation when doing this. Some very old CPUs are not compatible with PAC Machine Edition, for CPU331 you must have at least firmware version 8.21 or later. Older CPU331 cannot be updated as they are no longer supported (the firmware is in EPROM and needs a physical chip).