LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
LeifS

Compare statechart revisions

Status: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.

It seems that LV Compare doesn't work with Statecharts (.lvsc files)

It's important for maintaining code quality to be able to use Diff (and why not merge) functionality also for statecharts.

 

I realize that this is more complex than comparing simple VIs, but I'm sure the great programmers at NI will figure out a way to create and present such compare results.

5 Comments
AristosQueue (NI)
NI Employee (retired)

LV Compare does not work with any of LabVIEW's text files. We assumed that text diffing was already something most people had capacity for. We have since realized that there are some difficulties with this approach for LV classes, but for .lvsc, .lvlib, .lvproj and .xctl files, text diffing and merging should work cleanly, although sometimes confusingly.

 

To be clear: I don't want you to think we haven't considered improving the compare experience. We have. We just thought initially that the textual diff/merge was sufficient. In the years since, we have realized that there are more difficulties than we anticipated. It's one of those long-burn research projects to come up with a graphical diff/merge that works for files that are essentially hierarchies of things and are not amenable to direct diagramatic comparison the way VIs and controls are.

LeifS
Member

@AristisQueue wrote:
... but for .lvsc, .lvlib, .lvproj and .xctl files, text diffing and merging should work cleanly, although sometimes confusingly...

Well, now I'm confused. If I view a .lvsc file (LV 2012) in Notepad++ I see:

 

Capture.PNG

 

This doesn't look like something that I could diff "cleanly", does it?  Smiley Tongue

AristosQueue (NI)
NI Employee (retired)

I did say confusingly, yes?

The files have XML formatting. As long as you pick one entire block of XML from one of the two files, you're fine. No, there is no way to merge otherwise.  That was the theory... the limitations turn out to be too limiting in practice.

aggieNick02
Member

.lvsc files are not actually xml. They are, at the core, a special kind of LLB, and inside the LLB is an xml file that manages the contents of the lvsc file. Unfortunately there is not really a good diff available at the moment.

 

One option you can consider is to generate documentation for your statechart. This will create a set of files that can be viewed in a web browser and list lots of details about the statechart and its states/configurations. You could then consider using diffing tools with these files to try to see what is different. The set of files is basically an xml file that contains configuration information and a bunch of images that all get rendered in the web browser.

 

More information on this feature is here:

http://www.ni.com/white-paper/9316/en/

Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.