LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programming Structures, what is best?

Solved!
Go to solution

I do not have easy access to LV 7.0 right now but I think the procedure was similar.  Select the control.  Then under the Edit menu look for Customize Control...  or something like that.  This will open a new window which looks like a VI front panel but does not have a block diagram.

 

Also look in the LV help for Customize Control or typedef or type definition.  

 

I did a job similar to yours a couple of years ago.  I bid the job as a fixed price contract  based on my estimate (and the customer's input) that it would take about 50-60 hours.  I made about 50 cents an hour for the time it actually took.  If I were to take on your project I would probably bid it as two or three phases.  The first phase would be to define the project.  This might include some reverse engineering of your existing code and would define the actions the program was to take for each control on the panel, a timing diagram, an understanding of error and fault conditions, ... In other words a test specification. Once everyone agreed to that, then I would decide how much time it would take to write the program.

 

The way I would get rid of the locals for the  buttons is the use of events and queues.  You have about 20 buttons on the panel.  That means about 20 more case in the event structure.  In each of the cases a command is put onto a queue.  The queue is read in the other loop (the cycling loop) and the command is processed there.  The boolean value typically only exists in the event case.  The command is a typedefed enum.  By using an enum, the case structure which interprets the commands will have the command text in the case selection label at the top -- self documenting!

 

Lynn 

Message 41 of 50
(1,754 Views)

In LV 7.1, Customize is located under Advanced...

 

Felix

Message 42 of 50
(1,743 Views)

can you guys help me with one more thing...

after going from B to C,

i noticed that I broke something and I can't seems to figure it out..i should be very simple..

 

Best regards,
Krispiekream
Download All
0 Kudos
Message 43 of 50
(1,730 Views)
 
Best regards,
Krispiekream
0 Kudos
Message 44 of 50
(1,728 Views)

ok..nevermind..i think i got it..

thanks everyone for all your help and advices..

i'll try to work on it some more..

 

Best regards,
Krispiekream
0 Kudos
Message 45 of 50
(1,718 Views)
A phased approach and a test document are indeed good ideas. At least from a
contractors point of view.

Regards,

Wiebe.


Message 46 of 50
(1,684 Views)

After the last view of your project, I need to repeat myself and others:

You keep all data in one big cluster. That just minimizes wire-mess, but not structures the data. So:

1) You can have clusters inside clusters.

2) You can have both Type Defed.

3) You can use the Sub-Clusters as Controls/Indicators on your Front Panel

4) On the FP, you can hide the Cluster borders using the Paint Tool (for the border, right!!!-click and toggle using the space button on your kexboard)

5) Using an event structure, you can also monitor the elements of your clusters

 

Once you're convinient with these nested structures, you can replace a lot of globals by controls in the main cluster.

 

To conclude: I think you're better off having your data structured by means of nested clusters....

 

Felix

Message 47 of 50
(1,650 Views)

i still haven't figured out how to do that Type Defed. 

can you give me an examples because i can't seem to get it right.

 

Best regards,
Krispiekream
0 Kudos
Message 48 of 50
(1,636 Views)

1.  Take a control that you want to turn into a typedef.

2.  On the front panel, right click,  Advanced, Customize.

3.  The control opens up in the control editor.  On the toolbar it will say "Control".  Select the Drop Down and pick "Type Def."

4.  Close the edited control.  Save it as a meaningful name.  I recommend putting the letters TD at the end of the name so you know it's a type def.  So it would be called MyClusterTD.ctl.

5.  Now wherever you also use that control or indicator, or constant, replace it with the saved copy of your control.

Message 49 of 50
(1,633 Views)
cool!!Thanks Ravens Fan!!!
Best regards,
Krispiekream
0 Kudos
Message 50 of 50
(1,605 Views)