Cicode Tools

Anonymous
Anonymous

Cicode Utility Function Libraries

Version
1.04

Requirements
Citect 7.40 and later (most functions work in older releases also) 

Description

The attached files provide many reusable Cicode functions, divided into categories. Many of them are taken from the Citect Toolbox or Knowledge Base. Others were written by Citect Engineers for their own use. You can copy some or all of the Cicode files into your project, or just copy an individual function you need. Most of the functions are stand-alone, but some do call other functions in the same file or other files in this set. There are no dependencies on the SxW, Tab, or CSV_Include projects. 

Function names ending in "Ex" extend the functionality of a built-in Cicode function having the same name. Function names ending in "Fix" fix a known problem with a built-in Cicode function (which may be fixed in a future release). 

 

Cicode Library Files included: 

AlarmTools For dealing with clusters on alarm pages and importing/exporting the alarm summary  
DateTools  For formatting, converting, and manipulating Citect dates, OLE dates, and TIMESTAMPs, and dealing with DST
DebugTools  For getting Cicode errors and logging messages to disk, calling Cicode from the Kernel, and getting the compile time
FileTools  For working with path\filename strings, creating/deleting files/folders, and reading file properties
GraphicTools For reading page properties, displaying and manipulating pages, and converting screen coordinates
NetworkTools For getting information about the local PC and its role in the Citect network
NumericTools  For manipulating, converting, and formatting numeric values 
ParameterBuffer  For reading cached parameter values to decrease disk access 
ProcessAnalystTools  For customizing the Process Analyst and reading its properties 
SecurityTools  For working with roles, privileges, areas, and logins 
SortingTools  For searching and sorting string arrays 
StringTools  For searching, replacing, and formatting strings 
SuperGenieTools  For associating tags and metadata, displaying popups, and working with associations 
TagTools  For reading tags and tag properties
TaskTools  For running Windows programs and managing Cicode tasks 
TrendTools  For calculating trend averages 

Some of the functions I use most are:


AssMetadataPopUpEx()  Works like AssMetadataPopup() except the popup window will have a close button 
CreatePath()  Creates all folders necessary for the specified path to be valid 
DateAddEx()  Adds separate time and date values, taking daylight savings time into account. 
EnterCriticalSectionFix()  Fixes a problem with EnterCriticalSection() giving multiple tasks simultaneous access 
ErrLogEx()  Logs debug messages to files with runtime-selectable trace levels 
ExecEx()  Runs an application or opens a file, folder, shortcut, email, or web page with the associated application 
Fix()  Returns the specified value with the decimal places removed 
Floor()  Returns the largest whole number less than or equal to the specified number 
IIF()  Inline IF function 
IsNumeric()  Returns TRUE if the specified string contains only a valid numeric value. 
ModeIs()  Returns TRUE if the specified mode value has the specified bits set 
ParameterGetBuf()  Caches parameter values to decrease disk access 
PathAdd()  Combine two paths or path and filename, inserting a backslash between them if needed  
ShellSort()  Sorts an array of strings using the shell sort algorithm 
StrGetField()  Get a field from a string delimited by commas or other characters 
StrReplace()  Search and replace in a string of text 
TimeFormat()  Convert a Citect date/time integer value into a formatted string 


Updates:
2022-11-14  Updated GraphicTools, NetworkTools, SuperGenieTools, TagTools, and TrendTools.
2019-04-02  Added StrCenter(), IntsToDouble(), NearEqual(), TrnGetProperty(), TagReadK(), CompileTime(), FormNumpadEx(), and StrReplaceField() functions
2018-10-26  Updated ErrLogEx in DebugTools to v1.1

Author
Eric Black

Submitter
Eric Black