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

Link to comment
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

Link to comment
Share on other sites

  • MVP 2023

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
Link to comment
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.

Link to comment
Share on other sites

  • MVP 2023
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.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.