News:

  • May 05, 2026, 04:57:14 PM

Login with username, password and session length

Author Topic: SETUPIP warning  (Read 8193 times)

DLTimmons

  • Hero Member
  • *****
  • Posts: 232
SETUPIP warning
« on: October 21, 2015, 03:44:11 PM »
Got to a good point to update to 1.4 I don't like doing update in the middle of a major project.I now get an warning when I try to set my IP in first scan this worked in 1.2

I get "W453 Fully-asynchronous instruction (SETUPIP) used in edge-enabled task (ENTASK $tFirstScan)

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: SETUPIP warning
« Reply #1 on: October 21, 2015, 04:14:11 PM »
The proper method would be to use your conditional contact to RUN a program with the SETUPIP task in it that uses the success bit to HALT the program block.

The idea is, that the SETUPIP 'could' take more than one scan to complete, so when you use it in a task that is only on for one scan, you 'may' not be giving it a chance to complete.
« Last Edit: October 21, 2015, 04:16:16 PM by plcnut »
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3806
    • Host Engineering
Re: SETUPIP warning
« Reply #2 on: October 21, 2015, 04:44:51 PM »
Or, you could use a loop in $tFirstScan.  The attached screen shot shows the following
Rung 1: Set $tFirstScan's .TimeSlice to 0 to make sure the WHILE loop "yields" every scan
Rung 2: If the IP Address is already set correctly, skip the loop and go to any other logic you might want to add to this task in the future (BELOW the LABEL) (I used a hexadecimal constant here - it's a little closer to an IP Address than a pure decimal value)
Rung 3: The UNCONDITIONAL WHILE that runs the ASYNCHRONOUS SETUPIP instruction until it finishes successfully or in error
Rung 4: The SETUPIP that will run just once (see input leg w/triangle which designates edge-triggered)
Rung 5: Upon completion, either C200 (success) or C201 (error) will be set.  Once either one is set, exit the WHILE/WEND loop.
Rung 6: WEND - The end of our WHILE loop
Rung 7: LABEL - where we jump to if our IP Address was already initialized properly
Rung 8: EXIT the task (this isn't necessary, but I stuck it here to emphasize that this system task EXITs once it reaches the bottom, regardless of whether the EXIT instruction exists or not)
EDIT: do NOT use EXIT - that can only be used in a PROGRAM code-block  ::)
« Last Edit: October 21, 2015, 05:03:51 PM by franji1 »

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3806
    • Host Engineering
Re: SETUPIP warning
« Reply #3 on: October 21, 2015, 05:17:06 PM »
I did verify that SETUPIP does complete immediately (i.e. the WHILE loop only runs once, C200 is turning on immediately by the SETUPIP instruction).

You can IGNORE SPECIFIC Program Check rule violations by right clicking on the rule violation in the Output Window.  I would recommend just ignoring
W453 Fully-asynchronous instruction (SETUPIP) used in edge-enabled task (ENTASK $tFirstScan)
just in that specific rung, $tFirstScan#1

Ignoring Program Check Rules was a feature added in 1.4.  It is useful when you know your logic isn't "pure", but it does what you need it to do, so quit bothering me about it.  This information gets downloaded as part of your project, so you don't have to keep "ignoring" specific violations again and again.  To manage your project's set of Ignored Program Check Rules, go to the Tools->Ignored Program Check Rules... menu item

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6154
  • Yes Pinky, Do-more will control the world!
Re: SETUPIP warning
« Reply #4 on: October 21, 2015, 05:25:59 PM »
SETUPIP will normally complete immediately, but could theoretically be delayed if the driver is in use by another instruction. It's safe-ish to do the way you are, but technically wrong, hence the warning.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

DLTimmons

  • Hero Member
  • *****
  • Posts: 232
Re: SETUPIP warning
« Reply #5 on: October 22, 2015, 09:52:17 AM »
Thanks

I put that rung in firstscan in case I need to swap CPU then I don't have to worry with setting the IP it does it for me ;D