• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Best programming language for this task?

brxndxn

Diamond Member
I'm thinking that either PERL or VBscript would be the best (easiest) for this:

I use Wonderware at work a lot - and it's tedius. Basically, it's industrial HMI software that shows active graphics on a touchscreen that represents industrial processes that can be controlled.. Something as simple as a valve has integers, discrete values, alarms, etc..

But, every 'tag' is based off of one single string, such as 'Valve555255'..

I want to create a program that allows you to type in Valve names, motor names, loop names, etc... and create according database entries that fit the wonderware format (csv).

So.. I would type in Valve555255 and it would automatically create something like:

Valve555255_Coil
Valve555255_FeedbackOn
Valve555255_FeedbackOff
Valve555255_MaintenanceNumber
Valve555255_State
etc...


It can almost be done in Excel using the Concatenate function - except the database entries need to be put under corresponding headings..


So.. is Perl my best bet?
 
I would go with Perl if you already have it installed on your Windows system or if you're working on a *nix system. If not, just use VBscript or whatever the hell the Windows scripting language is called.
 
anything would do really. though a scripting language will probably be better for simple tasks like this. Which one to choose really depends on your work environment and personal preference. Does your workplace or industry use Perl a lot? If so go with it. Personally I'd use something like Ruby because I like its syntax a lot better compared to Perl (cleaner and translates better into other modern languages).
 
It's pretty trivial in SQL as well. Looks like you have component types, and they have related records that determine the interfaces, and you have instances of the component types that have names like Valve_555255. So at runtime you join the type table, the instances table, and the interfaces table, and concatenate the name of each interface with the name of its owning instance.
 
Originally posted by: Markbnj
It's pretty trivial in SQL as well. Looks like you have component types, and they have related records that determine the interfaces, and you have instances of the component types that have names like Valve_555255. So at runtime you join the type table, the instances table, and the interfaces table, and concatenate the name of each interface with the name of its owning instance.

Good point with the SQL. I would consider doing it in Access. You could even make it simpler by having tables for valves, motors, loops or whatever. You just say i want to query for valve 555255, then it would search the vale table for the valve with the name/id 555255. Seems pretty simple.

Sample query select * from valves where id = 555255;
 
I'd do it in Ruby. Takes more memory than Perl but the language is much cleaner and you can use XML as your storage container. You can then write a XML to CSV output script which is nearly effortless with Ruby, REXML ( standard ruby library ) and Builder ( ruby gem ).

Code will be really clean.
 
Back
Top