Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Controls Guy on October 11, 2023, 12:49:07 PM
-
I know I have one or two feature requests in regarding SKs, but I don't think I've mentioned this one. I'd like to have nameable booleans. MySK = True, etc. Probably preferable to have them show up as TRUE and FALSE in the docs (cause it'd be obvious it's a bool), but 0 & 1 is fine too.
If easier, less optimal would be ability to cast SKs, so I could have a MySK:0 as a contact.
-
So what would this offer that constants named True = 1, False = 0, On = 1, Off = 0, etc won't solve?
However, I've noticed I can't COPY On to C0 for a simple example, so there's another feature request.
-
SKs in general do two things as I see it. (1) Code readibility, where my elevator app is comparing FloorNum with TopFloorSK, vs with '4'. (2) Easy goof-proof config during startup. I go change TopFloorSK from 4 to 6 in the definition once and threre's no chance I inadvertently miss one '4' in the code nor change an unrelated '4'. Plus it's quicker.
Bool SKs would do those same two things to install-specific bools that they do for ints & floats. Having it recognized by the PLC as a bool lets me use a contact vs. making it an int and having to do a comparison, etc. Also, it would lead to cleaner MATH IFs. "IF(MySK, Exp1, Exp2) + Exp3"
Example case is FeaturedXInstalledSK. Being able to use a contact vs. 'FeatureXInstalled = 1'.
-
Your MOVE is an example of the issue. You want to use it as a bool, but the PLC can't help but assume that its an int, and won't do the thing you're trying to do.
-
This is what $On and $Off are for. They are technically memory locations (ST1 and ST2), but the result is the same.
How about an option to use the tags $True $False over $On $Off for those ST bits? We would need to think through any ramifications, but that may work. You would still be able to use TRUE/True FALSE/False (whatever) for Symbolic Constant (the dollar sign signifies a system-assigned NN).
-
No, what I was looking for was analogous to the difference between K4 and TopFloorSK. I don't mind $True/False vs. $On/Off where universal ones can be used, but configuring job-to-job having used $On and $Off is like configuring job to job without numerical SKs (because there's only one $On and one $Off, they're program-wide). "Is this K4 one of the ones I have to change? Oops, changed one of the ones that wasn't supposed to", etc.
-
I get what you are looking for now. Let us chew on it.
-
Cool, thank you! 8)