I'm writing more of my program with Qcode, and ran across something this morning that might help someone else:
I was trying to get an IDC to latch on with a momentary, rising edge signal, and then stay on when the signal goes off. Easy, using object list and a "latching or/and"
But, when I write what I thought was an equivalent statement in Qcode, the ICD functions as a momentary, and doesn't latch:
Obviously, this is a bad programming practice, because in just about any other structured text programming language, the IDC would become stuck on the first time the input went true, and would never turn off. However, that's NOT what it does. Try it for yourself; when the input goes false, the IDC also goes false, acting like this:
I don't think that those previous two code statements are equivalent, but I guess that's just an IQAN idiosyncrasy. So here's a work-around I came up with using a memorizing channel. It works as advertised as a latching IDC: when the input goes true, the MR channel latches on, and then when a different input goes true, the MR latches off:
Note the use of the ALWAYS TRUE IDC. As it's name suggests, it has a TRUE operator in it's activating channel so that it's always on. This allows the MR to latch to true.
So there you have it, a latching "IDC" in Qcode.
Customer support service by UserEcho