J
James Ingraham
"Step 7 allows the UDT to be declared within the Function Block."
That's an advantage.
"RSLogix doesn't allow a UDT to be passed into the block."
Yes, it does, by reference. UDTs can't be DECLARED inside the AOI, but they can certainly be used by the AOI.
"Here is an example of OOP using SCL in Step 7..."
I appreciate you posting such a concrete example. It was a little difficult for me to follow, since I usually program in LD. In particular, I can't figure out how the distinction is made between static and temporary variables. Still, the static variables are an advantage over Logix.
Importantly, this is NOT an example of OOP. You can't create a reference to an instance of this FB and pass it to another FB. Several "functions" have been amalgamated into the FB, but there's no way to distinguish except the state variable. So the internal implementation is critical to the external access, which is exactly what OOP is supposed to prevent.
-James Ingraham
Sage Automation, Inc.
That's an advantage.
"RSLogix doesn't allow a UDT to be passed into the block."
Yes, it does, by reference. UDTs can't be DECLARED inside the AOI, but they can certainly be used by the AOI.
"Here is an example of OOP using SCL in Step 7..."
I appreciate you posting such a concrete example. It was a little difficult for me to follow, since I usually program in LD. In particular, I can't figure out how the distinction is made between static and temporary variables. Still, the static variables are an advantage over Logix.
Importantly, this is NOT an example of OOP. You can't create a reference to an instance of this FB and pass it to another FB. Several "functions" have been amalgamated into the FB, but there's no way to distinguish except the state variable. So the internal implementation is critical to the external access, which is exactly what OOP is supposed to prevent.
-James Ingraham
Sage Automation, Inc.