Jossk
In Studio 5000, there is a first scan bit [s:fs]. Does OpenPLC support this, or is there a different way to essentially do the same?

Thank you
Reply 0 0
spjosef

That´s something Rockwell-specific 😉

Use a Bool-Variable, define the init-value as "true" and reset the bit on the last line of your PLC-program.

Reply 0 0
Jossk
I may be misunderstanding your instructions, but that kind of sounds like a one shot, which I'm also looking to replicate for my counter & photo eye sensor.

Unless that's a Rockwell-only issue and is not necessary in OpenPLC.
Reply 0 0
spjosef

The oneshot is also rockwell-specific as far as I know. In other PLCs (and also in OpenPLC) the P_Trig or R_Trig functions offer the same functionality as an oneshot.

But back to the S:FS
1. Add a global bool-variable and name it something like firstCylce or systemFirstScan
2. Set the initial-value to true
3. add a line to your program, where you set this variable to false. This line must always be the last line of your whole PLC-program.
4. Now use your firstCycle-variable everywhere, where you intended to use S:FS

So basically what happens, is that your variable is true for the very first cycle, when your PLC is running. The variable is initialised with true, all your code executes once, and in the last line of the code the variable gets reset, so that the other times your PLC is executing the code, this variable is always false.

Reply 0 0
Jossk
Awesome. Thank you for the detailed explanation.

I had a feeling oneshot was also Rockwell-specific when I didn't see that either. Thank you for the confirmation, and standardized alternative.
Reply 0 0
jesawyers63
FYI...first scan bit is not Rockwell specific.  It is a standard for every PLC programming environment that I have used which is extensive.  Same with the one-shot which is also a standard function used in control systems programming.

I see IEC 61131-3 as the minimum functionally that is required for a PLC programming environment.  Extending IEC61131-3 does not invalidate the programming environment as not being IEC 61131-3 compliant.
Reply 0 0
Jossk
Good to know. The one issue with de facto standards, is every manufacturer is able to implement the same functionality in their own way.

Quote:
I see IEC 61131-3 as the minimum functionally
Every standard and Code (eg CEC or NEC, etc.) is the minimum for whatever it is. Beyond that is where problems with interoperability comes into play. Every large manufacturer wants to have functionality that is exclusive to them. It is what helps them to stand out. Unfortunately, in cases like this, it creates vendor lock-in. And with that vendor lock-in, they know once they have you dependant on their product, they can charge whatever they wand. Since they have their own file format, and there are parts that are specific to them, you can't easily switch between manufacturers.

Quote:
Extending IEC61131-3 does not invalidate the programming environment as not being IEC 61131-3 compliant.
Yes and no. The parts that fall under IEC 61131-3 are compliant. The parts that are exclusive to that manufacturer are, as they do not exist, and cannot be used in other environments.

Unless I'm not finding it in OpenPLC, or they have not been implemented yet (I'm not paying an arm & a leg to read the standard), it seems the first scan bit and one-shot appear to be de facto standard, and not actually specified in IEC61131-3.

Rockwell's Subroutines are a good example. They use those instead of functions or function blocks (as far as I can tell).

@jesawyers63, hopefully you can confirm or refute any or all of what I said due to your much greater experience than mine.

I admit, my experience is very limited, I'm going off of my observations between my self-learning of OpenPLC and my in-class instruction and use of Studio 5000.

My final project for the course has to be done in Studio 5000. However, since I don't have access to it, I have been trying to recreate it in OpenPLC to work on at home & test. Then modify said Studio 5000 project. Project is still not going well. lol (This is just to give a better idea how limited my experience is)

My experience is limited to Rockwell/Allen-Bradley & OpenPLC. I do not know anything about Siemens or any other manufacturer's software.
Reply 1 0
jesawyers63
@Jossk  your points are noted and do make sense.  Basically you're saying keep openPLC strictly in compliance with the IEC 61131-3 standard.  Then use function blocks to extend functionally and to re-create other PLC vendors function blocks as needed.

This does make sense to me and I have indeed re-created various PLC vendors function blocks when they are missing like the one-shot block mentioned above.

This supports the library concept like OSCAT to further extend openPLC yet keep openPLC simple.  I like it.

Regards, John
Reply 0 0
jesawyers63
I shall find all the function blocks that I have written over the years and try to implement them in openPLC.  The first...one-shot.
Reply 0 0
thiagoralves
As mentioned before, one-shot is implemented in OpenPLC and is also part of the standard IEC 61131-3 function blocks. The only problem is that Rockwell decided to call it with a different name (as it does with many other things, just to be different). It’s official IEC 61131-3 name is R_TRIG and you can find it in the list of standard function blocks on OpenPLC
Reply 0 0
Jossk
@thiagoralves Thank you for the clarification. I hate it when companies do stuff like that. I've never understood why companies try to confuse potential future (and current) customers.

There's much better ways to be different.
Reply 0 0
jesawyers63
@Jossk

First I would like to say I am really enjoying our discussion about this subject.  Being retired, I don't get to talk much with Control System Engineers or PLC Programmers.  

Quote:
I hate it when companies do stuff like that. 


Companies do stuff like that to help Control Systems Engineers and PLC programmers be more efficient when writing code. 

R_TRIG is your basic one-shot. What if I need a one shot pulse for one second?  I have used one-shot pulses like this to close a relay output to reset another PLC/Equipment because the other piece of equipment needs the longer pulse.

The companies see this and develop a better one-shot block that has a tunable length.  These companies then thoroughly test the new one-shot FB instead of people like me having to write my own which takes development time and money.

Regards,
John

Reply 1 0
Jossk
I am also enjoying this conversation. However, I would not call myself a programmer. I'm a student at best. That being said, I wouldn't mind getting a job as PLC programmer, or similar. I'm just your average electrician, who enjoyed the PLC section and wants to learn more.

I enjoy talking with people with experience, as I learn a lot that way.

In fact I the most I have done with PLCs at work is install some in a cabinet, and wire them up. Someone at the office did all of the programming.

Cheers,
Joshua
Reply 0 0
jesawyers63
Joshua,

Being a electrician you already have a lot of necessary knowledge to become a PLC programmer.  If you are an industrial electrician that is even better.

Before you can automate anything with a PLC and software, you must know the process you are trying to automate first.  I have taught PLC programming classes to automate something as simple as a drip coffee maker.

Knowing how things work like pumps, motor controls, valves, switches, solenoids, etc within the process.  One of the most important things to learn is Communications!!  Serial communications like RS-232, RS-485, network communication like Ethernet.  Check out something called the OSI Model.

Some of the best programmers, electricians who have been in the industry a bit.  There are a lot of YouTube videos ;you can watch to get you started and then apply using openPLC.  Start with Ladder Logic (LD) first to keep things simple.

Good Luck,
John
Reply 0 0
Reply