LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Draw coordinates from csv to picture

Solved!
Go to solution

Hi there,

I'm quite new to Labview and done my first steps with tutorials.

Now I try to get coordinates from csv drawn to a picture. My Project runs without any error message but doesn't draw any points.

I assume I made a simple error but I'm not able to determine it.

Can someone have a look on it an may point me in the right direction or have a tutorial about this task?

 

Best regards,

Sebastian

 

Download All
0 Kudos
Message 1 of 4
(3,148 Views)

In the loop, you keep overwriting the picture with just a blank scene with the single pixel added from that loop iteration.

 

If you look at the draw point VI, it has picture in and picture out. You need to keep the 2D picture control reference in a shift register between loop iterations so you add each point to the same picture. then show the picture outside of the loop when all of the pixels have been added.

 

 

0 Kudos
Message 2 of 4
(3,099 Views)
Solution
Accepted by topic author Sebastian2k

Actually,


deceased wrote: You need to keep the 2D picture control reference in a shift register between loop iterations so you add each point to the same picture. then show the picture outside of the loop when all of the pixels have been added.

 


 

I don't think Draw Pont.vi accepts a refferrence of the picture.

Actually, you need to keep the output of draw point.vi in a shift-register and use it as input in the next iteration.

Furthermore you can set Read Delimiter Spreedsheet to integer instead of double, as the values in your .csv are integer values

Coersion to I16 and indexing column 1 and 2 can be done outside the For-Loop, and you should use auto-indexing to access the rows.

 

You can keep the 2d picture indicator inside or outside the For Loop,

see for yourself what's the difference between inside and outside.

 

2d-picture.png

 

 

 

 

Message 3 of 4
(3,089 Views)

Dear deceased and alexderjuengere thank you both for your answers.

 

The shift-register is exactly what I missied to use. I've rearranged my block diagramm and now it works.

I'll multiply the values by 100 to scale it up because the changes aren't very high and add 300 hundred to move the origin of the coordinates to the center of the 600*600 picture.

block_diagramm.jpg

 

@ alexderjuengere

Thanks for the hint with the data type.

Since my coordinates will contain floating point numbers I've changed the data type to double. By mistake I previously converted the numbers to int in the loop.

0 Kudos
Message 4 of 4
(3,072 Views)