Jump to content

Recommended Posts

The attached image is taken directly from the help file on timers. The way it reads to me is, A button is pushed, a timer runs for X amount of time, and then an output is turned on. But every time i try and run this, i get the following result.

Button is pushed, output is turned on immediately, timer runs for X amount of time, and then the output goes off. 

If i change the timer to TD, it kind of works more like i thought this would, except the button must be held down continuously, which is not what i need. 

I am a novice at this, and am kinda fiddling around trying to get a handle on it. I am using a v350. Does anyone have any idea why this might be happening? 


v350.jpg.0b493c21f69784f3f1f008e732b7ecec.jpg

pb1.vlp

Link to comment
Share on other sites

  • MVP 2023
3 hours ago, NickButt said:

A button is pushed, a timer runs for X amount of time, and then an output is turned on. 

Is this what you're wanting to do? If so, then you want to use a delay timer (TD).

image.png.7bde66e74276b741c5c1c968b8d920ea.png

Rung 4 allows you to turn the output off by pressing the button a second time.  There are probably 12 other ways to do this, including a way to use the TE timer that may be a bit simpler using a negative transition to turn on the output and doesn't require the Latch bit. Using the TE timer would require you to turn the output off in a different way than I have above,

Link to comment
Share on other sites

  • MVP 2023

The wording of the help file is not quite right in this case.  It should read differently along the lines of Once Key 3 is pressed, O3 switches on, the timer decrements to zero, and once it reaches zero O3 turns off.

Vision timers can do everything needed with timers, but other plc makers often have far more types (and methods of relating that timer to other elements) that make it far, far easier to achieve an aim.  This has always been a pet hate of Vision that I have.  Using Flex's example above, another brand I use simply needs 2 elements on one rung to do all that.

The best interpretation of Vision timer implementation is the sequence chart which you see immediately under the particular timer's heading.  Stepping through it shows exactly what happens with different scenarios.

cheers, Aus

  • Like 1
Link to comment
Share on other sites

2 hours ago, Ausman said:

The wording of the help file is not quite right in this case.  It should read differently along the lines of Once Key 3 is pressed, O3 switches on, the timer decrements to zero, and once it reaches zero O3 turns off.

Thanks, that's exactly it.  The help file is almost describing the opposite of what happens. 

Link to comment
Share on other sites

11 hours ago, Flex727 said:

Is this what you're wanting to do? If so, then you want to use a delay timer (TD).

image.png.7bde66e74276b741c5c1c968b8d920ea.png

Rung 4 allows you to turn the output off by pressing the button a second time.  There are probably 12 other ways to do this, including a way to use the TE timer that may be a bit simpler using a negative transition to turn on the output and doesn't require the Latch bit. Using the TE timer would require you to turn the output off in a different way than I have above,

Hi Flex, thank you for that.  That is almost what I'm trying to do. The first 3 rungs work as desired, but the 4th rung, while it does shut the output off, it also restarts the timer and  after 5 secs the output comes back on. I need it to stay off until the button is pressed for the 3rd time and so on .  Basically: (1st press)start-delay-output on / (2nd press)stop-delay-output off,  repeat etc. 

The button in this case represents an inductive proximity sensor that is triggered several times a minute to start and stop glue flow onto timber.  The delays will be operator adjustable to fine tune the start/stop positions to prevent glue wastage.   

Link to comment
Share on other sites

  • MVP 2023

I couldn't resist - State Machine!


image.png.eeac42781e49ea2b462447b93ea73311.png

Download the program file and see if you can follow what I'm doing.  It's in Visilogic 9.8.80.

1 hour ago, NickButt said:

Basically: (1st press)start-delay-output on / (2nd press)stop-delay-output off,  repeat etc. 

You've described a four-step sequence with different actions of the same input based on where you are in the sequence.  Trying to do something like this with contacts and coils can make your head hurt.  The style of programming in the attached file is based on a computer flowchart.

 

Joe T.

NickButt Program.vlp

  • Like 2
Link to comment
Share on other sites

Hi

Not really related to this topic, but related to downloading the file.

I use Firefox browser.

When I tried to download the file above and selected to save it to disk, the file appears to download but after a few seconds windows crashes.

This happened twice before on another laptop, however this is a new laptop and it happens again.

Windows explorer keeps trying to restart every second so I cant troubleshoot anything.

The only way to get back working is to restore from a backup or do a system restore.

Any ideas if this is a Windows, Firefox, Unirtonics or just me?

 

Link to comment
Share on other sites

17 hours ago, Joe Tauser said:

Download the program file and see if you can follow what I'm doing.  It's in Visilogic 9.8.80.

Hi Joe,

Thanks, I could kind of follow most of that surprisingly. Although it also made my head hurt. 😱. At first i didn't understand the 10,20,30 etc, but found a much earlier state machine demo of yours which explained they were just numbers you used to allow room to add things in later. 
The final net confuses me, i can't figure out why the value of D#20 was there?

I did load this up, and assigned a button to the MB0 trigger, but as soon as the plc was powered on the output also turned on, and nothing i did seemed to change that. 

Link to comment
Share on other sites

  • MVP 2023
13 hours ago, sgull said:

Any ideas if this is a Windows, Firefox, Unirtonics or just me?

Denis, I too use Fox, and overcame the reluctance hurdle your statement implied 😱  and did the download.

It all went fine saving to my desktop.  This puter is currently on Fox 85.0 64 and W10 20H2 build 19042.685.  I also only  have Visi 9.8.65 in use.  So to read the downloaded file I had to do the close in task manager retry ignore the warnings trick.

One thing that might be an issue is W10 is often (without user consent) changing write permissions to the C drive.  Many things that previously worked fine are now initially shut out.  Some will now only  save to the dedicated user folders like Pictures Music etc.  I can do the permissions workarounds, but sometimes they are a PITA by upsetting other things, and I am ok (for now) to be putting up with the occasional requester coming up, as most of my saves are not to C.  This seems to be related to the usual M$oft response to a vulnerability/issue that's occurred ......don't fix it properly, simply lock it up more.

I also have lots of telemetry blocked, and Cortana and other useless junk doesn't exist on my system.  Lastly, it might be your A/V doing nasty fairies stuff.

I'm assuming you did a restore via the boot repair methods, as safe mode was probably hard to get to given your symptom description.

cheers, Aus

 

Link to comment
Share on other sites

  • MVP 2023

@Cara Bereck Levy  Another side issue seems to be that the forum pages are not updating quickly.  I approved Nick's post before writing the above to sgull, and Nick's still hasn't appeared without me being logged in.  I've recently had similar delays on "updating" anything...seems to take ages to get implemented for normal pages rather than appearing instantly like usual.

And further to this, I just signed out, this post  and the one above wasn't then visible, nor Nicks.  I then deleted last 2 hours cache, and tried again.  Nup.  Not up.  Logged in and all is ok.  Something odd is going on that needs to be looked at.

cheers, Aus

Link to comment
Share on other sites

  • MVP 2023
9 hours ago, NickButt said:

The final net confuses me, i can't figure out why the value of D#20 was there?

I did load this up, and assigned a button to the MB0 trigger, but as soon as the plc was powered on the output also turned on, and nothing i did seemed to change that. 

The whole point of a State Machine is to allow only one chunk of logic at a time.  It uses MI 0 to hold the "pointer" value and then equal blocks to check the value and pass power only when the pointer value is that particular number.  I use multiples of 10 as pointer values because I'm old enough to have learned BASIC at a time when you had to start all your lines with a number, and we did it that way.  Plus, as you've seen, the pointer can be any number you choose.  

The last network contains a >= #20 block, not an equal block.  Think like the PLC- if the pointer is >= 20, then turn on the output.  What you didn't see was the little flowchart I always draw to define the program flow and then I go back an number the boxes.  In this case, Output ON is true in states 20 and 30.  There is no State 40, so logically this works.

If the output is on then you have a value >20 in MI 0.  Go online with the PLC and click on any of the instances of MI 0.  It will allow you to enter a value.  In hindsight, I should have set the powerup value to 0.  This can be done in the Operands tab by filling in the box with the little plug above it:

image.png.2aa7a9ba751e7e617c9c6d79a9afc945.png

 

@sgull

I've experienced the Explorer Looper.  Visilogic caused it.  I can only guess it's old VB6 upbringing got in a fight with Win 10 and lost.

1.  Ctrl-Alt-Del -> Open Task Manager

2.  File->Run New Task-> Regedit.exe

3.  Search for "vlp_auto_file".  Delete the keys you find and reboot.

 

Joe T.

Link to comment
Share on other sites

4 hours ago, Joe Tauser said:

If the output is on then you have a value >20 in MI 0.  Go online with the PLC and click on any of the instances of MI 0.  It will allow you to enter a value.  In hindsight, I should have set the powerup value to 0.  This can be done in the Operands tab by filling in the box with the little plug above it:

Wooo, it worked. You're a legend. Thank you very much Joe.

Odd thing, i had gone online with the plc a number of times, and the little blue numbers above the MI0 were all set to 620? It was like they were stuck there. I had no idea what those numbers meant at the time.

Once i'd ticked the small box next to the plug, the blue numbers reset to 0 and everything started working. It makes much more sense for the final equation ( >= )when you can see the numbers increment with each button push. 

Thanks again.  

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