View Full Version : Adding Inputs or Outputs to existsing VIs
paulcd2000
12-01-2009, 17:52
Hi, so i've been beating my head against the wall for a couple hours now. I need to add an input/output to an existing, preconstructed VI.
Specifics: i'm using the advanced framework, and i'm doing some processing in the Vision VI. i want to send two numbers to the Teleop VI. I've tried making variables, i've tried copy pasting other output/input things (the little blocks, like in the image), nothing works. Does anyone know how to do this?
Thanks in Advance.
You want to generate number sin Vision and then use them in Teleop?
If so, then just create a global variable, write to it in Vision and read from it in Teleop.
Step By Step:
1. From Block Diagram, right click, bring up Pallete, select the loops button
In the pallet you can select a GLOABL variable. Do it and drop it on the
Block diagram.
2. Double Click on that to bring up it's front panel. Drop what ever kind of control you want - you probably want a numeric of some kind. Save it
3. Now go click on the Global variable on the block diagram (to refresh the display)
4. Now you can write to that variable. Put it in your vision app and write to it.
5. Make a copy of it and drag or paste that into the teleop routine.
Right click and select "Change to Read"
Now you can read from that variable.
Bottom Line: Create a variable you can write to, then use that to create a version you can read from.
Let me know if you need more.
- Rick Folea
Atlanta Beta Team
paulcd2000
12-01-2009, 19:54
That was EXACTLY what i needed to know! thank you!
Of course, now i have another question :p
Is there any way to create case structures that are more than 1 or 0 ?
That is, can i make a case structure that takes an integer, does A if it's less than -10, B if it's greater than -10 and less than 10, and C if it's greater than 10? Thanks a lot!
Russ Beavis
12-01-2009, 21:35
Regarding adding inputs and outputs - if you right click on the icon for the VI in the upper right corner (typical from the front panel), you can select "edit connections" (if memory serves) and select a different node map. Then you simply click a node and then click on the input/output on the front panel. Click node then input/output and repeat until you're wired up. It's very simple once you understand that EVERYTHING (almost) is available via right-clicking. When in doubt - right-click. You'll be amazed at what you'll find.
Case structures can be controlled by almost any data type. My favorite is to use an enumerated type and let the case structure automatically assign cases to each value. I know that, when using a fixed point number to determine case, you can use ".." to denote a range (for example, "1..5" to refer to any value between 1 and 5, inclusive). I don't believe that this works for floating point numbers and I'm not sure that you can do this with > or <. You can certainly, however, use the boolean operators and "in range?" function to determine TRUE/FALSE or enumerated values to drive your case structure's input.
Russ
paulcd2000
12-01-2009, 21:47
Russ: that's great! thanks so much. i tried to right click stuff, but i never thought to right click that icon.
TotalChaos
12-01-2009, 21:51
Also, to add to outputs and inputs - and what Russ said - I have a tutorial written up on exactly that same topic. It's very straightforward, just how Russ described, but if you want something with a few visuals you can check out the tutorial HERE (http://www.polytechfusion.com/AddConnector.html).
Good luck!
- Austin
paulcd2000
12-01-2009, 22:13
That's a nice tutorial chaos! Thanks guys, i think that's everything!
Greg McKaskle
12-01-2009, 22:39
That is, can i make a case structure that takes an integer, does A if it's less than -10, B if it's greater than -10 and less than 10, and C if it's greater than 10?
Yes, but your instructions don't explain what to do with 10 and -10. I'll make some assumptions. First right click on the case and add another case. Then click on the text in the structure and edit it to something similar to ..-10, -9..9, and Default.
You can find details in the help, but the general rules are A..B for a range including A and B. Then there are lists with commas such as 1, 3, 5, 7.
Greg McKaskle
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.