Need some help moving picture

Desing, arrangement, usability and everything associated with user interace
Ответить
caluctra
beginner
beginner
Сообщения: 14
Зарегистрирован: 24 мар 2009, 16:33
Версия LabVIEW: 8.2
Контактная информация:

Need some help moving picture

Сообщение caluctra »

hello...

I am trying to implement a small project using labview. the project is a line following robot that will be used as an electrical shopping cart seen on big supermarkets used to help customers that have walking problems (either obesity, age,...etc) to go around the store and do thier shopping without problems.

the low level programming will be done by one of my team's member. (will be: program the dspic, to have the robot follow a line, interpret the code sent by the user, execute it, and send a code back to the user) and I will try to implent the higher level programing (the user interface).

here I send a picture of what I am trying to accomplish. I also show one VI I made whith my previous idea of the interface, another VI (string auto complete) which I got from the repertory in the lava forum and I slightly modified.

--> my first problem would be to be able to have either a 2d or 3d picture representing the car in a map moving from one place to another. (Iam thinking as Iam writting to use the decoration VIs to drow the plane on the front panel. as a start
i have looked on the lava forum for some reference in the 2d or 3d picture that can be moved on a plane but due to a higher version I couldnt open it.
Вложения
1.JPG
STRING OUT COMPLETE001.vi
(24.98 КБ) 388 скачиваний
SENIOR II.vi
(506.45 КБ) 395 скачиваний
SENIOR II's global.vi
(4.03 КБ) 373 скачивания
Аватара пользователя
Eugen Graf

Activity Professionalism Silver Black
guru
guru
Сообщения: 6502
Зарегистрирован: 13 ноя 2007, 02:20
Награды: 4
Версия LabVIEW: 2009
Откуда: Saarbrücken
Контактная информация:

Re: need some help

Сообщение Eugen Graf »

Hi!

I think it's a very interesting project you have.
The simpliest way to show a moving car in a supermarket is i think:

you make a backgrond picture, which represents the supermarket as you shown
you make a car picture

Than you can move one picture over the other using control position property. You can creaty this property rightclicking on the control->Create->Property Node->Position. So easy set the right X and Y coordinates and your picture (car) will move.

Regards, eg
Вложения
MovePicture.png
MovePicture.png (1.22 КБ) 15990 просмотров
caluctra
beginner
beginner
Сообщения: 14
Зарегистрирован: 24 мар 2009, 16:33
Версия LabVIEW: 8.2
Контактная информация:

Re: Need some help moving picture

Сообщение caluctra »

first thanks for responding to my post.

---> COuld I get a picture already drown with the desired map? also I dew a map my self with the aid of the decorations on the front pannel and here i have a picture so that you can evaluate it.

my question(s) would be:
--> on the boundle that you wired to the property node of the picture, how do i know the dimentions so that the picture of the car (which will be on top of the other) moves to the desired path? do i need to have in count the dimentions of the screen?
Вложения
2.JPG
Аватара пользователя
Eugen Graf

Activity Professionalism Silver Black
guru
guru
Сообщения: 6502
Зарегистрирован: 13 ноя 2007, 02:20
Награды: 4
Версия LabVIEW: 2009
Откуда: Saarbrücken
Контактная информация:

Re: Need some help moving picture

Сообщение Eugen Graf »

You don't need to draw your map using :labview: decorations, but of course you can. In really you can take any nice pricture or a photo, it will look better, I think. More, you can load your picture to the front panel dynamically. So if the user selects (or your car moves to) e.g. one room, you can change the background. You need only a picture indicator for that.

Coordinates:
if you connect the 0,0 coordinates to the car picture position, than your car will move to the 0,0 point of the front panel of your VI. The coordinates are in pixels! So if you connect 10,20, your car picture will move 10 pixels to the right and 20 pixels to the bottom of the front panel.

Now if you want to move your car relatively to the backgrond picture, you have to ask the position property of the background picture and always add these to the coordinates related to the front panel coordinates (it names offset).

There more you can ask (or you already know them) the size in pixels of the backgrond picture. Than you will know where the coordinate of the bottom right corner is.
Аватара пользователя
Eugen Graf

Activity Professionalism Silver Black
guru
guru
Сообщения: 6502
Зарегистрирован: 13 ноя 2007, 02:20
Награды: 4
Версия LabVIEW: 2009
Откуда: Saarbrücken
Контактная информация:

Re: Need some help moving picture

Сообщение Eugen Graf »

Here you have an example
Вложения
MovingCar.vi
LV 8.2
(184.93 КБ) 548 скачиваний
caluctra
beginner
beginner
Сообщения: 14
Зарегистрирован: 24 мар 2009, 16:33
Версия LabVIEW: 8.2
Контактная информация:

Re: Need some help moving picture

Сообщение caluctra »

3.PNG
4.PNG
Once more I thank you for your help. please do take a look at the pictures am sending
Аватара пользователя
Eugen Graf

Activity Professionalism Silver Black
guru
guru
Сообщения: 6502
Зарегистрирован: 13 ноя 2007, 02:20
Награды: 4
Версия LabVIEW: 2009
Откуда: Saarbrücken
Контактная информация:

Re: Need some help moving picture

Сообщение Eugen Graf »

Hi, the block diagramm of my VI was others, see attached picture.
I only crated picture constants, so I don't need upload JPEG files to forum. I implemented (saved) them as constants in the VI.
Вложения
ReadJPEG.png
caluctra
beginner
beginner
Сообщения: 14
Зарегистрирован: 24 мар 2009, 16:33
Версия LabVIEW: 8.2
Контактная информация:

Re: Need some help moving picture

Сообщение caluctra »

HI,

I will start with a couple of simple questions:

--> when I go to the decoration pallet and I grab (say a triangle) with the objective of putting a control (ex: a boolian) on top i run to the poblem that it doesnt maintain on top, it stays underneeth the decoration shape.
do i need to alter one of the parameters of that control in order for it to be on top of the decoration?

--> One of the previous VI i posted is a dynamic VI (string autocomplete001). now, I am able to call it's front pannel with no problem. After the front pannel is called the user must type a word on a string control, and then press enter. when the enter button is pushed (by the user) the front pannel closes.
What I did was to put a global string on that dinamic VI that would get the desired word (type by the user) and then as soon as the dinamic VI fp would close it would send the string back to the main VI.
Now, what is happening is that the global wont send the string right away back to the main, I believe that the dinamic VI is still run memory or something like that becasue in other to have the global send the string back to the main I need to reset the program and re-open the dinamic VI.
Is there a way around to it? my objective is that as soon as the user types the word or interest and prest enter, the dinamic VI fb closes, and that word inmediately is sent back to the main VI.
please do take a look at the three VIs I sent you previously.

regards.
Pedro E.
Аватара пользователя
Eugen Graf

Activity Professionalism Silver Black
guru
guru
Сообщения: 6502
Зарегистрирован: 13 ноя 2007, 02:20
Награды: 4
Версия LabVIEW: 2009
Откуда: Saarbrücken
Контактная информация:

Re: Need some help moving picture

Сообщение Eugen Graf »

->> do you want to make a custom button with icon? If, not, you can change the "layer" position of controls and decorations by toolbar->Reorder->Move To Front. If you want to make a custom button or other control, so right click on it and select Advanced->Customize...

->> I don't understand why you call this VI dynamically? Why you need to call it dynamically? You can take an easy dialog VI and call statically. Can you explain that?
caluctra
beginner
beginner
Сообщения: 14
Зарегистрирован: 24 мар 2009, 16:33
Версия LabVIEW: 8.2
Контактная информация:

Re: Need some help moving picture

Сообщение caluctra »

thanks again eg.

well i found it more elegant to have the front panel pup-up when needed. Also on another aplication I was developing I ran into a similar problem and could not figure it out. I will defenitly try the option you just gave me.

but i would like to know if there is programatically a way of doing what I was trying to achieve with the dinamic VI, (I already tried with globals and no luck there)

regards.
Pedro E.
Аватара пользователя
Eugen Graf

Activity Professionalism Silver Black
guru
guru
Сообщения: 6502
Зарегистрирован: 13 ноя 2007, 02:20
Награды: 4
Версия LabVIEW: 2009
Откуда: Saarbrücken
Контактная информация:

Re: Need some help moving picture

Сообщение Eugen Graf »

To call a Dialog VI is the right way. The other problem may be if you call a Dialog VI than, your Main VI will hang up before Dialog VI will be closed by user. But it's an another problem.
caluctra
beginner
beginner
Сообщения: 14
Зарегистрирован: 24 мар 2009, 16:33
Версия LabVIEW: 8.2
Контактная информация:

Re: Need some help moving picture

Сообщение caluctra »

I know a dialog VI would be relatively simpler, but what about if the user only remembers the first letter of the product that he/she wants to buy, (that is why am not constraining the choices, I am using a string autocomplete which in case the user doesnt know the exact product's name he/she can input the 1st letter and the program can provide him/her with the different options.

The problem I am seen is that when you have the fb closed it doesnt close completly some parts of it I believe are still active in memory, that is why the global string doesnt give the word back to the main VI until the program is ran again.

I have been struggling with this for sometime now.

regards
Pedro E.
Аватара пользователя
Eugen Graf

Activity Professionalism Silver Black
guru
guru
Сообщения: 6502
Зарегистрирован: 13 ноя 2007, 02:20
Награды: 4
Версия LabVIEW: 2009
Откуда: Saarbrücken
Контактная информация:

Re: Need some help moving picture

Сообщение Eugen Graf »

As I understood, you don't know how to make a Dialog from a SubVI. If it's so, go into the VI Settings and set the Window Appearance from Default to Dialog. You can use your VI further on, but now as a Dialog.
caluctra
beginner
beginner
Сообщения: 14
Зарегистрирован: 24 мар 2009, 16:33
Версия LabVIEW: 8.2
Контактная информация:

Re: Need some help moving picture

Сообщение caluctra »

hello again eg.

I have a situation and I would like you to give me feedback.

Am planning on communicate the robot with the computer using 2 Digi XStream PKG-R 2.4GHZ 232/485 RADIO MODEM,
a picture can be seen here : https://www.buytech.com/p-761149-digi-x ... modem.aspx

I was able to succesfull stablish a communication between modems by connecting each one of them to a different computer and communicating them via hyper terminal.
I know labview has the VISA VI's that are used to read/write (among other things) serial ports RS232. and there are also several examples of visa (read/write).
My question is; Could I send a srting from computer#1 (which has labview installed) and 1 of the modems connected to computer#2 which does not have labview install but does have hypper terminal and the 2nd modem connected to it.?
Also, the other way around (sending a word from computer#2 using terminal command) and reading it on computer#1 using labview.
this are some test I would like to try out, to get more confortable.

regards.
Аватара пользователя
Eugen Graf

Activity Professionalism Silver Black
guru
guru
Сообщения: 6502
Зарегистрирован: 13 ноя 2007, 02:20
Награды: 4
Версия LabVIEW: 2009
Откуда: Saarbrücken
Контактная информация:

Re: Need some help moving picture

Сообщение Eugen Graf »

Hi, of course you can, the first thing I would suggest is to take my Easy RS232 Terminal, programmed in :labview: , connect them to one modem. Than take an other hyperterminal on other PC and connect to the second modem. Than to try to get communication between them both.
But it's an other topic, so please start a new one.

eg
Ответить

Вернуться в «Front panel»