
martinav (Customer) asked a question.
How to reset a run bit after programs runs.
My programs just pass by after first run of these stages. I have a clear cycle that needs to clear the .done bit in these run instructions. How do you do this?
Do-more/BRX
The .Done bit is read-only and is controlled directly by the control engine of the PLC firmware. It will be cleared the next time you RUN that program.
This is where SET and RST instructions are useful. A better pattern in your code would be to do the following where S14 stays enabled while LogData is running, and transitions to S15 once LogData is done (along with setting a corresponding C bit).
then use RST C100 and RST C101 wherever you think you need to clear the "done" state
Basically, when S14 is enabled, the logic in that stage (lines 1-9) will execute every scan until you JMP or some other disabling function (e.g. SGRST, EXIT, etc.). So as soon as you hit line 3, LogData program gets set to run and the RUN instruction TURNS OFF the .Done bit. Hence, the contact in line 5 will BE OFF that first scan S14 was enabled (because LogData hasn't even executed any logic yet).
The logic in Stage S14 continues to execute. Some future scan, LogData.Done will turn ON, and the rung at lines 5-7 will end up SETting C100 and JMPing to Stage S15.
Since Stage S15 is immediately below Stage S14, it will actually start running the same scan the JMP S15 instruction in Stage S14 executed. (Note that if Stage S15 logic was above Stage 14 logic in ladder memory, Stage S15 would not actually run its first scan until the next PLC scan).
So the RUN ClearCycle will clear the ClearCycle.Done bit, causing the contact at line 13 to be OFF until some future PLC scan when ClearCycle program EXITs, which turns on ClearCycle.Done bit, causing the SET/EXIT instructions in lines 14/15 to execute.
I did this before reading your 2nd post. I didnt get what the C bit was for.
Since you can't reset the bult-in .Done bit, I created a C bit that you CAN reset (i.e. "how do I reset the .Done bit). So whatever reason you needed the .Done bit reset, utilize C100/C101 instead.
Well, I dont know enough to even ask the question right. I suppose I dont really need to reset the bit, since you clarified that it resets itself when its re-run. I think my issue was having the LogData.Done in the following stage. It seems to be working properly with that contactor in the same stage with the RUN instruction.
I have to tell you. Ive been doing light programming and lower level computer stuff for 3 decades. I usually can sit down and figure most things out in just a few days with a little kick in bounds now and then with the forums help. This stuff has made me feel like a flippin idiot, and I dont feel like I'm really getting a handle on it at all. Its like every single step I have to ask for help like a clueless m0ron.
Heck, I cant even get this forum format down. I find later I miss the "expand post" and find more posting I previously missed, so I keep asking about stuff already answered. Sheesh.
Thanks for your patience. I dont know you have any left.
Regards.
Rod
I feel the same way when working in DM.
I am not critiquing the platform, I can see the power.
I just cannot wrap my head around it, and maintain the wrap.
I wrote a DM project to monitor the speed of up to 8 spindles and alarm/lockout/kill a remote process.
I have written code to do some timesync between DM (master) and other PLCs.
It is a different mindset/experience than I am accustomed to.
>Heck, I cant even get this forum format down.
Well, at least you don't pine for the legacy forum, then.
You seem like an experienced PLC programmer. I'm curious as to what you find so confounding.
@HOST_BobO (AutomationDirect) ctrl+z is something I find confounding, I expect it to reverse what I just did, like any other piece of software would normally do. Instead I get a pop-up (somedays DmD reminds me of playing on candystand in the early 2000s when popups were still cool ;) ) asking what I want to revert to and regardless of what I select none of it does what I want which in most cases is simply erasing the line I accidentally drew or removing the instruction I just placed.
ctrl+c, more pop-ups (must accept all rungs, but what if I am not ready for that level of commitment, buy me dinner first!).
ctrl+v, inadvertently move the mouse while waiting for DmD to process this complex request (I assume the 5-15 second lag time is DmD trying to find the correct pop-up and short circuiting when it doesn't find one) and you're paste ends up god knows where. Sometimes it's not even what you copied in the first place.
Now most of this is likely user error, I've discussed DmD's barriers to entry before. It's not an easy program to use, but neither are those Rheumatoid Arthritis guy's programs either and they cost a few pesos more.
That said, there's a lot to love about DmD, the instruction set is incredible, program layout is a breeze and stage can be very handy. I just wish me and DmD got along better, someday we will.
To handle undo the way you want requires a journaling editor, which at this point would involve completely rewriting it. It’s something we want to do, but so is adding the instructions and PLC features that make Do-more do more. Host isn’t a large company we have to pick our targets selectively. We do eventually want to do a clean sheet rewrite of much of the front end, but it is a very big job.
I can’t comment on the big delays you are describing. I don’t experience that. Could be related to PC age, memory, or performance.
I rarely use the mouse while programming, so perhaps there are issues there. We do have some here at Host that use it more than I do though.
The undo isn't a big deal, once I learned the DmD way to erase lines without deleting the entire rung I basically just trained myself to avoid ctrl+z. After a few days I barely noticed anymore.
I dk why the delays were bad, this install of DmD was just buggy all around.
As for the mouse, I avoid it too but I suppose not to the level you do. Here's a scenario, I'm on rung 10, want to copy and paste a contact from it onto rung 2. So I ctrl+c the contact on rung 10, use a mouse to scroll up to rung 2 to select where I want to paste and ctrl+V but my thumb is lazy and moves the trackball in the process to hover over rung 3, after the paste delay it shows up on rung 3.
How would you navigate to that location instead? Arrow keys? I don't need DmD to change for me, just need to talk to the experts to learn how to operate it the way it was designed.
I can attempt to reproduce it with a screen recorder but you know how that goes. For awhile I was pretty well convinced I had to be seeing things or just not paying attention.