01-28-2013 01:03 AM
So I already have a toggle switch built, works fine with a motor. (Latch Launcher in attachments)
But I'm having an issue with it, I can only currently hold the button to make the solenoid go forward, and then on release let it go reverse.
But I want to make it so that you just press a button once and the solenoids will go forward, then backward, not allowing the button to interfere during the process.
I have a latch gate put in, but I cannot "reset" the latch gate as it's latched boolean value goes to the case structure and sending a true from the second sequence nulls the wires.
One would think to use shift registers, but the process can't be interfered with, and it has to do two actions.
Here is what my code looks like:
01-28-2013 03:02 AM
Hi Arkacaro,
the cleanup button is not a friend of yours, isn't it? 😄
But I want to make it so that you just press a button once and the solenoids will go forward, then backward
Put another SetSolenoid function call into your case structure, now setting the solenoid to backward...
01-28-2013 03:41 AM
But how does the function decide when to reverse? Wouldn't it then execute both functions at the same time? Thus rendering it null?
This is what I got out of adding another SetSolenoid function:
Thank for the reponse 🙂 and no, me and the cleanup button don't associate anymore. Not after that project. ;D
01-28-2013 03:52 AM - edited 01-28-2013 03:54 AM
Hi Arkacaro,
for the block diagram shown in your post you definitely should apply cleanup, it could reduce BD size to about a quarter...
Well, I didn't suggest to delete the wait function between switching the solenoid forth and back! From your first post I suspected you need to switch forward, then wait a little amount of time and then switch backward. Isn't that what you want?
01-28-2013 04:10 AM
It actually is cleaned, just that I wasn't sure whether or not to have the orange latch gate there or not, and I didn't take out the other stuff so it didn't look like it was "just" for solenoids.
I actually tried that beforehand, which was originally what I thought would work, but case structures switch execution to whatever state depending on the input. So in order for all of that to function, you would have to hold down the launch button, and if you let go, you have to manually reset it or do the entire process over again.
I have a little latch node in there, that once it receives a true signal, makes the output true forever until a true to a reset on it is detected. Basically my idea is once you hit the trigger it does it's process without any sort of interruption and then resets the latch node so that you can run it again and the process starts over.
But as you can see in the image below, if you try to wire a "true" function to it from the same connections, the wire becomes invalid.
01-28-2013 04:22 AM - edited 01-28-2013 04:24 AM
Hi Arkano,
you can't have "loops" in your wires: the case structure is getting input and sending output to the same other structure (your latch) - that's not possible using dataflow paradigm! Use a shift register to send case structure output to the latch...
which was originally what I thought would work, but case structures switch execution to whatever state depending on the input
Yes, case structure reacts on selector input. But once you enter the case structure you will leave it only after processing all of the functions inside! So your switching process (forward, wait, backward, wait) will be executed - no matter how often you hit the button in between!
It actually is cleaned
I really doubt that! All those bent wires...
01-28-2013 04:29 AM
Oh, I have a organized version somewhere, just that I thought you meant "clean" as in get rid of redundant or uselessly hooked up stuff.
So if I were to wire a button to it the case structure with a sequence structure inside as is shown above, the moment I hit the button it will process everything inside of the sequence structures until it's finished? So it basically
latches itself until everything is done? If so, that pretty much solves everything, doesn't it?
01-28-2013 04:35 AM
01-28-2013 04:40 AM
when you set the button to "Latch..." mode: yes that pretty much will solve everything you asked for.
Set the button to "Latch..." mode? Previously as stated I can't make the dataflow loop, do you mean just have a normal button from a joystick to the ? condition terminal as how I have it on all the pictures?
As far as I know, buttons don't automatically latch, so i'm not quite sure what you're talking about if it's not that. 😛
01-28-2013 04:42 AM