Need an easy way to share a freebie

I have something I would like to share with all Ignition designers, but the module marketplace requires that you include all the financial and support information needed for something that is to be sold. I am unable to do that. What I have made is something I use frequently, and I believe some of you could use also. I am offering it for free, if I can find a way to do so.

While I was in training, Robert showed us how you can build a SQL table with the identical structure of a dataset in Ignition, and, optionally fill it in with the same data that is in the dataset. Then you can bind the dataset to a query of that SQL table. This allows you much more flexibility in programmatically changing the data in that dataset, which is reflected in your application.

For instance, the tab strip has an underlying dataset which determines how the tab strip looks. If you use the tab strip for your application’s main menu, you have to change the data in its dataset to change your main menu’s appearance. Doing this manually works, but suppose you want to show some tabs in the menu to only certain users when they log in, and not others. If you can control this tab strip’s dataset data programmatically, you can easily do this.

I remember very well how long it took Robert to copy the structure of a dataset into a SQL table, then type or copy all the data from the dataset into the table. I knew I was going to be doing this frequently, and I didn’t want to go through that long process each time. I also know that I am human and prone to making typos and such. So I built an app in C# to do all the work for me. I call it, for lack of a better name, DTSS, which stands for Dataset to SQL Server.

The way it works is you display the dataset you are interested in, then click on the button to copy to the clipboard. You then paste the clipboard into a text file and save it where you can easily find it. You start up DTSS, and in the window that opens you browse for the text file you just created. You then have the option to specify your new table’s name, whether or not to also insert the data from the dataset, and whether to build a MySQL or a MSSQL script.

It sounds much more complicated than it is in this explanation, but within a few seconds, you can have a MySQL or MSSQL script that will create a table, and optionally fill it with the data that was in the dataset in Ignition. Below is an example of the DTSS window in which I selected a text file called aTabStrip.txt, used the default table name of MyTable, elected to include the dataset’s data, and asked for a MSSQL type script to be generated. As you can see, the text file containing the script was built and saved on the C drive as MSSQLScript.txt. You simply copy the text in that file and paste it into a query in SQL. When executed, the table will be built and the data from the dataset will be inserted as records in the table.
[attachment=0]Capture.JPG[/attachment]

I am not allowed to set up an FTP server on my company’s network, so I have no way to share the msi file that installs DTSS on your PC. I also can’t email it, as our mail server will not send msi files, even if they are zipped. If IA had a place to submit things like this for others to download, I would gladly upload it for free. I can see a concern they may have with the possibility of someone uploading an infected file, or something like that. A simple virus check of the file should suffice, I would think, before they offer it up for download. I know I am not smart enough to infect something like this, but I suppose it could obtain an infection if my computer was infected.

I would be interested in knowing if any of you are interested in this app, and would like to know if IA has any ideas on how it could be distributed, if so. Ultimately, I think this would be a nice thing to have built into Ignition, and it would eliminate a lot of the copying and pasting to text files. It could simply spit out the SQL script to the clipboard, which could be copied and pasted into a SQL query. I will be glad to share the source code with the developers, if they want it, to help them code it in Java. If I had the time to learn Java and the SDK right now, I would build it myself as a module. But then again, where could I upload the free module?

Hi RRRancher,

I like this idea. I can totally see this as an Ignition Module where there is a new button in the designer that exports a selected dataset as a new database table to a database. Thanks for sharing the idea.

Cool!

But been the programer I am I have to ask, any reason you didn’t do it with jython as a script inside ignition? Then you could tie to a button. One-click table creation.

Robert, it is mainly because I wrote this back in March, when I was a newbie to Ignition, was not well versed in Python/Jython, and really didn’t think about doing it in Ignition. Anna from support brought it to my attention that doing it in Ignition would be a good idea, and I totally agree with you and her. I’m quite sure I could do it now, if I had more time. But I just got a new load of features to build into our production project, and as is always the case, they need them yesterday. :frowning: I will definitely look into that as soon as I can.

nmudge, your idea should work too, but it will be some time before I can get knowledgeable enough in Java and the SDK to be able to do that. If you have the ability and time to do so, by all means go for it. It won’t hurt my feelings at all.

Thanks for the posts.