LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with structures

Hi,

First of all sorry for my English.

 

I think that my Vi doesn't work because the use of structures.

 

I've made a Tab Control with 3 pages, related to a case structure with 3 cases,  and I want to execute 3 programs y each case. One case to acquire data and  write to Measurement File. Other to Read from measurement file. And the last to send a file by TCP. Each case work separeted, but I can't make to works all in one Vi. Each program have to work only when the page is selected. If the program reset when you select a new page, I think it willl be better.

 

Any idea to Help me??

0 Kudos
Message 1 of 4
(2,103 Views)

Just a brief review of your code:

 

Bad: Your loop is consuming 100% CPU resources.Place a 50ms wait in the outer loop.

 

Other basic improvements:

Use an enum instead of the ring -> the case structure will display the enum text instead of a number.

Error handling -> just get the error wires running all through and place an error handler at the end.

 

Topics to study: Event structure. Then state machines.

 

Felix

Message 2 of 4
(2,075 Views)

Thanks, I will review

 

0 Kudos
Message 3 of 4
(2,061 Views)

Some more points:

 

  • Don't tie a case structure to a tab/ring combo. Simply run all three codes in parallel and use the tab structure to logically organize the front panel elements only. The code should not care what tab is currently visible.
  • To send a file via TCP, you typically dont start with "TCP listen". Thats for when you wait for incoming connections as a server. Are you really sure this works as you said? You don't even specify a destination!!!
Message 4 of 4
(2,057 Views)