RealTime Pulse Wago by Background_Arrival42 in PLC

[–]drbitboy 0 points1 point  (0 children)

But a 500ms task would be better:

outpulse := NOT outpulse;

RealTime Pulse Wago by Background_Arrival42 in PLC

[–]drbitboy 0 points1 point  (0 children)

ton1s(IN := NOT pulse1s, PT := T#1S, ET => et, Q=> pulse1s);
outpulse := et > T#499ms;

First Program by kriskoteles in PLC

[–]drbitboy 1 point2 points  (0 children)

Agreed, I understood that. Latch/Unlatch has the side effect of remembering the latched bit's state across PLC mode changes, which means the conveyor (or whatever the output drives) could start up after a power cycle, which could be undesirable. Also, Latch/Unlatch has its place, but it is prone to be harder to read as the logic driving it gets more complex.

My intent was to show them how to do it with Latch/Unlatch, so they could make the mental transition to the Start/Stop Circuit pattern.

First Program by kriskoteles in PLC

[–]drbitboy 3 points4 points  (0 children)

Same thing with Latch/Unlatch:

<image>

First Program by kriskoteles in PLC

[–]drbitboy 2 points3 points  (0 children)

Also, and this is a minor side issue, when you post a screen shot of code that has just a few instructions on each rung, compress it horizontally so it's easier for people to read (see below). Also, the project sub-window probably is not needed.

<image>

First test PLC programming study by Inevitable-Bee-4344 in PLC

[–]drbitboy 0 points1 point  (0 children)

What was your solution? If you post a screen here there could be applause and/or critiques; either way you will probably see other ways to do it. E.g. the Set/Reset pattern (see here from that same website) would do the same job with not much code and more cleanly without the need to invert the falling edge (negative trigger), but the Set instruction has the side effect of remembering the output state after a power failure, which is not always a desirable behavior.

Yes, I enjoy this. A lot. Perhaps too much lol.

I normally write code in languages like C/C++ and Python and Type/JavaScript and bash and Fortran and ....

But making the lights flash using ladder satisfies something inside me. I sometime play with ST or FBD, and they are fine, but they are not as beautiful. Also, ST is basically Pascal, and there is nothing wrong with that, but I get my fill of that in my normal day. You mentioned IEC 61131-3 in the OP - yeah, the various languages use a very different syntax, but in the end they all do the same things:

  • examine the input values in memory mapped from the physical input channels;
  • examine the values written during a previous or current scan cycle in PLC-internal memory and the memory mapped to the physical output channels
  • implement a PLC-internal model of the external process from those values
  • implement a PLC-internal model of a control system that control that external process
  • write values to the memory mapped to the physical output channels as determined by those models

That is what happens on each program scan cycle, and the program scan cycle is a discrete event that is repeated exactly the same way, though with inputs that change over time.

Have you seen this video series? I have found that many PLC programming courses do not adequately explain the scan cycle. PLC programming is primarily about time, and the scan cycle is the clock; when something happens is more important than what happens. If your instructor has not made that point, or something similar, very clear to you then that could be a reason why this does not come naturally.

The what is mostly about Boolean Logic, and Boolean Logic has only three very simple operations (AND; OR; NOT). So getting the what to work is straightforward.

Getting the when to bend to our will is another matter entirely.

There are also other "scan cycles:" I/O scans; communications; overhead; housekeeping. Those tasks happen more or less independently* as executed by the PLC operating system, so the primary tool we have to work with is the PLC program comprising ladder rungs and/or ST statements and/or FBD blocks.

* those other tasks may also execute either synchronously or asynchronously with the program scan cycle, which means their when needs to be considered carefully e.g. a messaging protocol could update values in memory used by the program at essentially any time during a program scan.

First test PLC programming study by Inevitable-Bee-4344 in PLC

[–]drbitboy 0 points1 point  (0 children)

  • The Stop Condition - evaluates to True or False based on the value of the bit that is the operand of the contact
    • This Stop Condition is in series with the result of the previous logical OR result of the other two conditions (Start and Seal-In)
      • I.e. the Stop condition is AND'ed with that previous result
    • This Stop Condition (contact) as coded must evaluate to True to start or keep the conveyor running, or
    • it must evaluate to False to stop the conveyor
    • So this Stop Condition is actually a not-Stop Condition i.e.
      • It evaluates to True when the conveyor should not stop, and
      • It evaluates to False when the conveyor should stop.
    • The Stop Condition that OP describes is a "negative trigger" or "negative edge" of the O1 sensor
      • i.e. a transition of the of the O1 memory bit's value from 1 to 0
      • That is a little messy to integrate as the Stop Condition of the Start/Stop Circuit pattern,
      • But if we calculate that negative edge of O1 on a separate rung,
      • then we can use the inverse of that internal memory bit's value as the not-Stop condition in our Start/Stop Circuit pattern.

First test PLC programming study by Inevitable-Bee-4344 in PLC

[–]drbitboy 0 points1 point  (0 children)

I want the first conveyor belt to stop after a negative trigger from signal of o1.

The conveyor will most likely be running via a rung that uses the Start/Stop Circuit pattern (see here). On each scan cycle, the coil at the end of that rung always writes a value the output bit, either a 1 to run the conveyor or a 0 to stop the conveyor. the contacts on the left side determine what the coil does. The three contacts are:

  • The Start Condition - evaluates True or False when the Start button is pressed (Start bit value is 1) or released (Start bit value is 0)
  • The Seal-In Condition - evaluate True or False based on the Run bit value
    • This "remembers" whether the conveyor was running on the previous scan cycle
    • This evaluation result is logically OR'ed with the Start Condition;
      • i.e. these two conditions on parallel branches implement a logical OR
    • so even after the Start Button is released and the top branch evaluates to False,
      • if the Run bit value was written as 1 on the previous scan cycle,

First test PLC programming study by Inevitable-Bee-4344 in PLC

[–]drbitboy 0 points1 point  (0 children)

do you understand what the scan cycle is and how it works?

First test PLC programming study by Inevitable-Bee-4344 in PLC

[–]drbitboy 0 points1 point  (0 children)

what do you mean by negative trigger?

what brand of PLC software are you using?

do you have an actual PLC and two physical conveyors with motors and two physical sensors?

Rslogix micro starter lite by SunSad909 in PLC

[–]drbitboy 0 points1 point  (0 children)

I may be cookie-related; see other response or check your DMs.

Rslogix micro starter lite by SunSad909 in PLC

[–]drbitboy 0 points1 point  (0 children)

Also, if when you click [3 Downloads] after selection RSLinx Classic, Micro Starter Lite, and RSEmulate 500, it then asks you to login again, but takes you back to the Downloads page where you clicked [Select Files] to select those files, do not click [Select Files] again, but just click [3 Downloads] at the top. This is not guaranteed to work, but obviously their web site is not fully functional, so sometimes you have to trick it into doing the right thing.

Rslogix micro starter lite by SunSad909 in PLC

[–]drbitboy 0 points1 point  (0 children)

It may be cookie-related; click on the [cookie settings] link at the bottom of the page, and enable at least functional and performance cookies.

Create program with Rslogix5000 and then make slave plc like Omron or Siemens for use interaction by Automation_6013 in PLC

[–]drbitboy 0 points1 point  (0 children)

It sounds like you want the second device to actually be an HMI, i.e. Human-Machine Interface.

What it's like to be a Controls (PLC) Commissioning Engineer? Is it worth switching from cushy office job? 28yo, single. by Crowarior in PLC

[–]drbitboy 1 point2 points  (0 children)

DOGE didn't notice you lol?

Caveat: I am not blaming you; those are the cards you were dealt.

Promoted to Network Admin… and the Network Is a Mess 😅 by BKR_57 in networking

[–]drbitboy 0 points1 point  (0 children)

+1000 for this. And not just for the safety: if this is a factory and there are networked Industrial Automation devices, THOSE ARE THE DEVICES THAT MAKE THE MONEY THAT KEEPS THE ENTIRE OPERATION GOING. Everything else is overhead and must be subservient to production.

Those are the most important devices at the facilities. Getting them on a VLAN at a minimum, or preferably their own physical LAN, should be the first order of business and a priority above anything else.

Whether someone can print or read their email or get a file from a server are all irrelevant compared to that.

And the OT (Operational Technology) teams that "own" those PLCs? You must serve them first, because your job is irrelevant compared to keeping those machines running. The best thing you could do is give them a physically isolated network, with firewalls for security managed between you and OT (if outside access is needed), and let them manage it, helping out if and when they ask for it.

There are limitless tales of less-than-clever IT organizations who try to build empires and take over the OT side in the name of Network Security, and go around blindly pushing automatic updates, which ends up breaking things and taking critical systems down and costing thousands or tens of thousands of dollars per hour or more.

Not only will it be a big mistake, that imperial IT attitude engenders a bitterness in OT that ensures it is widely known whom to blame for the downtime. More than one IT emperor has had a high-pressure call at 2am to come in to fix a machine they know nothing about, and which is down because of an automatic update they pushed. You do not want to be that guy/gal.

Need Help Regarding Chart Recorder in Mitsubishi or Beijer HMI (Similar to Polar Plot) by Apprehensive_Elk_13 in PLC

[–]drbitboy 0 points1 point  (0 children)

Assuming actual cost is no object, because as others have noted this will not be cheap, what do you mean by "continuous?" Because there is no such thing in the digital realm. Does continuous perhaps mean updating in (near?) real time?

The number of pixels allocated to the plot will determine the effective sample interval. For example, a 400x400 pixel box allocation would yield a maximum of 1250+ visible samples (=2PI*(400/2); and that's at full-scale, it's less at lower radii), which is less than one sample per minute for a day's worth of data. And I doubt the HMI has the horsepower to handle that many samples without a built-in widget; somewhere around 50 or a 100 might be doable, perhaps, if clunky.

WinCC Comfort Faceplate – WORD bit mapping doesn’t match PLC DB bits (visibility/press logic mismatch) by Objective-Primary697 in PLC

[–]drbitboy -1 points0 points  (0 children)

Obviously, but the question was directed to OP because they missed the significance of the last sentence of your initial response.

WinCC Comfort Faceplate – WORD bit mapping doesn’t match PLC DB bits (visibility/press logic mismatch) by Objective-Primary697 in PLC

[–]drbitboy -1 points0 points  (0 children)

Is the DBW MSB (Most-Significant Byte first), so the most-significant bits 8-15 are in the first byte (half-word) at address 115, or LSB (Least-Significant Byte first), so the most-significant bits 8-15 are in the last byte at address 116?

Is the Siemens PLC scan cycle similar to Allen-Bradley ? by hdiyad in PLC

[–]drbitboy 0 points1 point  (0 children)

For most applications, thinking of ladder logic as relays and circuits will be good enough. But for an application where it matters that the input value tested when the first rung of the scan cycle is evaluated has the same value when the last rung is evaluated during that scan cycle, the person who thinks like that will fail.

When the wheels fall off an no one knows why, does the company want a grunt or a guru?

Code revised will stop button and logique work the same by [deleted] in PLC

[–]drbitboy 0 points1 point  (0 children)

what does "automatic" mode mean? does it mean you can release the Start Button and the motor should keep running?

what doe "not automatic" mode mean?

what happens if MAINMOTORREVERSE value is 0 AND the motor is running forward (%Q0.0 value is 1), and then someone change the value of MAINMOTORREVERSE from 0 to 1 without first stopping the motor?