LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

3 Questions regarding Ports, Buttons, and Front Panels.

There are three things I am having trouble with. If you can help then please
do before I go crazy.

1) I'm sending data across networks using the function that opens TCP's.
Whenever I stop the program and run it again, I have to make sure I change
the port.

Is there anyway to make the port number increase by 1 if I stop the vi. and
then immediately run it again?

for example if I have 8001 set as the default port is there anyway to have
it increase to 8002 when I stop the vi and restart it? And then to 8003 and
so on?

2) when I view my front panel on different monitors some of the buttons
move, shrink, or grow. I am using the boolean text on the button so i can't
figure out why they are doing th
is. I have pictures of what I'm talking
about if that will help.

3) I would like the control front panel to fill the entire monitor
regardless of what size monitor and what resolution... is there a way to do
this?
0 Kudos
Message 1 of 6
(2,962 Views)
With regard to item #3: search in the ni site for 'lvwutil32.zip': inside this library you will find 'Maximize Window.vi' that permits you to have your vi's window fill up the entire screen.
For item #2: have you tried to close the tcp connection before ending the vi? I have used TCP in a CVI program of mine and have had no problems closing the connection and reopening it in a few seconds with the same number.

Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 6
(2,962 Views)
Roberto Bozzolo a écrit :

> With regard to item #3: search in the ni site for 'lvwutil32.zip':
> inside this library you will find 'Maximize Window.vi' that permits
> you to have your vi's window fill up the entire screen.

There is an VI execution option that enables automatic fit to screen (double
clic on the module icon on front panel) - o
0 Kudos
Message 4 of 6
(2,962 Views)
1- If you don't need to make an executable from your vi, just add 1 to the port number when exiting, use a local variable to pass data to the port number control and make current value default using vi server. If you need an executable, make the port number load from a file, and change this when exiting.
2- Had the same problem, and putting controls without resizing them (standard sizes) helped.
3- You can check the monitor height and lenght using windows API calls in lvutil32 and change control size and positions depending it.
Hope this helps
0 Kudos
Message 3 of 6
(2,962 Views)
> 1) I'm sending data across networks using the function that opens TCP's.
> Whenever I stop the program and run it again, I have to make sure I change
> the port.
>

Use an uninitialized shift register -- no wire to the outside left.
Before leaving the loop, increment the value from the left shift
register and write to the right shift register. Another option is to
use a local variable to read from a control and write back to it before
the VI completes. Same idea, but a different implementation.

> 2) when I view my front panel on different monitors some of the buttons
> move, shrink, or grow. I am using the boolean text on the button so i can't
> figure out why they are doing this. I have pictures of what I'm talking
> about if that will help.
>

This is usual
ly due to different fonts being installed on the different
computers. Another way this happens is that one computer is using Large
Fonts and the other Small Fonts. These are really different fonts.

> 3) I would like the control front panel to fill the entire monitor
> regardless of what size monitor and what resolution... is there a way to do
> this?

Use the VI Properties dialog. The Window Size will let you make the
panel extend to fill the screen. The Window Appearance page will let
you choose what window options are visible. You will probably want
custom where you can hide things you don't want to be visible.

Greg McKaskle
0 Kudos
Message 5 of 6
(2,962 Views)
Thanks everyone.

I will try and see what works best.

"Greg McKaskle" wrote in message
news:3B09CCAB.734D57D4@austin.rr.com...
1) I'm sending data across networks using the function that opens TCP's.
Whenever I stop the program and run it again, I have to make sure I change
the port.
> >
>
0 Kudos
Message 6 of 6
(2,962 Views)