Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   How do i find a variable and use it on Labview (http://www.chiefdelphi.com/forums/showthread.php?t=72447)

Booksy 20-01-2009 17:15

Re: How do i find a variable and use it on Labview
 
Quote:

Originally Posted by BLAQmx (Post 804560)
Every variable can be either read or written to.I n that sense there is only one variable but two states. This single variable may have multiple copies of readers and writers, but they are all reading and writing from the same place in memory.

Let me know if the screen shot I have attached helps at all.

I think you made a typo in your comments. The one says it has one writer and multiple readers, but it actually has one reader, and multiple writers.

Greg McKaskle 20-01-2009 21:22

Re: How do i find a variable and use it on Labview
 
You click on the ???s and choose from the list of controls. If you rename a control, the variable also gets renamed.

Greg McKaskle

BLAQmx 20-01-2009 23:37

Re: How do i find a variable and use it on Labview
 
Quote:

I think you made a typo in your comments. The one says it has one writer and multiple readers, but it actually has one reader, and multiple writers
I'll double check and repost the screenshot. Thanks!

Quote:

In your example you have variables with "X" and "Y" in them all i get are "?"s how did you rename the variable.
BLAQmx where do you find the boolean, string, and numeric all i can find are local, global, and shared and how do you name them.
Tutorial: Local Variable, Global Variable, and Race Conditions
See the section Implementing a Global Variable

There is also a video of there tutorial here.

Alan Anderson 21-01-2009 00:51

Re: How do i find a variable and use it on Labview
 
I'm not really sure why you want to use variables. You might be thinking too much in terms of procedural programming (like C or even BASIC) instead of treating LabVIEW as a dataflow programming method -- which it is.

In LabVIEW programs, wires are essentially the variables. They're what "hold" values as they move from where they're produced to where they're used.

dgraves702 21-01-2009 01:17

Re: How do i find a variable and use it on Labview
 
Quote:

Originally Posted by Alan Anderson (Post 804992)
I'm not really sure why you want to use variables. You might be thinking too much in terms of procedural programming (like C or even BASIC) instead of treating LabVIEW as a dataflow programming method -- which it is.

In LabVIEW programs, wires are essentially the variables. They're what "hold" values as they move from where they're produced to where they're used.

Exactly. All you need to do is wire the output from your Get Axis VI from the Joystick Palette to the Set Speed VI (or equivalent if you are using your Drive motors) from the Motors Palette. You don't need to use variables at all.

Russ Beavis 21-01-2009 07:30

Re: How do i find a variable and use it on Labview
 
Excellent point, Alan! Maybe Chris was getting too hung up on that concept.

In general, you should be able to do all of your programming without using global or local variables. Wires can go "everywhere" by simply wiring "through" structure boundaries or exploiting shift registers or sequence locals (look 'em up). Variables are only really necessary when

A) You want to clean up your block diagram since having wires everywhere can get out of hand.

or

B) You've got a set of parallel processes that need to share data (although I believe there may be a few other more advanced options that could be used). Processes WILL NOT run in parallel when they are wired together (since a wire cannot be read from until it is written to whereas variables can be read from at any time).

Another suggestion - check out Highlight Execution mode. It can be really handy for helping understand program flow and debugging.

Russ

Chris11246 21-01-2009 10:50

Re: How do i find a variable and use it on Labview
 
I was just trying to make a test vi that doesnt use the Crio but i couldnt make a value that could be used as the motor value that could be changed but still give me a value(i wanted to make it accelerate or decelerate and show the value of the motor) I can get what i want using the Crio stuff but I was just trying to figure out how to test it.

Jon236 21-01-2009 10:58

Re: How do i find a variable and use it on Labview
 
Simply create a control on the front panel to input your value.....then place an indicator to the output of your coding to show the result. Make sure to create a While loop to let it run.

blackdeath 21-01-2009 17:50

Re: How do i find a variable and use it on Labview
 
Just take the axis from the unbundle by name and hook it to the tank drive/arcade drive.vi input


All times are GMT -5. The time now is 08:59.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi