ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

For Loop To lines

Hi,
 
Help Plz
 
I do i use for loop in labview for the code given below
 
int is=5, y6fs=410;
 for(i=0;i<=79;i++) /*Draw Sensors [80 in no.] on the board for region*/
 {
         line(50,y6fs,100,y6fs);
  y6fs=y6fs-is;
 }
 
Thanks in advance.
0 Kudos
Message 1 of 5
(3,365 Views)
The for loop is easy but what does the 'lines' command do?
Message 2 of 5
(3,349 Views)

Hi

int is=5, y6fs=410;
 for(i=0;i<=79;i++) /*Draw Sensors [80 in no.] on the board for region*/
 {
         line(50,y6fs,100,y6fs);
  y6fs=y6fs-is;
 }
 
This is used to draw 80 horizontal lines vertically with the gap of 5mm. 
 
Thanks in advance.
0 Kudos
Message 3 of 5
(3,288 Views)
Hi sujeep,

where does this 'line' command come from? Is this some command for a plotter?
Where do you want to draw the lines? On the [computer] screen you may use a picture control... On other devices you should use some sort of driver!

Please provide more information.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 5
(3,274 Views)

Hi sujeep,

If you are just wanting to know the process of using the For Loop, you would just drop down a for loop and wire 79 into the N (number of iterations).  You would place your "line" code inside the for loop.  I agree with Gerd, we have no idea what this "line" code is supposed to do.

I suggest taking some time to get familiar with programming in LabVIEW before trying to directly translate C code into LabVIEW code.  Once you learn the basics, it should be fairly easy.

http://zone.ni.com/devzone/cda/tut/p/id/5243

Regards,

ClintM

National Instruments

0 Kudos
Message 5 of 5
(3,222 Views)