From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem Idea Exchange

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

Programmatically Extract Scripts from SUD Files for Version Control

Status: Declined

Hello

Thank you for your request. We understand your suggestion but given the age of this entry and the fact that just a few sponsors are supporting it, we have decided to decline this suggestion and prefer to develop more frequently requested features instead. We hope you understand this. 

Greetings

Walter

We use scripts extensively to automate many tasks in a consistent manner, so we back these scripts up in a version control system to track changes and revert back to a know version if issues arise.

 

However, because we also use Diadem dialogs we need to create SUD files to house not only the menus but also the scripts that can be built into them. These SUD files are binary in nature and cannot be compared in the version control system, which is primarily a text based tool, and because the fileformat is unknown any differences at the binary level are not easily understood.

 

My idea is to have a tool that can parse a SUD file to extract the script associated with each dialog and export that script to a VBS file in a programmatic manner, such that multiple VBS files can be created quickly instead of having to open each SUD file and its many dialogs and then capturing the scripts. The benefit this brings is that there will now be the ability to track script differences in any text diff tool of your choice, it would not address any changes of a graphical nature within the SUD file, but that is not the motivation for this idea.

8 Comments
Daniel-E
Active Participant

Additionally, it would be very useful if we could access the SUD dialog in an object-oriented manner similar to other functions in DIAdem. In this manner, a programmer could write code to open the SUD file and extract the contents as objects in a DIAdem script.

tschoen
Member

We are facing a similar issue, we have many users working on the same sud file concurrently and would like to merge changes, are there any sud file compare/merge tools available? Can we access and control the dialog elements from an external .vbs script somehow?

dietfons
Member
 
Walter_Rick
NI Employee (retired)
Status changed to: Declined

Hello

Thank you for your request. We understand your suggestion but given the age of this entry and the fact that just a few sponsors are supporting it, we have decided to decline this suggestion and prefer to develop more frequently requested features instead. We hope you understand this. 

Greetings

Walter

ADobson
Member

Diadem 2018 now has the capability to search for obsolete commands in scripts within SUD files, this option did not exist previously in earlier versions.

Does this now mean that there is provision to programmatically read out the script and check against certain functions, like this does in the obsolete command example?

 

The code within the example calls an encrypted file to do all the heavy lifting, if this was made available unencrypted then maybe I could see if my idea is viable?

meatballosaurus
Member

This is something that I'd be interested in as well.

 

ADobson - Would you mind telling me what version control system you are using? I'm looking at doing something similar at my company.

ADobson
Member

We use Perforce for storing the scripts, I think there may be a free version but it might be limited to non-commericial use.

We don't have it integrated into Diadem for saving or retrieving the scripts we version control, we do that with the P4V client program.

There are hooks into the version control system when using LabVIEW but that is not relevant to this topic.

JuliaDawkins
Member

What I have recently found is you CAN extract the entire VBS code inside a SUD dialog and just "include" this VBS script in your actual SUD dialog code. The big downside to this solution is loss of code completion, but it's been worth it for me to have version control changes visible.