Skip to end of metadata
Go to start of metadata

In the process of writing a module, you will likely encounter certain situations multiple times, including situations that have been faced many times by the developers on Ignition as well. For these very common cases, it's useful to be aware of various helpful "utility" classes that exist in the platform that can help.



  The necessity of coercing values to a certain type is extremely common. The TypeUtilities class is extremely useful, and supports a large number of coercion scenarios. It goes far beyond basic casting, and can translate between many different types intelligently. For example, it can convert an enum to integer through the invocation of , first looking for a getIntValue() function on the enum, and then using the ordinal position, and vice-versa.  


  Provides several methods for easily closing connections, statements, result sets, etc. without having to perform all of the normal fault checking. For example, this common code:

DBUtilities makes life easier!
Connection con;
	con = openConnection();
	//...database stuff and error handling...
} finally { 
		try {
		} catch(Exception ignore) {
			//Not used;

becomes a cleaner:

	con = openConnection();
	//...database stuff and error handling...
	} finally {



  Provides several different ways to clone objects, and a simple method that will detect which to use.


  Makes it easy to calculate the CRC of an arbitrary collection of objects, including a byte array.


  Provides function for formatting values into strings. In particular, has a number of functions for displaying durations and timing based messages.


  Most of the functions in this class are only used by the Ignition platform, but there are some useful general-purpose functions for working with directories and manipulating files.


  Tools for converting to and from hex strings into bytes.


  Provides capabilities for encryption, decryption, and hashing.




  • No labels