Jump to content

Recommended Posts

Greeatings .

 

I need help , i make one subrutine and i cant restart my timer in this subrutine, 

in attach i set my code for subroutine if someone can set for me timer on pleace that can help me or say me how can i make it.

What i need , when i run my subroutine i activate my timer if timer si on i reset all my output and set Stop_filtration_top, this bit is important

to me , whit this bit i call my second subroutine and if this second subroutin is finish i restart Stop_filtration_top and can back to first routine

filtration.vlx

Share this post


Link to post
Share on other sites

You need to attach your entire project.  You describe calling multiple subroutines, but only attached an export of one.

We have no idea if you are doing the calling correctly.  Please post your code.

Joe T.

Share this post


Link to post
Share on other sites
8 hours ago, Joe Tauser said:

You need to attach your entire project.  You describe calling multiple subroutines, but only attached an export of one.

We have no idea if you are doing the calling correctly.  Please post your code.

Joe T.

ok i send you I have one more question , subroutin are always call or only when line is on ?

Euroaquaing.vlp

Share this post


Link to post
Share on other sites

I haven't looked at your program.

Something FYI.  In case you don't know, Visilogic has an annoying quirk....when in online mode it shows elements of an uncalled sub in red (powered).  This can be very confusing.  There are many solutions to this, the best I know of from another forum member (can't remember who...sorry) was to set up a simple count at the top of each sub.  If the count is progessing, the sub is active.

cheers,

Aus

 

  • Upvote 1

Share this post


Link to post
Share on other sites

I couldn't find any reset coil elements for timers in ladder. Are you resetting it by not calling a subroutine?

Someone correct me if I'm wrong, but I think that nets in subroutines won't get updated if subroutine is not called (so bits that were 1 when program last time passed through subroutine will remain 1). I find this not intuitive so I usually run through all routines from main and use bits as conditions. Maybe your program will work if you used reset coil for timer.

Share this post


Link to post
Share on other sites
8 hours ago, Isakovic said:

nets in subroutines won't get updated if subroutine is not called (so bits that were 1 when program last time passed through subroutine will remain 1)

Yes this is true. That's why it's not good practice to have conditional calls to subroutines except in special circumstances. Avoid that whenever possible.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...