LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tab enum strict lock

Solved!
Go to solution

Hello,

 

I have two questions/problems.

The attachment is a very simple and limited version of the program I'm making.

So removing or changing functionality is not possible or should take weeks.

 

The program is based on FSM with Enum as Strict type control, event-case structure for event handling and finishing.

Showing/Hiding settings, indicators, screens is mostly done by Tabs, in some cases aditionally with enable/grayed out. 

 

To give you an idea: The real program has 100+ Buttons, a load of indicators and some displays,

9 Rs232 communications to temp controllers and PLC, nozzles, TCP communication with a servo and cameras,

.net methods functionality for the cameras, and works with 10+ csv files for settings, log and initialisations.

 

1) In the second program, main2, I clicked on "Tab Control 3", and locked it.

Now it's impossible to unlock it !

First also locking the bigger Tab "Tab Control 1" doesn't help...

 

2) Situation: The machine is working, with some previous version of the big program. The program can't be run on another (developing) PC,

Making this possible would make me to simulate all the controllers, Modbus signal states, com and .net... so would complicate it too much.

Problem: They asked to make a very big addition, so I made a separate program of only this addition with his own enum/event/case (40 steps/case-pages/events)

Merging both programs is impossible, the events aren't compatible. Even not with both event structures in separate cases, with timeout etc...

How is it possible to merge both programs?  So that te strict type def containt the states of both, the event structure contains all events, the case contains all. Please don't say to drag and drop. As I don't like local variables, most process variables are wired between all loops.

 

 

 

Tip: Don't use "Use default if unwired" in cases, when that default passes the wire.

It will pass data from the previous time that the default page was run, maybe days before.

Sounds normal, but isn't intiutive.

 

.

0 Kudos
Message 1 of 10
(4,313 Views)
Solution
Accepted by ST5

You can solve 1) by simply selecting the whole Tab Control 3 on the frontpanel. This means:

a) Make sure that Tab Control 3 is visible on the frontpanel.

b) Press the left mouse button right next to the bottom right corner of Tab Control 3 (so within Tab 2 of Tab Control 1).

c) While having the left mouse button pressed, move the mouse pointer to the top left corner of the Tab Control 3 (make sure that the dotted rectangle is right around, not inside, of Tab Control 3) 

d) Release the mouse button. Now Tab Control 3 should be selected.

e) Unlock Tab Control 3 by selecting Reorder >> Unlock

 

It is currently imho not possible to give hints for issue 2). The problem is that we do not know anything about the events you want to react on or if there are race conditions between both parts of the software.

It could be possible to include the whole part 2 of the software within a subpanel. But this is just a guess.....

 

Merging softwareparts is never easy if there is no dedicated interface or the parts can be transferred into the original architecture (which would be copy&paste or drag'n'drop......).

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 10
(4,287 Views)

Hello,

 

Regarding the second problem: 

Can you give some more information about the differences between the addition program and the original program?

 

For example:

Does the addition program have to run in parallel with the original? Or does it solely exist out of extra cases that were not included in the original?

 

Can you post some screenshots (or the vi's) so that we can get an idea about where the major problems are situated?

 

Message Edited by ThiCop on 01-14-2010 10:04 AM
Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 3 of 10
(4,267 Views)

Thanks Norbert, it only was a problem getting it selected. It works and the Kudo is sent.

 

ThiCop, in attachment you can find a Zip with 2 programs I want to merge.

Finally, I have 1 program, a result of a merge of the existing (and running) program and the new one.

 

1 is the main program, already working

2 is the subprogram, I want to put into, developed on anther PC.

I put more explication into the blockdiagram about how & why.

 

In the ideal world, it would be possible to:

-Merge both enum typedefs (putting all states of both in one). There are no duplicate states.

-Merge the events, because 2 event structures in one program (sometimes) doesn't work and blocks.

-As addition, merging the cases would also be possible. This is less important because I can put them side-by side.

 

Also a big problem is that, besides the one typedef enum indicator, I have many (100+) typedef constants.

It is possible to disconnect such a constant from the typedef, but how to reconnect to another (new or expanded) typedef?

Now I have to delete it, then create -> constant and choose the state. (100's of times)

 

 

Message Edited by ST5 on 01-15-2010 03:50 AM
0 Kudos
Message 4 of 10
(4,239 Views)

Hello again,

 

I've looked at your example VI's and i would advice you to do the following:

 

1) Choose the main VI (call it main1) with the most use of the type defs as starting point for your new (complete) main VI (let's call it maintotal for easy reference). Let's call the other VI (with the least use of the type defs) main2

2) Now you're in maintotal open your type def for the states and add the states from main2 manually.

3) Now right-click on the border of your case  structure (for your FSM states) and click "add case for every value"

4) Now you should get several new empty cases to which you should copy-paste the missing cases from main2.

5) Finally replace all new typedefs (from the new cases from main 2) by typedefs from the type used in maintotal.

 

At this point all your type defs for your FSM are ok, but you'll still have a problem with the tab controls.

 

For your tab controls you should add all your events to handle from main2 manually to maintotal and also the contents of those event cases themselves.

 

There might be other makeshift solutions, but doing it this way is probably the easiest way to ensure that your code can be simply "updated" in the future.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 5 of 10
(4,229 Views)

Thierry, what you advise was my starting point.

 

2) Manually add states is the thing I wanted to avoid.

4) Copy paste all the contents is another thing I wanted to avoid.

 

Believe me, I doesn't make you happy for 100+cases, with their new (to replace) buttons, wires,...

 

So there's no possible way to merge typedef enums and cases.

So 2-person development is limited to programs who don'use this.

 

Thanks for the replies.

 

0 Kudos
Message 6 of 10
(4,200 Views)

ST5 wrote:
[...]So there's no possible way to merge typedef enums and cases.[...]

 


I never tried this one, so i just assume that you did and it didn't work.

Nevertheless, following the strict (theoretical) guides of software engineering, this issue may never occur: You have to define the content of each type before starting to code.

So merging two type definitions with different content must not occur. If it does, you most probably have to do it manually.

Regarding the cases, i can give you a little information you possibly do not know:

If you have a typified enum as "case datatype", you can right click on the case selector and select "Add Case for Every Value". You will get empty cases for each option of your enum which previously did not have a case.

I concur that using this does not solve the issue completly since you have to fill those empty cases on your own....

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 7 of 10
(4,190 Views)

-------------------------------------------------------------------------

Norbert B Wrote:

You have to define the content of each type before starting to code.

-------------------------------------------------------------------------

 

Right. In a multi-programmer, distributed control development, that's done at the architecture fase/level.

The software project coordinator keeps an eye on this.

 

In my real world, none of these exist, and the existance, properties and advantages are unknown.

There's only the repeatedly appearing question: Does "it" already work?

 

.

0 Kudos
Message 8 of 10
(4,120 Views)

ST5 wrote:

In the ideal world, it would be possible to:

-Merge both enum typedefs (putting all states of both in one). There are no duplicate states.

-Merge the events, because 2 event structures in one program (sometimes) doesn't work and blocks.

-As addition, merging the cases would also be possible. This is less important because I can put them side-by side.

 

Also a big problem is that, besides the one typedef enum indicator, I have many (100+) typedef constants.

It is possible to disconnect such a constant from the typedef, but how to reconnect to another (new or expanded) typedef?

Now I have to delete it, then create -> constant and choose the state. (100's of times)

Message Edited by ST5 on 01-15-2010 03:50 AM


For Enum and Cases i cant think of any way except drag'n'drop between the structures.

 

As for the constants, they should also be typedef'd, and as such should be updated automatically if you expand the typedef.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 9 of 10
(4,110 Views)

------------------------------------------------------------------------------------------------------------------------------------

Yamaede wrote:

As for the constants, they should also be typedef'd, and as such should be updated automatically if you expand the typedef.

------------------------------------------------------------------------------------------------------------------------------------

 

The constants are typedef in both programs.

 

When merging to a new Program with a new or expanded typedef, all constant typedefs of at least 1 of the programs must be manually replaced by the other typedef.

 

I didn't find "connect to other typedef"

 

.

0 Kudos
Message 10 of 10
(4,078 Views)