News:

  • October 12, 2025, 07:11:30 PM

Login with username, password and session length

Author Topic: Task called every scan, but runs intermittently.  (Read 2197 times)

OrionHE

  • Sr. Member
  • ****
  • Posts: 85
Task called every scan, but runs intermittently.
« on: April 29, 2022, 12:11:47 PM »
I have several tasks configured to send different ASCII strings. All tasks but one run every scan when called and their respective .RanThisScan bits stay ON. But one task runs intermittently when called continuously. There are no HALT instructions for this particular task. The .RanThisScan bit for this task appears mostly OFF in the status view. What might cause this behavior?

rlp122

  • Sr. Member
  • ****
  • Posts: 89
Re: Task called every scan, but runs intermittently.
« Reply #1 on: April 29, 2022, 12:27:38 PM »
Comms really shouldn't be in Tasks.  They should be in a Program block that stays active until the comms instruction terminates gracefully then they can end.

OrionHE

  • Sr. Member
  • ****
  • Posts: 85
Re: Task called every scan, but runs intermittently.
« Reply #2 on: April 29, 2022, 12:38:25 PM »
Comms are handled through a program. These tasks are really just string assemblers.

RBPLC

  • Hero Member
  • *****
  • Posts: 585
Re: Task called every scan, but runs intermittently.
« Reply #3 on: April 29, 2022, 12:46:25 PM »
Comms are handled through a program. These tasks are really just string assemblers.

What version of DmD are you running?

OrionHE

  • Sr. Member
  • ****
  • Posts: 85
Re: Task called every scan, but runs intermittently.
« Reply #4 on: April 29, 2022, 12:49:17 PM »
2.8.3

I don't usually grab every update anymore. But that may have stung me this time. I'm grabbing the latest now.

RBPLC

  • Hero Member
  • *****
  • Posts: 585
Re: Task called every scan, but runs intermittently.
« Reply #5 on: April 29, 2022, 01:34:01 PM »
I asked because I had remembered having some TASK issues a while back:

https://forum.hosteng.com/index.php?topic=3260.0

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3761
    • Host Engineering
Re: Task called every scan, but runs intermittently.
« Reply #6 on: April 29, 2022, 01:40:45 PM »
ENTASK can run its task continuously, but at intervals like once a second or once every 10ms, whatever.

How are your each of your ENTASKs configured to run?


OrionHE

  • Sr. Member
  • ****
  • Posts: 85
Re: Task called every scan, but runs intermittently.
« Reply #7 on: April 29, 2022, 02:48:25 PM »
The problem task was set to run at 50ms intervals. That explains why it hadn't necessarily run during the scan. I had a more severe problem tied to this task that I had thought I correlated to the intermittent running. If running the interval at zero solves that issue, I'm in better shape for it. Thanks for your help!