LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating and using variables in LabView

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. I'm a bit of a loss trying to accomplish the same task using the graphical coding of LabView.

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 2
(2,667 Views)

I assume that you are doing this firing of inkjet at a particular pixel, using a loop ( more appropriately, while loop)

One way to achieve this would be to use shift registers and case structure

Insert a shift register for that loop

initialize a pixel value (numeric) to that shift register

On every iteration, perform comparison for 'greater than' with current pixel value/position  to value/position stored in shift register

If the result of this comparison is true, use a case structur. In true case of case structure , fire your inkjet at that particular pixel and update your shift register to replace and store the current value

If the result of comparison was false, do not perform any operation, just pass the shift register through false case without any modification

A labVIEW code built on these lines would work fine for your application

Showing a code snippet would have been a simpler and effective  way to explain this. but currently no LabVIEW installed on my system Smiley Sad

 

 

0 Kudos
Message 2 of 2
(2,657 Views)