NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Storing and reading a variable

Hello. Apologies in advance for what probably is a trivial task, but I'm having problems grasping the concept of variables in the LabView environment.

I'm using Motion to track the steps that a motor has traversed. I have an inkjet that I want to apply a quick burst only once for a pixel (which I defined the size). The problem is that the motor has to travel at such a slow speed that the inkjet is over the pixel for a while. With my current code, it will keep firing while over the pixel. So I want to store the last pixel number that the printer fired on so I can perform a compare to ensure that the inkjet will only fire once the current pixel is greater than the last-fired pixel.

In a regular text-based coding environment, it's as easy as assigning a variable to store the pixel that the inkjet fired on, then constantly compare the current pixel location to that variable to know if it's still over the same pixel.

How do I extract this value and store it for later comparison?

Thank you and sorry again for a dumb question.
0 Kudos
Message 1 of 3
(3,073 Views)

Hi,

This should have been directed to the labVIEW forums here

http://forums.ni.com/ni/board?board.id=170

You can use a local variable which is basically a control/indicator on you front panel that you use in you diagram, you can hide or move the control off the visible part of the front panel, so its not visible to the user if the front panel is shown.  You can create a local by selecting the terminal of the control on your diagram, right mouse click, select create | local.

You can also use a global variable and you can do this from the palette, you one with the while loop / for loop / Case statement in.

I think there are some examples in the labview for using variables.

Hope this helps. Re-post this in the labview and some one is bound to come up with an example. Unfortuanately I'm not in a position to do so, otherwise I would have.

When you re post, quote what version of labview you are using.

Regards

Ray Farmer

 

Regards
Ray Farmer
0 Kudos
Message 2 of 3
(3,061 Views)
My apologies. Didn't realize it was posted into the wrong forum. Please ignore this thread.
0 Kudos
Message 3 of 3
(3,060 Views)