02-13-2015 07:01 AM
Yes I got that! I understood that everything that comes after SP are plot coordinates and in my case i have five SP matches so I am creating a parser for the strings between SP. Once again, my issue is how to convert from plot position to "pixels" for my image.. I am using the parser here as inspiration, but once i have the array with the plot positions i don't know what to do.... thanks again for your help!
02-13-2015 07:06 AM
02-13-2015 07:20 AM
Thanks, i got that.. as i wrote i parsed 5 strings separated by SP where i have the points where plotter is supposed to draw. For example
SP2;;PU;PA0,0;PA244 ,136 ;PD;PA244 ,136 ;PA244 ,136 ;PA260 ,136 ;PA276 ,136 ;PA292 ,206 ;PA308 ,264 ;PA324 ,318 ;PA340 ,242 ;PA356 ,136 ;PA372 ,254
PA(Plot Absolute)
Pen is moved to position of absolute coordinate (x, y).
PA x,y(,x,y...);
what i don't get is how to convert those "coordinates" to pixels....
02-13-2015 07:26 AM
what i don't get is how to convert those "coordinates" to pixels....
That's why you need commands IP and SC.
With those commands you can scale to any sheet of paper you like to!
It's similar to PDF format: you scale to an arbitrary position. This position is then converted to real pixels depending on your desired output format. (A greater sheet of paper might use more pixels than a smaller sheet!)
02-13-2015 07:29 AM
now I'm starting to feel ignorant or stupid 😄
IP250,279,10250,7479;
SC0 ,4388 ,0 ,4212
that's what I parsed.. then I have the array of coordinates.. which VI should I use to convert this to pixels? do you know something that i can use as an example to do this?!
02-13-2015 07:37 AM
Hi cassaniti,
you make your own "sheet of paper" using your own coordinates.
For this you scale the coordinates of your HPGL file to your pixel coordinations.
When you define your image as 1000×1000 pixels you need to scale the range [250, 279, 10250, 7479] (given by IP command) to your pixels [0, 0, 999, 999]…
02-13-2015 07:58 AM
should i use this function http://zone.ni.com/reference/en-XX/help/371361H-01/lvpict/draw_point/ in a shift register with my x-y scaled coordinates? Or is it a stupid idea?!
02-13-2015 08:00 AM
02-13-2015 08:12 AM
interesting i'm starting to understand 😉 i will post my results (and hopefully a VI that the other people can eventually "recycle" )
02-13-2015 10:01 AM
as you can see from the attached screenshot, i've made some steps forward, but i'm having a weird issue: the origin of the labview image is on the top-left, while the coordinates i get are originated on the bottom left.. is there a way to change the origin of the image coordinates on labview? thanks