Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Mike Nash on October 29, 2021, 09:24:29 AM

Title: BX-DM1E-18ED23-D HsCtrTmr not counting during reset time
Post by: Mike Nash on October 29, 2021, 09:24:29 AM
Software $HsCtrTmr.ResetEdge is inhibiting count for quad counter for a second or so. If I put an up diff before it there is less count loss, but there should be none.


Bug? Solution? I'm on-site trying to start this up now.


OS 2.8.6 DmD 2.8.3.Brand new PLC. Scan time 347 uS
Title: Re: BX-DM1E-18ED23-D HsCtrTmr not counting during reset time
Post by: Controls Guy on October 29, 2021, 09:31:50 AM
Will it allow you to write directly to the position register instead?   I doubt it, but if so, that shouldn't cause any lost counts.
Title: Re: BX-DM1E-18ED23-D HsCtrTmr not counting during reset time
Post by: franji1 on October 29, 2021, 09:49:24 AM
Sounds like it's behaving like .ResetLevel.

Also, double check that your input logic is not "bouncy" - stick an INC on your edge version below your SET .ResetEdge (OUT .ResetEdge?) and make sure it is only going up by 1.
Title: Re: BX-DM1E-18ED23-D HsCtrTmr not counting during reset time
Post by: Mike Nash on October 29, 2021, 11:04:42 AM
Sounds like it's behaving like .ResetLevel.

Also, double check that your input logic is not "bouncy" - stick an INC on your edge version below your SET .ResetEdge (OUT .ResetEdge?) and make sure it is only going up by 1.


I haven't tried this yet. I agree it is acting just like level. The leading edge contact seems to work at the moment. I can tell you an HMI momentary button into a non-conditioned ResetEdge will repeatedly reset the count after a count or two.
Title: Re: BX-DM1E-18ED23-D HsCtrTmr not counting during reset time
Post by: franji1 on October 29, 2021, 11:23:47 AM
"Momentary Edge" from an HMI standpoint MUST be used as an EDGE contact on your SET (or OUT) .ResetEdge

STRPD MomentaryEdge
SET (or OUT) .ResetEdge  // the PLC will "reset" the .ResetEdge once it is "reset"

Hence, if you did
STR MomentaryEdge
SET (or OUT) .ResetEdge

the .RestEdge will DEFINITELY turn ON then OFF then ON then OFF ... for however long the MomentaryEdge stays ON, which matches the description of your behavior

Hence, do an edge contact
STRPD MomentaryEdge
SET .ResetEdte
RST MomentaryEdge

I would even throw in that RST MomentaryEdge (presuming the HMI is only going to turn it OFF later, which it will already be OFF due to the RST)
Title: Re: BX-DM1E-18ED23-D HsCtrTmr not counting during reset time
Post by: BobO on October 29, 2021, 11:36:29 AM
Are you writing it once and then not writing it again?
Title: Re: BX-DM1E-18ED23-D HsCtrTmr not counting during reset time
Post by: Mike Nash on November 25, 2021, 10:16:59 PM
First, my apologies for leaving this thread hanging. I did try to reply that day, that I had it working well enough (using the Leading Edge Powerflow Modifier), but apparently I did not manage to actually post it. I am not too great with smart phone forum usage.

Since the replacement for my development BRX finally arrived (about 4 1/2 months after ordering it,) I finally got it put back on the desk and managed to wire Y0-Y2 to X0-X2 30 minutes before leaving for vacation.

Playing with it via VPN today, I see now where trying to reset the internal $HsCtrTmr1 via .ResetEdge in regular ladder is definitely losing counts at 1000 Hz. So I tried using the Match Register 1 interrupt and setting .ResetEdge there, (along with an internal bit to fire an output). Success. No lost counts during reset. It "feels" a little more involved since I need to use INTCONFIG to set the counter preset, but just a little.

For testing, I'm using Axis1 AXVEL to create a quadrature output on Y0-Y1 and reading that on X0-X1 so it's easy to verify staying in sync.

Thanks for the help.