News:

  • May 17, 2024, 03:29:37 AM

Login with username, password and session length

Author Topic: RX edge trigger  (Read 2943 times)

amezcackle

  • Newbie
  • *
  • Posts: 9
RX edge trigger
« on: May 16, 2016, 04:05:20 PM »
Hi
I have a simple rung with an RX instruction with no logic associated with it. Should the RX instruction run only once on the first scan as I thought it would, or as it does on every scan. I am doing this instead of at continuous intervals because I had a problem with receiving values with continuous at power flow with an interval of zero. I have a similar instruction on a separate rung with an ST1 bit which also works this way. I am missing something, I'm wondering what.
Thanks

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3666
    • Host Engineering
Re: RX edge trigger
« Reply #1 on: May 16, 2016, 04:14:29 PM »
That behavior is configurable from within the instruction (see attached picture of RX editor).

Look at the Enable group box.  If it is configured for Once on Leading Edge, it should only run ONCE (assuming no contacts driving it, and it is at top of $Main).  If it is configured for Continuous on Power Flow at Interval, then it will run multiple times (based on the interval).

amezcackle

  • Newbie
  • *
  • Posts: 9
Re: RX edge trigger
« Reply #2 on: May 16, 2016, 07:01:09 PM »
The RX instruction seems to be running continuously even though I have selected Once on Leading Edge. I will attach a screenshot of the rungs. The Dataview shows the received values and they are updating constantly. This is all working as I want, just not as I expected. Is it because the instruction is in a task which runs every scan?

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3666
    • Host Engineering
Re: RX edge trigger
« Reply #3 on: May 16, 2016, 07:43:43 PM »
Is it because the instruction is in a task which runs every scan?
Please show ALL of the ENTASKs instructions for SSVH_read.  If they are not all in $Main, then show how THOSE code-blocks are enabled/run.

There's a good chance the SSVH_read task code-block is NOT running "every" scan, but is actually "terminating" then "re-enabling", which means that your RX's WILL re-fire.

What kind of Program Check rule violations are you getting for anything related to SSVH_read?  Post those here (copy/paste works).  That may also help explain what is happening.

amezcackle

  • Newbie
  • *
  • Posts: 9
Re: RX edge trigger
« Reply #4 on: May 16, 2016, 09:02:31 PM »
There is only one SSVH_read ENTASK in $Main with an ST1 contact. Program check finds no rule violations. Here is a screenshot of the ENTASK in question. Does the task "terminate" then "re-enable" every scan in this case? If so is this an OK way to make RX read?
Thanks

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3666
    • Host Engineering
Re: RX edge trigger
« Reply #5 on: May 17, 2016, 08:41:41 AM »
Try this.  Modify the program such that you have an ST2 ($Off) contact in front of both RX instructions.  Then see if the "Local" elements are still changing.