question
stringlengths
19
6.88k
answer
stringlengths
38
33.3k
Problem Statement: Can Aspen DMCplus collect without the ACO Base?
Solution: Collect is an independent CIM-IO client software like Test API and it does not require ACO Base. By copying collect.exe and a proper file into a PC which has CIM-IO interface, collect can work on the PC and create bin files. Keywords: DMCplus Collect ACO BASE CIM-IO References: None
Problem Statement: How can I remove the watermark in a datasheet?
Solution: It is possible to turn off watermarks in Excel Datasheet Editor by going to Print Setup | Datasheet Options. In the View tab, you can uncheck the options you do not want to see depending on the status of the datasheet. Note that you can remove watermark in the Excel Datasheet Editor application and in printed format independently. For printing options, go to the Print tab in the Options window. Keywords: Excel Datasheet Editor, watermark, References: None
Problem Statement: If the case-fixed value for an attribute is changed in the DataModel, how to apply the modification in an existing Workspace.
Solution: TheSolution to this problem is to specify the parameter migratecases=true in the Workspace configuration file or in the library configuration file. This parameter is only needed when the value of the case fixed flag has been changed for attributes in the data model and these attributes have been used in an existing project. Once the data has been migrated the parameter can be removed from the configuration file. The parameter is not needed for a new project or a project where all the attributes have been migrated. The easiest way to migrate all the attributes is to run an integrity check using the procedure below: 1 You change the case fixed flag for some attributes that have data in the new project 2 Set the parameter migratecases=true parameter in the configuration file and reload the server 3 Run an integrity check using the line <%@DataService=<Kernel>::CheckIntegrity%> in the Query Editor of the Aspen Zyqad Explorer tool. 4 Check that the values have been migrated correctly using the Explorer or a datasheet. 5 Remove the parameter from the configuration and restart the Workspace. The main reason you do not want the flag set all the time is that it may decrease the performance of the server on the workspace. Keywords: Attribute CLE Case References: None
Problem Statement: Aspen DMCplus and Aspen SmartStep have been merged into Aspen DMCplus starting in version 2006.5
Solution: In version 2006.5, theAspen DMCplus andAspen SmartStep applications were combined in the single application Aspen DMCplus. Aspen SmartStep Simulate and SmartStep Desktop are no longer used because Aspen DMCplus Simulate and Aspen DMCplus Desktop are used instead. The SmartStep application is activated by setting SMSTENB, SmartStep Enable. When this parameter is set, it activates the Aspen SmartStep parameters for modification. When the Aspen SmartStep tester is turned on, a license key is obtained SLM_SmartStep_Tester, which is the Aspen Smartstep online application. SLM_SmartStep_Advanced is for the Advanced / Multi-test functionality of Aspen SmartStep. As a result of this change, the combination of these two applications inAspen DMCplus, the following features are NOT found in the license key - SLM_SmartStep_Simulate - SLM_SmartStp_Dsktp No functionality will be lost, not having license keys for Aspen SmartStep Desktop and Aspen SmartStep Simulate, in fact, they will not be installed, instead Aspen DMCplus Desktop Tools and Aspen DMCplus Simulate are used. Also, the smartstep_viewsrv.exe will also no longer be running, as the Aspen SmartStep information for the Production Control Web Server is now provided through the dmcp_viewsrv.exe process. You can find additional information regarding SmartStep in the DMCplus online help. From the Start Menu, Start / Programs / AspenTech / Aspen Manufacturing Suite / DMCplus Desktop / DMCplus Help. Keywords: References: None
Problem Statement: Controller goes into open loop on LP/QP internal error.
Solution: EPSMVPMX allows the user to select from several new solver options. And, the new solver option can be used with the DMCplus controller without Composite LP. OPTION 8 fix the LP/QP inernal error which DMCplus Ver. 2004.2 or older can't. And, this option works with the controller without Compsosite LP. Keywords: EPSMVPMX LP QP internal error Composite References: None
Problem Statement: Format warning (green triangle at the corner of the cell) in Datasheet generated by the Excel Datasheet Generator. When user selects the relevant cell, an exclamation mark appears with warning description The number in this cell is formatted as text or preceded by an apostrophe. Looking at the cell content there is an apostrophe before the numbers.
Solution: This is by design, and is necessary in order to write to a cell without loosing format information when generating the exported datasheet. The green triangles will not appear in the printed datasheet. If you wish to get rid of the warning/green triangles, you can select the relevant cell, right click on the exclamation mark and select Convert To Numbers. To do a multi-convert operation, please refer to the Excel Help. Keywords: warning, datasheet, format, Excel Datasheet Generator References: None
Problem Statement: An application, dmcp_viewsrv.exe, using DAIS Trader continues to write to dmcp_viewsrv.out, decreasing the space available on the hard drive. A system reboot frees the disk space, however the process, continues to output to dmcp_viewsrv.out file. This
Solution: provides a work around on how to address this issue. Solution This issue is the result of a conflict with DCOM and the dais trader. This problem can be resolved by modifying the autostartlist.txt file that is located in <drive>\AspenTech\AC Online\sys\etc. Add the following two entries to the startup file STDOUT=NUL and STDERR=NUL After adding the above two entries, the autostartlist.txt will look like this PROCNAME=DMCP_VIEWSRV SEQNUM=20 STDOUT=NUL STDERR=NUL APPPATH=$ACODHOME\bin\dmcp_viewsrv.exe APPTYPE=1 Keywords: dmcp_viewsrv.exe dmcp_viewsrv.out autostartlist.txt invisible References: None
Problem Statement: Getting Unknown variable on the calculations and hence not able to load the controller
Solution: Confirm there are not spaces in the variable names, replace any spaces with underscores, save CCF and reload. Keywords: ccf, build, validate, error References: None
Problem Statement: How do you place a quoted string inside of a macro?
Solution: To embed a quoted string inside a macro, place two sets of single quotes (not double quotes) around the quoted string as in the following example: macro dvstate = 'and ip_input_value = ''CLOSE'' '; select name, ip_input_value, ip_plant_area from ip_discretedef where ip_plant_area='A' &dvstate; Here, the macro is dvstate, and the quoted string is 'CLOSE'. Keywords: References: None
Problem Statement: Is there an Aspen SQLplus query that will search the the source files for records defined by compquerydef for a tag name or a string?
Solution: The query attached to thisSolution searches the source files for records defined by compquerydef for a tag name or a string. The query assumes the source files are located in C:\ProgramData\AspenTech\InfoPlus.21\db21\group200\sql\; however, you can point to a different location by modifying the macro sqlfileslocation. After prompting for a tag name, the query uses the system command to get a directory listing of all the files in the Aspen SQLplus query source folder and then selects files from that list based on the queries defined by compquerydef. The query then searches each line of the compquerydef source files looking for the tag name using the POSITION function. When the query finds the tag name, the query prints the compquerydef record name with the line numbers containing the tag name. Keywords: sample tag search string search system command position References: None
Problem Statement: An installation of the AspenTech software was proceeding and during the AspenCalc installation, a message was generated that the NobleNet Portmapper could not be started.
Solution: Check for other portmapper applications already running, particularly on a an AW / Foxboro machine, we find ISMPortMapper. When the alternate portmapper is stopped or disabled, the NobleNet Port Mapper can be started. The software installation can then be resumed. Keywords: None References: None
Problem Statement: On Compiling Standard 'A0 Title.sym' symbol the error : Field LOCATION has an invalid route (See below images) is displayed. How to get rid of that?
Solution: This is because there was change made in standard library. To get rid of this error, double-click the 'location' field in the label and change the route to 'Site:Location' rather than Site:Location(1). Keywords: Border labels, Field route, Graphic definer. References: None
Problem Statement: Do APC online applications require constant contact with the license server?
Solution: The APC applications checkout a license the first time it runs. The application checks for connectivity to the license server each time it run, after that. It attempts to acquire a license every 4 hours. If it cannot acquire a valid license, it begins a 10 day countdown. The countdown messages are visible on the Production Control Web Server and in the .eng file and appear every 4 hours. This allows for 10 days to correct any connectivity issues. When the issue is resolved, and a valid license acquired, the countdown timer is reset to 10 days. Keywords: None References: None
Problem Statement: User is unable to change line type of a previously created symbol in the Graphic Definer.
Solution: User will need to add Styles.sym file as a resource file for line type as instructed below: In the Graphic Definer select Format -> Style. From the Style Dialog box, select Line (from pull-down list) for Style type. Click Resources and add Styles.sym (in C:\Program Files\AspenTech\Aspen Zyqad 11.1\client\RAD\template\styles folder) and apply the changes. Now you can select the lines you want to change by either using the Toolbar or Properties ->Format->Style, which now have the full list of line style options to choose from. Keywords: Graphic Definer, Symbols, Line Style References: None
Problem Statement: How can the user change the default unit for attributes used in Labels?
Solution: To get the an attribute field value to display in a desired unit to show, you need to ensure the desired unit is selected for the attribute in the relevant classview (used by the Label). Load the class store and open relevant class view Navigate to the relevant attribute and Unit field as desired Save the azcl and compile the class store Close all applications and ensure no user is using the workspace. Check the TaskManager that the Az131server.exe is terminated Reload the workspace and recompile the Label in the Symbols Definer application Close all applications again and reload workspace as before in Drawing Editor Drag and drop Label onto drawing. The value of the attribute would now reflect that of the selected Unit in the class view. Keywords: Unit, Label References: None
Problem Statement: When trying to manually create a new workspace in Aspen Basic Engineering using the SQL server database (refer to
Solution: ID 142043): The following error message can be displayed Login failed for user X. Reason: The password of the account must be changed. See the screenshot below: This error appears because the option Enforce password policy is selected, so it forces the user to follow some specific rules when creating the password. These rules can be found on the Microsoft website: https://msdn.microsoft.com/en-us/library/ms161959.aspx.Solution The user can change the password and the login name to fit them with the requirements specified on the above link, or just un-check the option “Enforce password policy”. Keywords: Workspace, SQL, Login failed, Enforce password policy. References: None
Problem Statement: What is the procedure for upgrading my Zyqad class libraries and workspace from version 12.1 to 2004?
Solution: User will need to convert both the relevant class libraries and workspace with the migration tools provided. To convert Zyqad 12.1 class libraries to Zyqad 2004 format: In the Class Library Editor in Zyqad 2004, create a new library using File -> New. User can also choose to use the StandardModel.azcl if desired. Go to File ->Import 12.1 Library. Browse to the relevant Zyqad 12.1 AllLibraries.azcl. Browse to the Zyqad 12.1 UOM file. Click OK The relevant libraries will then be converted to that of 2004 format. Create class store using Tools -> Make Class Store and enter desired class store name. To convert Zyqad 12.1 workspace to Zyqad 2004 format: Load the attached AZ121Backup.exe. Select Backup Workspace. Click Next. Select workspace to Backup from the dropdown list. Clik Next Select Backup File Location by Browsing to it. Click Next. Click Backup. Message will appear that backup has been successful. Create a new workspace from the Administration Tool which you want to restore the 12.1 workspace to. Load the AZ131Backup.exe from C:\Program Files\AspenTech\Aspen Zyqad 2004\DataServices\bin. Select Restore Workspace. Click Next. Select the workspace folder to restore to (ie. Browse to new workspace created in Step 5). Click Next Select Backup file (file create in Step 3). Click Next Click Restore Note that user will need to ensure that the workspace libraries folders' paths are consistent with the settings as per the LibrarySet.cfg file used by the new Zyqad 2004 workspace. Keywords: workspace, class libraries, migration References: None
Problem Statement: How do you manually change the authentication mode of SQL Express to SQL Server and Windows Authentication mode to be used with ABE Workspaces?
Solution: 1) Open the SQL Server Management Studio. To do this, click Start | All programs | Microsoft SQL Server 20XX (where XX is the version of SQL), and then click ‘SQL Server Management Studio’. 2) Right-click the server name on the top of the left hand side navigation tree, and then click on ‘Properties’: 3) On the ‘Security’ page, under ‘Server authentication’, click the ‘SQL Server and Windows Authentication mode’ option button, and then click ‘OK’: 1) In the ‘SQL Server Management Studio’ dialog box, click ‘OK’ to restart SQL Server. Or, right-click the server name and then click on ‘Restart’. A hard restart of the machine is also suggested. Keywords: SQL Express, Windows Authentication, SQL server authentication. References: None
Problem Statement: How do I change the color of my PFD items on Drawing Editor?
Solution: To change the color you will need to select the items inside your diagram using your mouse to create a selection box (Click on the screen and increase the size of the selection box as needed): When all of your items are highlighted, click on the Expand button from the ribbon menu: The color menu will be available and you can select or customize a color by clicking on this option: Return to your PFD and you will see that the default color has been changed: Keywords: Color, Drawing Editor, PFD, V8, Change, Customize References: None
Problem Statement: Controller refuses to load with the following error messages. How to troubleshoot?
Solution: If cimio_t_api returns positive results when tags are sampled against the OPC server, this error typically points to a specific invalid tag defined in the CCF. To identify the tag in question, set LISTSZ=1 and reload the controller. If this does not work, you will need to further review KB 129119 and submit the following to [email protected]: - cimio_t_api results; - screen capture when command Manage is used to load the controller. - cimio_logical_devices.def, cimio_msg.log, services and host files; - *.ccf, *.dgp, valid.err, *.eng and *.prt files. Keywords: IDB_Valid error. IDB: IDB_Read falure: PDB: CIMIO_USR_GET_RECEIVE, Error receiving a GET reply from device CIMIO_MSG_RECV_TIMEOUT, Time-out trying to receive a message Error. DMCINI Failed - -1 Error. Unable to complete ContextLoad() Control load failed for controller: XXX References: None
Problem Statement: How can I retrieve past messages from the Advanced Process Control system?
Solution: Control messages, the same ones presented on the Production Control Web Server and found in the log files for the applications, in the app folders, are stored in the MPF System. To retrieve these messages, go to a command / dos prompt and type the following: mpf_manage msglist -r -o c:\messages.txt This will create a file on the c drive, messages.txt, and this file will contain all of the messages stored in the message queue. These messages are time stamped, and can be used to determine what may have been going on at a particular time. These messages are from the entire control system, so there will be messages from all of the online applications running on the machine. Keywords: MPF, messages, control, system, iq_manage msglist References: None
Problem Statement: When trying to restore an AZBKP file using the AZ131Backup.exe program, the error message: The log file for database 'Zy31060' is full. Back up the transaction log for the database to free up some log space.
Solution: Check where the SQL Server is writing the transaction log file to and ensure that it is not out of disk space. Keywords: restore, azbkp, sql server References: None
Problem Statement: How to transfer more attribute with the Object Mapper
Solution: The Object Mapper is used to transfer data between UO object from a simulation and equipment object. The transfer is controlled with classview defined in the ClassStore. The name of these classviews starts by ObjectMapper. It is possible to transfer additional variable by adding new attribute in an ObjectMapper classview. Each ObjectMapper class view attribute needs to be linked to two composite view attributes. The first one is the UO (Unit of Operation) attribute and the other is the equipment or stream attribute. You can alternate between these two links by doing a right-mouse click on the classview object and select Show Links for Alternate class. In 2006, the Object Mapper has been incorporated in the Simulation Importer interface. However, the interface is still using the ObjectMapper classviews. Keywords: Object Mapper References: None
Problem Statement: DMCplus controllers cannot be started in APCManage. Error message DMCplus message initialization failed was found listed in the message log after <Start>. In addition, when attempting to start manage.exe from CMD console, you receive the error message Fatal Error: Unable to open message file: C:/ProgramData/AspenTech/APC/Online/cfg/message.dat. Unable to proceed due to fatal error in message system initialization.
Solution: Potentially, the file message.dat is inaccessible or unavailable. Go to C:\ProgramData\Aspentech\APC\Online\cfg\ folder, check that message.dat exists and not configured as read-only. Open APCManage console, restart the APC services by selecting 'Shutdown Advanced Control' and 'Startup Advanced Control'. Open CMD console, and start manage.exe. If message.dat is accessible, you should not receive the error message again. Keywords: DMC+ APC Advanced Process Control DMCplus message initialisation failed References: None
Problem Statement: New options entered in an open enumeration are saved in the database and available in all attributes which use this enumeration. Is it possible to delete these options?
Solution: It is possible to delete new options entered in an open enumeration using the tool Enumeration Managementavailable under the menu Edit in the Explorer application. The management of Open Enumeration is secured by a privilege. The person who wants to delete option from open enumeration needs the privilegeModify Open Enumeration. This privilege can be granted using the Administration tool. When the privilege has been granted, it will be possible to delete the option using the following procedure: Launch the Enumeration Management tool in the Explorer (Edit=>Enumeration management) Select the enumeration that you want to modify Select the option that you want to delete. New options appears in white and built-in option appears in gray which mean that it cannot be deleted. Click on the button Remove/Replace Select Remove and clear any existing usage. This will delete the new option from the open enumeration. This function allows you to remove and replace the option by a new one if necessary. Keywords: Enumeration Explorer References: None
Problem Statement: During use of Aspen Zyqad any potential legacy problems with the database can cause disruption to later use of aspects of older databases or packages (Explorer or Graphical). This may mean that subsequently a diagram may not open or a package will not load. The specific cause associated with this problem were fixed in 2004.0.4. However, databases that may have incurred the problem previously can be checked by performing what is known as an Integrity Check. This checks that all object relationships remain properly formed in the database. If you have never used graphical packages you are unlikely to have encountered this problem. This article explains how to carry out an integrity check. If a problem is found please contact your support representative who will refer the problem for repair.
Solution: The best Integrity Check procedure is built into 2004.0.5 (2004.0 updated with Cumulative Patch 5 (CP5)) Using the database you want to check (whether this uses Oracle, SQL Server or Access) open the Aspen Zyqad Explorer and connect to the workspace. Open the Query Editor from the View menu. Type the following into the upper text entry part of the Query Editor (yellow background). Be careful to use the same lower and upper case characters (paste does not operate in this dialog): <%@DataService=<Kernel>::CheckIntegrity%> Click submit after which a spinning dial appears showing the query is operating and the Query Editor is waiting for a response. After some time (a small database will take several seconds and large database several minutes), the response will appear in the lower text output window (blue background): No object integrity errors detected In which case all is well. If a problem is detected by the query, consult your support representative. You are advised to repeat the process for any projects that your workspace contains. Older packages may preserve an integrity problem if they were exported from an older database which itself had an integrity problem. Using such a package later by importing into a good database, even after CP4, will reintroduce the problem. These packages should be checked out. To check older or suspect packages, import them into a clean empty database if possible. This can be done with Access avoiding the need to use Oracle for example. Once imported, run the integrity check on the newly populated database. If this comes up clean the package is OK. Repeat this process for any older suspect packages. If a problem does occur, and you are unable to regenerate the package please contact your support representative who will arrange for your package to be repaired. If a package has a problem, this indicates that its source database also carries the same problem and needs checking and referral for repair. You should not regenerate a package from the same database unless it has been checked out and repaired if necessary. Note: During the development of this built-in procedure, we had available an Integrity Check rule. This built-in procedure replaces these rules. If you are in the possession of one of these rules please use the built-in procedure with Aspen Zyqad 2004.0.5 instead unless advised by your support representative. The built in procedure has several refinements and is more accurate than these earlier rules. Keywords: References: None
Problem Statement: I simulated a heat exchanger using 2 heater blocks in Aspen Plus. How do I transfer the result to one heat exchanger in Zyqad?
Solution: Import the Aspen Plus simulation into the workspace in the Simulator Interface Load the Object Mapper and map the streams accordingly. Map the relevant Aspen Plus heater block to the Zyqad heat exchanger. Click Transfer. If you have heat curves data, the cold side heat curves will be populated in the Zyqad heat exchanger. Unmap the first heater block and map the second heater block to the same heat exchanger. Click Transfer. The hotside heat curves will be populated. Keywords: Aspen Plus, simulation, heat exchanger, mapping References: None
Problem Statement: How can I delete the border displayed around bitmap object in label.
Solution: Open the label with the Graphic Definer, right-click on the bitmap objet and select properties. With AZ2006, you need to unselect the option Show Border located on the Border tab. With AZ2004, the Show Border option is located on the Format tab of the properties. Keywords: Label Graphic Definer References: None
Problem Statement: DEPW becomes different from DEP when the dependent variable is in out of serivce
Solution: This is expected behavior. DEPW is a value that sent to the engine after passing validation and calcs. It handles things differently depending on what is occurring with the variable. If the variable is out of service, then DEPW is typically set to some safe value so as not to hit any constraints (internally, the engine also adjusts limits to avoid out of service variables from affecting the control problem). So, DEPW is not something to be used for anything outside the controller engine. If you want to see what the transformed value of a variable is, you can use DEPA and VINDA. Keywords: DEPW out of service DEPA VINDA References: None
Problem Statement: When 2006.5 CP2 for Advanced Process Control is applied, cimio communication maybe disrupted, particularly to the Foxboro DCS
Solution: TheSolution to this issue is to replace the cimio dll's from the installation, pre 2006.5 CP2 patch. The dll's live in the AspenTech Shared directory. cimio.dll cimioauth.dll Stop the online applications, Aspen DMCplus, Aspen IQ. Stop the Aspen CimIO processes. Rename the current cimio.dll and cimioauth.dll in the AspenTech Shared directory. Unzip the attached cimiofiles.zip and rename them to cimio.dll and cimioauth.dll and place them in the AspenTech Shared Directory. Restart Aspen CimIO The version of these dll's are 9.5.0.12. If CimIO patches have been applied to your APC online server, your dll's may have versions: Previous to the CIO100610C patch the version number was 9.5.6.8 After CIO100610C patch 9.5.6.21 These are also the version provided with the 2006.5 CP2 patch. Keywords: None References: None
Problem Statement: How can I display the last day of the month for reports?
Solution: Download the function LAST_DAY attached to thisSolution and use the SQLplus query writer to save the function as a procedure in InfoPlus.21. Given an InfoPlus.21 timestamp, the function returns the last day of the month indicated in the timestamp argument as a character string using the date format specified for the Aspen InfoPlus.21 database. This function uses the Aspen SQLplus function date_format to determine the date format of the InfoPlus.21 server, the function subtract_months to add one month to the timestamp passed into the function, and cast (timestamp as char) to round the result returned by subtract_months back to the first day of the month. Finally the function subtracts 24 hours to determine the last day of the month. The Aspen SQLplus help files describe the functions date_format, subtract_months, and cast(timestamp as char). For example: write Last_Day('20-DEC-11'); returns 31-DEC-11 Keywords: sample query procedure function last day date_format subtract_months cast References: None
Problem Statement: Remote database look and behaves differently when accessed via ODBC OAM.
Solution: Manually edit the ''links.dat'' file and change the second parameter for the alias from ''ODBC'' to SETCIM. SQLplus will then treat the remote database as a native SETCIM/InfoPlus.21 database. Example: To change the alias ''IP21'' from using generic ODBC to SETCIM the following line in ''%SETCIM%\sql\links.dat'' requires changing. From: IP21,odbc,odbc,SQLplus on Localhost To: IP21,SETCIM,odbc,SQLplus on Localhost Keywords: References: None
Problem Statement: The async client task dies with a Dr. Watson and won't remain running.
Solution: The store file has possibly been corrupted due to an improper shutdown/startup of CIM-IO and thus cannot unbuffer properly to the async client task, causing it to die. Perform a clean start of CIM-IO and Store and Forward perSolution # 103176 Keywords: cimio_c_async.exe store and forward References: None
Problem Statement: While executing an Aspen SQLplus query inserting data into an Aspen InfoPlus.21 (IP.21) database, you might receive the error message: Error writing to <tagname>: Invalid key timestamp at line <x> . How to overcome it? Example query: INSERT INTO ATCAI(IP_TREND_VALUE, IP_TREND_TIME) VALUES (4.5, '03-JAN-02 10:00:33'); Everything looks normal (the timestamp, the syntax, etc), but yet you are getting the above error.
Solution: There are three possibilities that can generate this error when executing this kind of SQLplus query: 1. You are attempting to update history for data that is older than your IP.21 repository's Past Time parameter. The Past Time parameter sets the limit on how far back in time history can be inserted or updated. If the timestamp in your query places the data outside the past time parameter, increase the value of this parameter so that the data of interest lies within the covered dates. For example, if you want to insert data that is 30 days old, then you need to change the Past Time parameter to 720 hours instead of 24 hours. Finally, restart IP.21 for the new setting to take effect and rerun the query. To configure the Past Time parameter for a given repository (eg. TSK_DHIS): go to the IP.21 Administrator => select the server name => select Historian => select the repository name => right click => select Properties => go to the Repository tab => in the Time frame you will see the Past and Future fields. 2. The record was not created at the time you are trying to enter. In other words, you cannot insert data into a record before its creation date. If you need to change the creation date of the record to allow for population of data, then use XOLDESTOK: see Knowledge BaseSolution 103040 for more details. http://support.aspentech.com/webteamasp/KB.asp?ID=103040 Example: You have recently created a record on February 15, 2002. You are now trying to insert data into history repeat area for this record with the date and time of '03-JAN-02 10:00:33'. 3. The filesets do not go back that far in time. You will have to restore old filesets for that time range in order to insert data into them. Keywords: Invalid Key Timestamp at line 1 Past References: None
Problem Statement: How can I trap errors produced by a query and write error information to a log file?
Solution: A BEGIN / EXCEPTION /END block catches run-time errors during query execution providing a way to take corrective actions without the query aborting. If an error occurs in the code between the BEGIN and EXCEPTION statements, instead of exiting, Aspen SQLplus transfers execution to the statements located between the EXCEPTION and END statements. Several Aspen SQLplus functions capture information about the error. See the topic Error Functions in the Aspen SQLplus help file. You can write this information to a logging file in the exception block as follows: BEGIN --Main query code EXCEPTION SET APPEND 'C:\Temp\QueryLog.txt'; Write (' Keywords: None References: None
Problem Statement: Is it possible to use Aspen SQLplus to connect to a 64-bit Oracle (or other 64-bit application)?
Solution: AlthoughSolution 134112 (which is for an engineering release of Aspen SQLplus) contains the Statement This patch is designed to install the AspenTech SQLplus 64 bit ODBC driver version V7.3 on an InfoPlus.21 client machine. This patch allows 64-bit applications to talk to Aspen InfoPlus.21. Aspen SQLplus is a 32-bit application, and as such, cannot see or utilize 64-bit drivers. Keywords: References: None
Problem Statement: How can I select more than 32 characters using the substring statement?
Solution: By default, the substring statement returns a maximum of 32 characters. For example, suppose a file named test.txt contains the following line: 1234567890123456789012345678901234567890,abcdefghijklmnopqrstuvwxyz Then, the query select substring(1 of line between ','), substring(2 of line between ',') from 'test.txt' returns SUBSTRING(1 OF LINE BETWEEN ',') SUBSTRING(2 OF LINE BETWEEN ',') Keywords: None References: None
Problem Statement: There is no built-in function that calculates the number of substrings in a line. However, the function below can be added to an Aspen SQLplus query to calculate the number of substrings in a comma delimited text line.
Solution: function count_substrings(x char(256)) local i int, c int; c = 0; for i = 1 to character_length(x) do if substring(x from i for 1) = ',' then c = c + 1; end end return c+1; end Keywords: References: None
Problem Statement: How can I check CIM-IO Get Records status using SQLplus?
Solution: Get Records are defined by IoGetDef, therefore querying this record will give you the status of your Get Records. In order to have a quick overview it might be better to select just the following: SELECT NAME,IO_RECORD_PROCESSING,IO_LAST_STATUS,IO_LAST_STATUS_DESC,IO_LAST_UPDATE FROM iOGetDef Otherwise SELECT * to get all details. If you need to dump the results into a log file, use SET OUTPUT. If you need to limit the query to few similar Get Records, the WHERE clause can be used. SET OUTPUT = 'C:\IO_STATUS.log'; SELECT NAME,IO_RECORD_PROCESSING,IO_LAST_STATUS,IO_LAST_STATUS_DESC,IO_LAST_UPDATE FROM iOGetDef WHERE name like 'get%'; Keywords: SQLplus CIM-IO References: None
Problem Statement: When Performing a Query on a remote database using the 'ODBC OAM' the error message 'Complex Remote Update Or Delete Requires Row Identification Field' is received. This knowledge base article describes how to work around this error message.
Solution: This error message indicates that the ODBC OAM module is trying to perform a generic ODBC query which, although syntactically correct, fails. The work around for this is to configure the ODBC link to use database specific syntax instead of generic ODBC. A list of databases is contained in the text file '%SETCIM%\sql\databases.dat'. Moreover, this file can be modified to accommodate new database definitions if required. To change the ODBC OAM from using generic ODBC syntax and use database specific syntax, the ODBC link contained in the file %SETCIM%\sql\links.dat' requires the second parameter on the link to be manually modified. Example: To change the alias 'ORA' from using generic ODBC to Oracle the following line in '%SETCIM%\sql\links.dat' requires changing. From: ORA,odbc,odbc,OracleDSN To: ORA,oracle,odbc,OracleDSN For Microsoft SQL Server databases that experience this same error, it may be necessary to reformat your query to use local variables. See the Troubleshooting section of the Aspen SQLplus Help files, or search on the keyword complex to find the relevant information and syntax example. Keywords: Complex Remote Update syntax remote database query References: None
Problem Statement: When performing a remote UPDATE or DELETE query for MSSQL, the error: Complex remote UPDATE or DELETE requires row identification field at line xx is received.
Solution: If you are at version 4.0, the error message might be due to a bug that is corrected in Service Pack 1. Upgrade to version 4.0.1 If you are not at version 4.0 and are receiving the error message, implement a workaround for connecting to MS SQL Server. Two syntax workarounds are available: use local variables ( in some cases), or incorporate the Execute statement. ***** Example using local variables ***** Original: UPDATE PS.PlantSchedule.dbo.Railcars SET RStatus=2, StatusDate=CURRENT_TIMESTAMP, WHERE CarNo=LastCar; Changes to lines 3 and 5 result in the following error-free query: UPDATE PS.PlantSchedule.dbo.Railcars SET RStatus=2, StatusDate=''30-jun-2001 00:00:01 WHERE CarNo=local.LastCar; ***** Example using the EXECUTE command ***** Original Delete from abcsql1.mds.dbo.u_acomplex; Revised: Execute ''''delete from mds.dbo.u_acomplex'''' on abcsql1 Note that SQLplus help files will be updated for version 4.1 to include troubleshooting information on this error message. Keywords: database SQL References: None
Problem Statement: How can I include single quotations (') in an Aspen SQL Plus query string?
Solution: In order to include single quotations (') as part of the query string they must be enclosed within a set of single quotations as demonstrated in the following examples. Query Example 1 write ''Hello World''; Format: write (`(`Hello World?)?); Result: `Hello World? Query Example 2 write ' ''Hello'' ''World'' '; Format: write (`(`(`Hello?)?) (`(`World?)?)?); Result: `Hello? `World? Keywords: Aspen SQLPlus; Quotations; Query; String; References: None
Problem Statement: How can I execute a QueryDef on a remote InfoPlus.21 server?
Solution: A way of executing a remote query would be to store it as QueryDef and not ProcedureDef. The reason for doing this is that QueryDef record can be activated on a Change Of State. On InfoPlus.21 the field that activates the query can be updated and used as trigger for the query. See example below: A QueryDef record is stored on IP.21 #2. In order to trigger this record to run the query on IP.21 #2 from IP.21 #1 you will need to update the record that the QueryDef is monitoring. That would be on #WAIT_FOR_COS_FIELDS. So you would have on your IP.21 #2 a Trigger record that you would update from your IP.21 #1 via SQLplus, or any other way you might want to activate it. In the WAIT_FOR_COS_FIELD you would specify TRIGGER IP_INPUT_VALUE As soon as IP_INPUT_VALUE changes, the QueryDef record is activated. Keywords: SQLplus, QueryDef, remote activation References: None
Problem Statement: The CIM-IO documentation states how to start the Store and Forward (S&F) processes on Windows NT by opening a command window and executing the necessary commands. The S&F processes are stopped by closing the command window. This
Solution: discusses how to start and stop these S&F processes through the use of an NT service. The processes belonging to an NT service persist or stay running over different NT logins. The processes run in the background - not via a command window.Solution With the installation of CIM-IO on the NT platform, a service, CIM-IO Manager, is installed and found in the Control Panel > Services. When this service is started, a batch file called cimio_autostart.bat is run. This batch file is found in the C:\aspentech\infoplus.21\db21\commands or %CIMIOCOM% directory. This file needs to be edited to include the commands necessary to start the S&F processes. Open this file in Notepad and add this line: %CIMIOCOM%\cimio_sf_start < servicename > The cimio_sf_start is a batch file located in the %CIMIOCOM% directory that requires the DLGP service name to be passed as a parameter. Now when the CIM-IO Manager service is started, the cimio_sf_scanner, cimio_sf_store, and cimio_sf_forward processes are started and can be seen running in the NT Task Manager. When the CIM-IO Manager service is stopped, a batch file called cimio_autostop.bat is run. This batch file is located in the same directory as the cimio_autostart.bat. This file, also, needs to be edited but to include the commands necessary to stop the S&F processes. Open this file in Notepad and add this line: %CIMIOCODE%\cimio_sf_shutdown /S= < servicename > (or /D= < devicename > ) The cimio_sf_shutdown is an executable found in the %CIMIOCODE% directory that requires a /S parameter of the DLGP service name OR the /D parameter of the logical device name to be passed. Now when the CIM-IO Manager service is stopped, the cimio_sf_scanner, cimio_sf_store, and cimio_sf_forward processes are stopped and will no longer be seen running in the NT Task Manager. The CIM-IO Manager service can be set to start automatically when the NT box is booted. Or, it can be set to manual where the service can be started upon demand. Keywords: Store and Forward S&F NT service CIM-IO Manager References: None
Problem Statement: When attempting to connect to an Oracle database using a SELECT statement like this (where ''ts'' is a variable holding an IP.21 timestamp): select caught_dt, result from NAME.ORACLEDB.GOESHERE where caught_dt > ts and sample_point = ''TA'' and test_code = ''RV''; the following error can occur: Remote database error on link POL_LIMS:[Oracle][ODBC][Ora]ORA-01830:date format picture ends before converting entire input string
Solution: Add code like this before the query, which instructs Oracle to accept timestamps in IP.21 format: execute ''alter session set NLS_DATE_FORMAT = ''''DD-MON-YYYY HH24:MI:SS'''''' on remote_ora_db; Keywords: Oracle SQLplus remote database error 1830 References: None
Problem Statement: What is the correct format for indirect insert of a variable in Aspen InfoPlus21 database, using SQL script?
Solution: A correct SQL script has to be used in case it is required to indirectly insert a variable in Aspen InfoPlus21 database. In case of incorrect format, an error message about not recognizing the column name will appear. An example of correct SQL script is as below: Keywords: Inserting variable in database SQL script for inserting variable References: None
Problem Statement: Note the following two queries and the example result sets. The queries only differ in that the second specifies a remote datasource, yet the results differ. Query 1, running locally on MyServer, returns the correct dataset. Query 2 runs against MyServer from a remote SQLplus client, and returns an incorrect dataset: QUERY 1: select DISTINCT(IP_PLANT_AREA) as plant, MAX(IP_INPUT_TIME) as last_update_time from ip_analogdef GROUP BY ip_plant_area order by last_update_time; RESULTS: plant last_update_time Crude 04-JAN-05 12:41:00.0 Pharm 04-JAN-05 12:41:19.8 Bakery 18-APR-02 13:39:21.4 Area1 18-APR-02 13:39:21.4 R2 18-APR-02 13:39:25.1 QUERY 2: select DISTINCT(IP_PLANT_AREA) as plant, MAX(IP_INPUT_TIME) as last_update_time from MyServer.ip_analogdef GROUP BY ip_plant_area order by last_update_time; RESULTS: plant last_update_time Area1 18-APR-02 13:39:21.4 Bakery 18-APR-02 13:39:21.4 Crude 04-JAN-05 12:41:00.0 R2 04-JAN-05 12:41:19.8 Pharm 04-JAN-05 12:41:19.8
Solution: In Query 1 the ORDER BY is executed on the local system and sorts the data returned from the remote system. The default setting for an ODBC data source is to return timestamp data as character data type (to preserve the InfoPlus.21 formatting). So, the ORDER BY in the first query sorts the data by character (alphabetic) order rather than timestamp ORDER. Consider the same query, written to run remotely a different way: exec('select DISTINCT(IP_PLANT_AREA) as plant, MAX(IP_INPUT_TIME) as last_update_time from ip_analogdef GROUP BY ip_plant_area order by last_update_time') on MyServer This query is written to execute the whole query on the remote system and so the ORDER BY sorts using timestamp order. There are two ways to make Query 1 return the correct data set: Add an explicit conversion to timestamp to the query: select DISTINCT(IP_PLANT_AREA) as plant, MAX(cast(IP_INPUT_TIME as timestamp)) as last_update_time from MyServer.ip_analogdef GROUP BY ip_plant_area order by last_update_time; or Go to the Advanced dialog of the SQLplus ODBC data source an removing the check mark from the Timestamp sent as Character option. You will need to disconnect the link or restart the query writer for this to take effect. Keywords: bad wrong API References: None
Problem Statement: How do I produce comma-delimited files using Aspen SQLplus?
Solution: Setting the output to a file, then specifying the format of a select statement. For example: SET COLUMN_HEADERS 0; SET VALUE_BETWEEN ','; SET OUTPUT 'COMMA.TXT'; SELECT NAME,VALUE FROM ANALOGDEF; SET OUTPUT DEFAULT; Keywords: comma separated, comma delimited, text format References: None
Problem Statement: Executing a SQLPlus script will retrieve the result until the execution end of the query, sometimes you will need to ensure that the query is working properly during execution so that you can continue or cancel it on proper time, specially if the query requiere a lot of time to execute. Even when there is no direct
Solution: to achieve this, in thisSolution we provides an example on how to pause a query, check the current result, and continue its operation using the SET OUTPUT statement and Temporary tables in Aspen SQL PLus. Solution The attached .sql file provides an example on how to pause a query to retrieve the name for all the records in the IP_AnalogDef definition family. The script will run the main query inside a FOR-DO statement and write the result in a temporary table called MyTempTable. For every loop inside the FOR-DO statement it will add a value to the index variable and check if this value is equal to the user defined number of row to process (set to 10 by default). FOR (SELECT name FROM ip_analogdef) do index = index + 1; INSERT INTO MODULE.MyTempTable VALUES (name); END When the number of processed rows has been reached, then a function will ask for the user if he want to write the query result until the current execution using a PROMPT windows; this will pause the execution of the query until it have an answer of the user. At this point, if the user response is YES then it will change the default result output from console to a text file (C:\Temp\QueryResult.txt) using the SET OUTPUT statement, and write the content of the temporary table that was holding the main query result into this file. It is important at this point to return the output result to DEFAULT in the query code so that the data can be actually written down to the text file. After this, the query will ask the user how many rows does he want to process until next stop using also a PROMPT windows to pause the query. At this point you can open the QueryResult.txt file and look the result of the query until this point. After giving a number (10 by default) it will continue with the main query, writing the result in the temporary table and repeat all described process again. If in any PROMPT window the Cancel option is selected, the query will cancel execution and stop. If some text result has been written to the text file, it will remain on it. Also, if the number of rows to process is bigger than the actual query result, the query will not show any PROMPT window and the text file will be empty, in this case you can change the default 10 to a lower value. Keywords: Set Output SQLPlus query References: None
Problem Statement: Advanced Process Control V7.2
Solution: The following enhancements were made to aspenONE APC in V7.2. Product Quality The communication layer for APC Products (CORBA/Dais) has been replaced with WCF (.NET) technology in order to improve the robustness and stability of application such as the Production Control Webserver. Dais is still available for v7.2 if required. A considerable number of quality improvements were made across the entire product suite. A full list of the hundreds of backlog defects addressed are available in the release notes. Some highlighted usability improvements are: Many backlog defects fixed in DMCplus Controller (primarily fixes in the area of usability and following Windows standards) Model drag and drop integration between DMCplus Model and the desktop for the Aspen Control Platform Improved messages from ID engine to help pinpoint problem independent variables (e.g. small moves or no moves) Documentation improvements for the entry dictionary and new topics for identification and validation concepts As part of this initiative, many features specifically requested by the user community (via user group voting) have been addressed: The installation procedure for APC products has been streamlined and the number of discrete installs has been reduced from 16 product-based installs to just 5 server-based installs (including Aspen Process Sequencer). The benefits of this are: Obvious user choices at install time Fully supported side-by-side installs of future versions of the desktops (V7.1 and forward) Easier customer support due to fewer install permutations Supports more stringent security rules in place on Windows Vista, Windows 7, and Server 2008 An improved user interface for APC Manage has been made available for v7.2. The DOS version is still available and Manage functionality is still available in the Production Control Web Viewer and the Aspen Control Platform Desktop (for ACP applications). However DOS programs that access shared memory files are not consistent with Microsoft Security protocols and so this new windows interface has been created. DMCplus Modernization Program - .NET Control Environment AspenTech's commitment to the modernization of its control products has continued with v7.2. Full AspenTech DMCplus Controller functionality has now been migrated to the new .NET control environment. This platform can now handle large DMCplus controller applications which incorporate subcontrollers and SmartStep testgroups. The v7.2 .NET control environment does not yet support Aspen DMCplus Composite applications. Until v7.3 applications requiring a Composite layer will still be required to use the tradition toolset architecture. The v7.2 .NET control environment supports the following new capability DMCplus Subcontrollers SmartStep Testgroups Full application (.CCF) import and export CCF and Aspen Calc Scripts Drag and drop interplay with DMCplus Model Transform information appended to .mdl file to enable transform information to be imported directly into the platform with the .mdl file. Faster processing of models on historical data Modern, intuitive and guided workflow for DMCplus applications. PCWS communication with multiple servers for .NET control applications facilitating enterprise roll-ups. Adaptive Modeling Aspen Adaptive Modeling was released in January 2010 for application to traditional DMCplus applications. V7.2 delivers Adaptive Modeling capability for DMCplus applications running in the new .NET control environment. V7.2 Adaptive Modeling capability includes: Online Model Performance KPIs: Gain Multiplier Test: A GMULT is calculated for each model. If the GMULT is close to or equal to 1 then the current gain of the model is consistent with the new case data. The model is declared good for the GMULT Test. Model Uncertainty Test: A model uncertainty test is also performed. If the model uncertainty test indicates high model certainty then the model is labeled as good or bad. If the model uncertainty test indicates high model uncertainty then the model quality is labeled as Unknown. Independent Variable KPIs (e.g. Oscillation detection; stepsize; limit tests etc.) Dependent Variable KPIs (e.g. On/Off Status; Prediction Error test; limit tests etc.) Automated data collection Auto data preprocessing Calculations applied to remove outliers, bad values etc. Online model identification Online model viewing and export Model fidelity tests Fully integrated with Production Control Web Viewer for remote support Aspen DMCplus Modernization and Streamlined Workflow -Solution 129599 Aspen Advanced Process Control - APC - Simplified Installation -Solution 129604 Adaptive Modeling -Solution 129617 Learn More The Release News page on the online support center contains the release information specific to aspenONE V7.2 Manufacturing Suite of products. Getting aspenONE V7.2 The 7.2 release of aspenONE V7 is available upon request starting Tuesday, July 6, 2010. To learn how to obtain your software, click here. Keywords: References: None
Problem Statement: Where can information be found to interpret Aspen Cim-IO error codes?
Solution: The directory C:\Program Files\AspenTech\CIM-IO\etc contains the .def files for the available Aspen Cim-IO interfaces. These .def files contain the messages associated with each error code generated by that interface. Each interface has it's own Facility Number, for instance, the Facility number for the Aspen Cim-IO to Opc is 77. There are also a series of error messages that being with this facility number. For instance error message 77031 would be found in the cimio_opc.def file, NOVALIDITEMS,77031,No Valid Items in the list, all the tags in the list are invalid. Once in the C:\Program Files\AspenTech\Cim-IO\etc directory, you can do a search on the error number, or perhaps the facility number, either search would lead you to the appropriate definition file. Keywords: None References: None
Problem Statement: Consumption of token becomes 1.5 token/MV when Aspen Watch is installed in addition to DMCplus even if Aspen Watch is not monitoring DMCplus controllers.
Solution: Create AWENB entry at general section of CCF and set its value to 0. And, token consumption will be 0.5 token/MV as documented in the license agreement. Keywords: Token AWENB Licensing References: None
Problem Statement: How to export Aspen Basic Engineering data to an XML file for Smartplant P&ID?
Solution: You must set TEFEnabled to True and Framework::Version must be set to the Installed SmartPlant Foundation (SPF) version within your workspace configuration. For example, following enables SPF integration and declares the installed version: TEFEnabled =True Framework::Version = 4.3 Aspen Basic Engineering (ABE) can produce xml file which can be imported in SmartPlant P&ID. This report is generated by a rule or method available in the KB file ZySPInterface. The filename ZySPInterface needs to be added in the list of KBScript of the library configuration file (e.g. StandardLibrarySet.cfg). When this kb file is loaded in the workspace, the user can generate the report using the rule Export all to Smart Plant P&ID where all the valid items will be exported in the xml file or the method Export item to Smart Plant P&ID can be used to export only one item in the xml file. The xml file will be generated in the workspace directory. Keywords: Intergraph Smartplant Rule KB References: None
Problem Statement: In the attached aspenONE V7.1 document under VMware Virtualization, it is stated that version 2 is a supported platform. Is this the ESX version, if so version 2 is several years old and we are currently at version 3.5.
Solution: AspenTech has tested VMware Workstation 6.5 and VMware Server 2.0. We have not test on VMware ESX for V7.1. Keywords: Virtualization ESX VMware References: None
Problem Statement: What is the significance of rank 1000 for a control variable (CV) limit/external target (ET)? and when it should be used?
Solution: Rank 1000 allows implementation of soft constraints on a DMCplus controller. The steady state optimizer (SSO) in DMCplus engine performs two sets of calculations: · The first part is feasibility check where all the CV limits/ET are checked for feasibility in increasing rank order. For more information about CV ranking, seeSolution 136542. · The second part of the SSO is to minimize the overall cost of the controller or operate the controller at its economic optimum. This only happens if there is more than one feasibleSolution after the feasibility check. The cost functions used for this calculation is determined as the sum of all MVs's changes multiple by their respective steady state cost. Typically, any CV limit/ET would have to be satisfied before any optimization occurs. However, any CV limit/ET placed in rank 1000 would not be solved during the feasibility check. It is solved together with the economic optimization (MV costs). The SSO minimizes the overall cost that includes MV cost as well as any weighed CV limit/ET violations (the weighting factor is the inverse of the user-specified steady state (SS) ECE values. It is now possible to trade off between CV limit/ET violations and MV cost. For example, if pass-balancing CVs are not in the rank 1000, the controller will always balance the passes first before pursuing other economics objectives such as maximizing throughput. If the pass-balancing CVs are placed in rank 1000, the tuning (MV costs and SS ECE) determines whether the controller should pass-balancing before maximizing throughput or it should forgo pass balancing in favor for maximizing throughput. Because it is possible to give up on CV limit/ET in rank 1000 in favor of economics objectives, they are called soft constraints. Keywords: Rank 1000 Soft constraints DMCplus References: None
Problem Statement: Logical condition tests involving single precision Aspen InfoPlus.21 (IP.21) variables do not work correctly under some conditions (depending on the original value in IP.21). Here's an example script, using the IP_AnalogDef record Precision_Test, which will help you reproduce the problem: -- ------ Start of script -- Setup: need to create the RealFormatDef record F26.15 -- and the IP_AnalogDef record Precision_Test LOCAL value REAL, dbvalue REAL; value = 7.3; Precision_Test.ip_input_value = value; dbvalue = Precision_Test.ip_input_value; write cast(value as char using 'F26.15'); write cast(dbvalue as char using 'F26.15'); IF value < dbvalue THEN write 'Less than'; ELSE write 'Not less than'; END IF value = dbvalue THEN write 'Equal'; ELSE write 'Not equal'; END IF value > dbvalue THEN write 'Greater than'; ELSE write 'Not greater than'; END -- ------ End of script On execution, the script gives this result: 7.30000000000000 7.30000019073486 Less than Equal Not greater than The results depend on the value used (for instance, 8.4 gives Equal to and Greater than), while integer values, and halves (like 7.5, 8.5, etc.) work properly.
Solution: This conflict occurs because records such as IP_AnalogDef use single precision reals, whereas SQLplus only uses double precision. The above SQL script can be made to work correctly by changing the following two lines: Precision_Test.ip_input_value = value; dbvalue = Precision_Test.ip_input_value; to: Precision_Test.ip_input_value= ROUND(value,1); dbvalue= ROUND(Precision_Test.ip_input_value,1); Many thanks to Johan Asting of Borealis in Sweden for contributing this information. Keywords: round cast References: None
Problem Statement: Is it possible to break out of a FOR loop before its set number of iterations?
Solution: There are several ways to handle this. 1. Using an Error Handling Block 2. Using a nested IF statement 3. Using a WHILE statement. 4. Using a function call with a return statement. One might think that forcing the counter to its limit or beyond its limit would cause the looping to stop. This does not work. The following example demonstrates this. local x int; local y int; local z int; y = 2; for x = 1 to 10 do z = x + y; write 'z = ' || z; if z = 5 then x = 11; end write 'x = ' || x; write ' '; end; write 'Loop ended.'; This results in the following output. x = 11 z = 6 x = 4 z = 7 x = 5 z = 8 x = 6 z = 9 x = 7 z = 10 x = 8 z = 11 x = 9 z = 12 x = 10 Loop ended. As evidenced by these results, changes to X inside the loop are only temporary (inside the loop). The variable is later updated by the loop as if nothing has happened. The loop simply continues processing where it left off. Method 1 Error Handling An Error Handling Block can be added around the FOR loop. Then, by forcing an error inside the loop, you cause the logic to jump to the Exception logic. An example of using an Error Handling Block is given below: local x int; local y int; local z int; y = 2; begin for x = 1 to 10 do z = x + y; write 'z = ' || z; if z = 5 then ERROR 'MY_ERROR_CODE', 'Want to break out'; end write 'x = ' || x; write ' '; end exception write 'Loop ended.'; end This results in the output: z = 3 x = 1 z = 4 x = 2 z = 5 Loop ended. In the EXCEPTION block, you need to have at least one statement, even if it doesn't really do anything. You can also substitute your own error code for MY_ERROR_CODE and use a CASE statement inside the EXCEPTION block to determine which error was encountered. But, for this example, that is not required. More information about using an EXCEPTION statement can be found in the SQLplus User's Manual. NOTE: There is a side effect to using the EXCEPTION block. When triggering an error, SQLplus resets the OUTPUT to the default destination. Therefore, if you have set the output to another location, you must reset it after the error occurs. This can be done either inside or after the EXCEPTION block. Method 2 Nested IF Statement An IF statement can be added inside the FOR loop to determine if the logic needs to be processed. With this method, the loop does execute all the way through and the IF statement is executed every time. However, logic inside the IF statement is only processed when the conditions are met. for x = 1 to 10 do if answer_found <> 1 then z = x + y; write 'z = ' || z; if z = 5 then answer_found = 1; end; write 'x = ' || x; x = x + 1; end; -- answer found <> 1 end; write 'Loop ended.'; This results in the output: z = 3 x = 1 z = 4 x = 2 z = 5 x = 3 Loop ended. Method 3 WHILE Statement A WHILE statement can be used in place of an IF statement. When using a WHILE statement, the query writer is responsible for incrementing any counter. A counter is not necessary in a WHILE loop (unless the counter is required by logic within the loop). The WHILE statement only needs a criterion telling the loop to continue as long as the criterion is met. local x int; local y int; local z int; local answer_found int; y = 2; x = 1; answer_found = 0; while x <= 10 and answer_found <> 1 DO z = x + y; write 'z = ' || z; if z = 5 then answer_found = 1; end write 'x = ' || x; x = x + 1; end; write 'Loop ended.'; This results in the output: z = 3 x = 1 z = 4 x = 2 z = 5 x = 3 Loop ended. Method 4 Function Call Another way to exit the FOR or WHILE loop is with the RETURN statement. This statement is used to exit (return from) a function or procedure. This method is a more complex. However, it is valuable when compartmentalizing logic that will be used in more than one place within the query. function loop_function(z int) local x int; local y int; y = 2; for x = 1 to 10 do z = x + y; write 'z = ' || z; if i = 5 then return; end write 'x = ' || x; end end This results in the output: z = 3 x = 1 z = 4 x = 2 z = 5 For more information, please consult the Aspen SQLplus Help Files. Note that GOTO appears in the SQLplus Help files index, but this is just because it is a reserved keyword according to the ANSI standard. It is not in fact implemented in Aspen's SQLplus product. Keywords: for loop break exit go to while exception return References: None
Problem Statement: How to put the result of a Select statement (i.e. Select_Description) into a character variable.
Solution: Here is an example query that would put the result of a Select statement (i.e. Select_Description) into a character variable: local temp char (20); temp = (select select_description from eng-units where OCCNUM=2); write temp; If you would like to capture more than one variable, you can use a FOR loop (even though it will only go around the loop once). Here is the syntax: local temp char (20); local temp2 char (20); for (select name,select_description from eng-units where OCCNUM=2) do temp = name; temp2 = select_description; end write temp; write temp2; Keywords: character variable References: None
Problem Statement: How can Aspen SQLplus display more than 80 characters per line from ASCII files?
Solution: Specify the line length in the select Statement For example: SELECT line width 132 FROM 'c:\autoexec.bat' Keywords: References: None
Problem Statement: How to INSERT into a record whose name is a variable.
Solution: Use a sub-query with the record name as a parameter. I.E. To insert a value into every discrete record: EXAMPLE #1 FOR select name from IP_DvDef do START Record'UpdateDvDef',name END Query Record UpdateDvDef contents Insert INTO &1 (TRENDTIME) Values (CURRENT_TIMESTAMP) EXAMPLE #2 local rname record; local ptime timestamp; local rvalue int; rvalue = 80; rname = 'atcai'; ptime = '23-sep-04 13:42:01'; START 'sub.sql',rname,rvalue,ptime --This file is saved as sub.sql in the group 200 folder Insert INTO &1 (ip_trend_value, ip_trend_time) Values (&2, '&3') Keywords: variable sub-query References: None
Problem Statement: Technical Advisory: CIM-IO to replace Scan/21, Phoenix and Direct Connect interfaces by early 2000
Solution: With the powerful and robust technology that is available in the latest version of our products, Aspen is supporting some of its older interfacing methods by providing a path forward to our current interface technology, CIM-IO. Aspen Tech will be retiring all current SCAN/21 interfaces when InfoPlus.21 v3.0 is released in early 2000. Aspen Tech Support will work with all current CIM/21 customers to migrate the existing SCAN/21 interfaces over to CIM-IO. Setcim and InfoPlus-X customers can continue to use Direct Connect and Phoenix interfaces, but should be aware that the support path forward is migration to CIM-IO. Setcon and InfoPlus customers should be aware that the migration path to CIM-IO must also include an update of the historian. CIM-IO is the standard interface used by all Aspen Tech products such as InfoPlus.21 and DMCplus. The CIM-IO interfaces and CIM-IO Bridge (Scan/21 for CIM-IO) are available to all customers with current support contracts at no additional license fee. If custom utilities exist, it will be necessary to work with the Services group to determine what modifications are necessary and arrange for a quote for those services. If you need to order the CIM-IO Bridge, please contact the Seattle Support group to discuss migration. For the CIM-IO equivalent of a Phoenix or Direct Connect interface, please contact the Houston Support group. The linked Microsoft Word document above has a table which shows the particular migration path for specific Phoenix and Direct Connect interfaces. Aspen Technology, Inc. Worldwide Customer Support http://support.aspentech.com/ AspenTech Support, Seattle Toll free: (888) 996-7002 Phone: (425) 492-2145 mailto:[email protected] AspenTech Support, Houston Phone: (281) 584-4357 mailto:[email protected] Keywords: None References: None
Problem Statement: A delay may appear when using the Aspen SQLplus SYSTEM command to check files and folders in Windows Server 2008 or Windows Vista when compared to accessing the files directly from Windows Explorer. This knowledge base article describes the cause of this delay and the re
Solution: .Solution In Windows Vista and Windows Server 2008 a new Server Message Block file sharing protocol was released. Server Message Blocks Protocol (SMB) is the file sharing protocol used by default on Windows-based computers. SMB 1.0 was designed for earlier Windows network OS such as Microsoft LAN Manager and Windows for Workgroups, but until Windows Server 2008 and Vista, all Microsoft-based operating systems continued to use it more or less in its original format. Below there are methods for changing both client and server, and when using the terms client and server it does not mean that a client OS such as Windows Vista always connects to a server OS such as Windows Server 2008. Sometimes a Vista computer will connect to another Vista computer and, in that case, the computer that is serving the shares is considered to be the server. To disable SMB 2.0 for Windows Vista or Windows Server 2008 systems that are the client systems run the following commands in a DOS command prompt box: sc config lanmanworkstation depend= bowser/mrxsmb10/nsi sc config mrxsmb20 start= disabled Note there's an extra (space) after the = sign. To enable back SMB 2.0 for Windows Vista or Windows Server 2008 systems that are the client systems run the following commands, again in a DOS command prompt box: sc config lanmanworkstation depend= bowser/mrxsmb10/mrxsmb20/nsi sc config mrxsmb20 start= auto N.B. The following changes require editing the registry. Always back up the system registry prior to making any changes. In order to disable SMB 2.0 on the server computer: 1 ) Run regedit on Windows Server 2008 based computer. 2 ) Expand and locate the sub tree as follows: HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters 3 ) Add a new REG_DWORD key with the name of Smb2 (without quotation mark) Value name: Smb2 Value type: REG_DWORD 0 = disabled 1 = enabled Set the value to 0 to disable SMB 2.0, or set it to 1 to re-enable SMB 2.0. 4 ) Reboot the server. Keywords: SMB System Command References: None
Problem Statement: Aspen InfoPlus.21 can be configured as 'Linked Server' in Microsoft SQL Server. This
Solution: explains the way of executing an Aspen SQLplus query in Microsoft SQL Query Analyzer or Microsoft SQL Server Management Studio.Solution Usually all Linked server data is accessed through 'EXECUTE' command in Microsoft SQL Server. Following is the sample syntax for using EXECUTE command in Microsoft SQL Server. EXECUTE (<Statement1; statement2;statement n>) AT <name of the Linked Server> Example: EXECUTE('select name,ip_input_value,ip_input_time from IP_Analogdef') AT InfoPlus21 Where EXECUTE is a Microsoft SQL command 'select name, ip_input_value, ip_input_time from IP_Analogdef' - is a Aspen SQLplus statement InfoPlus21 is a name of the linked server configured in the Microsoft SQL Server. Keywords: Execute link linked SQL References: None
Problem Statement: SQLplus is not returning the output in the same order as it appears in the CROSS BY query
Solution: SQLplus does not adjust the order of the results of a query. It simply returns the results of a query in the order the data is returned from the database, by record ID, which may or may not be the same order of the script itself. If you want to control the order of the columns, use a JOINS query (instead of CROSS BY), like the following example: select a.ts, a.value as ATCL102, b.value as ATCAI, c.value as ATCL101 from history a, history b, history c where a.name = 'ATCL102' and b.name = 'ATCAI' and c.name = 'ATCL101' and a.ts between '13:00' and '14:00' and a.period = 00:01:00; With this query, the output columns will be displayed in the order they were requested. Keywords: References: None
Problem Statement: It sometimes becomes necessary to exit a WHILE loop if more than one condition is met. Although this feature is not documented, it is supported in SQLplus. An example of when this might be useful is when one needs to limit the maximum number of iterations in a convergence loop.
Solution: In this example, one has a WHILE loop to check convergence of a value as is common in many thermodynamic calculations. Full convergence calculations are not done here so that this example can stay as simple as possible. There are two points to notice in this script. Namely, changing the value of i to less than 0.1 will stop the loop. If this is set before the WHILE loop, then the loop will never execute. In addition, when the loop counter equals 15 the loop will stop. -- beginning of example script, this script will run in SQLplus LOCAL x REAL; -- this could be a convergence check. LOCAL j INTEGER; -- this could be a loop counter set at 15 x = 0.2; -- loop convergence variable is initialized here but should actually be calculated in the WHILE loop j = 0; WHILE (j < 15 AND x > 0.1) DO -- 0.1 is the tolerance for the convergence -- do some calculation on x for convergence such as x = ABS( temp2 - temp1 ) / temp1 j = j + 1; WRITE ''x = ''|| x || '' j = ''|| j ; END; -- end of example script Keywords: WHILE loop counter convergence tolerance exit References: None
Problem Statement: When trying to run SQLplus v4.8 on HPUX v10.2 the following error message is received: /usr/lib/dld.sl: Can't find path for shared library:libX11.1
Solution: Add the three additional links to the installation script in the lib directory under the Setcim root directory: ln -s /usr/lib/Motif1.2/libXm.1 $SETCIMLIB/libXm.1 ln -s /usr/lib/X11R5/libXt.1 $SETCIMLIB/libXt.1 ln -s /usr/lib/X11R5/libX11.1 $SETCIMLIB/libX11.1 Keywords: install script lib shared library References: None
Problem Statement: The following Daylight Savings Time adjustment to the cimio_timezone.def file is required for Cim-IO Core running on OpenVMS (VAX or ALPHA), when the system time is changed to daylight savings (DST) or Standard Time (ST). If the Cim-IO client or server is running on OpenVMS the cimio_timezone.def file must be adjusted to ensure the data going into SetCim or Infoplus.21 has the correct time relative to UTC (GMT). The Cim-IO client or server running on OpenVMS must be restarted to recognize the new value in the cimio_timezone.def file. Note: This change is not required if running SetCim Version 4.6 or earlier and both the Cim-IO client and server are on the same OpenVMS host machine.
Solution: Suggested procedure for adjusting cimio_timezone.def on a OpenVMS host: 1. Stop Cim-IO client and/or server. 2. Adjust the VMS system time. 3. Edit the value in the file cimio_timezone.def (usually found in the location SETCIM:[ETC] or CIMIOROOT:[ETC]) and adjust it to reflect the current offset between VMS system time and UTC (GMT). The number entered is an integer number representing the whole hour offset between VMS system time and UTC, expressed as a positive value for time zones west of (GMT) and a negative value for time zones east of (GMT). 4. Restart Cim-IO client and/or server. Examples (northern hemisphere): For Houston, Texas which is west of Greenwich the local time offset to UTC(GMT) is 6 hours standard time and 5 hours daylight savings time. The cimio_timezone.def file on a OpenVMS machine would be edited and the current entry of 6 would be changed to 5 for the change to DST. In the fall the reverse change would be made to this file to change from DST to standard time. For Berlin, Germany which is east of Greenwich the local time offset to UTC is 1 hour standard time and 2 hours daylight savings time. The cimio_timezone.def file on a VMS machine would be edited and the current entry of -1 would be changed to -2 for the change to DST. In the fall the reverse change would be made to this file to change from DST to standard time. Keywords: cimio daylight savings UTC GMT offset References: None
Problem Statement: I have a stream that runs at certain times of the day, but will vary from day to day and I want a way to show the data from the most recent run time of the stream as a table in AspenOne Process Explorer. The data shown should be the stream's flow rate and the times should be equally incremented over the run-time of the stream.
Solution: ThisSolution documents a method to use Aspen SQLplus in order to write stream values at four equal time intervals that update live as a stream is running and displays the quarter marks for the most recent run if the stream is inactive. For this example, suppose a stream's flow rate is stored in tag ATCAI and the value is displayed as 0 when it is not running. Doing this will require storing a Aspen SQLplus script to activate when the stream receives a new value into the Aspen InfoPlus.21 database as well as the creation of one new tag for each slice of time that the data is needed for. To do this, we will define endpoint variables that show the start and end times of the stream and the remainder of the variables will be used to store data into the newly created tags in the Aspen InfoPlus.21 database. In the example below, we wish to store the information for when the stream ATCAI is running, which is denoted if the tag value is greater than 0. ATCAITEST1, ATCAITEST2, ATCAITEST3, ATCAITEST4 being the four equally incremented time periods where we are outputting information. The following query will put the timestamp of the query into the description field and will put the value of the tag at that timestamp into the input value field: local A,B,C,D; --A and B for time endpoints, C for the time increment, D for storing retrieval time A = (select IP_TREND_TIME from ATCAI where IP_TREND_VALUE <= 0); B = (select IP_INPUT_TIME from ATCAI); C = (A-B)/4; D = Cast (C+B as timestamp); update ATCAITEST1 set IP_DESCRIPTION = (Cast (D as char)); update ATCAITEST1 set IP_INPUT_VALUE = (select IP_TREND_VALUE from ATCAI where IP_TREND_TIME < D); D = Cast (C+D as timestamp); update ATCAITEST2 set IP_DESCRIPTION = (Cast (D as char)); update ATCAITEST2 set IP_INPUT_VALUE = (select IP_TREND_VALUE from ATCAI where IP_TREND_TIME < D); D = Cast (C+D as timestamp); update ATCAITEST3 set IP_DESCRIPTION = (Cast (D as char)); update ATCAITEST3 set IP_INPUT_VALUE = (select IP_TREND_VALUE from ATCAI where IP_TREND_TIME < D); D = Cast (C+D as timestamp); update ATCAITEST4 set IP_DESCRIPTION = (Cast (D as char)); update ATCAITEST4 set IP_INPUT_VALUE = (select IP_TREND_VALUE from ATCAI where IP_TREND_TIME < D); To automate this query, simply go to Record | Save and name the QueryDef or CompQueryDef record and assign it a task for processing. Once that is complete, go to the Aspen InfoPlus.21 Administrator and find the Query that was just written and change the #WAIT_FOR_COS_FIELDS to 1 and specify the change of state parameter to run the query whenever the stream is active. For this example, the field will be set to >0 as the stream is active as long as the value is positive. This way, the tags will stop updating when the stream turns off and only the most recent stream data is shown. The current values and description of the tags ATCAITEST# will show the value at the timestamp shown in the description. The values will show up equally incremented in time. The following is a sample calculation made using thisSolution The tag values can now to used in a table and when published to AspenONE Process Explorer, will be published in real time Keywords: Display custom stream data References: None
Problem Statement: This is a sample script to replace the now obsolete s21ascinsert utility. S21ascinsert was used by customers for this scenario: Programs external to Aspen software write ASCII files to a specified directory. The scanner detects the files, extracts the data in the files, inserts it to the database, then deletes the file(s) from the directory.
Solution: To run this utility you run the s21ascins.SQL script from sqlplus. There are three scripts. You have to change the filepath to find the scripts or load the scripts to a record. Change data_filepath to the directory for your input files, and change the out_filepath to a temp directory. s21ascins.SQL: Keywords: None References: None
Problem Statement: How can I dump the result of a SQLplus query onto a log file?
Solution: If you need to dump the results of a SQLplus query onto a log file, you will need to use SET OUTPUT SET OUTPUT = 'C:\Logfile.log' This way, the output of the query instead of being displayed in the bottom windows of SQLplus Query Writer, is written onto the specified file. Example: SET OUTPUT = 'C:\Logfile.log'; WRITE 'The query was run at this time:'; WRITE GETDBTIME; SELECT NAME,IP_DESCRIPTION,IP_INPUT_VALUE IP_INPUT_TIME FROM ATCL101 Output on Logfile.log The query was run at this time: 30-SEP-11 16:21:21.4 NAME IP_DESCRIPTION IP_INPUT_TIME ------------------------ Keywords: None References: None
Problem Statement: How to determine how a query has been started.
Solution: Aspen SQLplus has two internal functions 'ACTIVATION_RECORD' and 'ACTIVATION_FIELD', which return the current activation criteria. The 'ACTIVATION_FIELD' only returns a value when the activation method is COS, ACTIVATION_RECORD is set on both COS and normal activation's. Example IF CHARACTER_LENGTH(ACTIVATION_FIELD) > 0 THEN Write 'COS Activation'; ELSE IF CHARACTER_LENGTH(ACTIVATION_RECORD) > 0 THEN Write 'Normal Activation'; ELSE Write 'Query Builder Execution'; END END Keywords: activation, COS References: None
Problem Statement: How to tell if a parameter is present in a parameterized query.
Solution: Test the length of the parameter. I.e. IF CHARACTER_LENGTH('&1') > 0 THEN Keywords: parameter character length References: None
Problem Statement: How do I check IP_ALARM_STATE with SQLplus?
Solution: If you want to check the Alarms using SQLplus you can query IP_Alarmsummary as follows: SELECT Summary_line, *SUMMARY_LINE FROM IP_Alarmsummary *SUMMARY_LINE is a FIELD POINTER Keywords: SQLplus Alarms References: None
Problem Statement: The purpose of this
Solution: is to outline how to solve the problem where data coming into a Setcim or InfoPlus.21 database from a Cim-IO server running VMS is timestamped differently from the current, system time. The symptoms of the problem are: The system time on both the I+.21 server/Cim-IO client (NT) are current, and the timetamp on the Cim-IO server (VMS) is also current. Running the Cim-IO test program (cimio_t_api) on both the Cim-IO server and client returned the current time (using #1: Test Cim-IO time functions). The Get record containing the data records (i.e analog records, discrete records, etc.) have an IO_LAST_UPDATE of the current time (IO_LAST_STATUS can be Success). When manually inputting data into the IP_INPUT_VALUE field of the analog record, it updates the IP_INPUT_TIME with the current time. The only place that the timestamp is not the current time is in the IP_INPUT_TIME field of the analog record when it is updated by Cim-IO, and as a result, the IP_VALUE_TIME and IP_TREND_TIME's (and in the historian).Solution The reason for this problem is that the time server call that VMS systems make return GMT. It is necessary to tell Cim-IO how many hours it must add or subtract to or from GMT to get the local time. The CIMIO_TIMEZONE.DEF file is used for this purpose. The CIMIO_TIMEZONE.DEF file is located on both the Cim-IO server and the Cim-IO client: Cim-IO Server: $CIMIOETC Cim-IO Client: %SETCIMETC% In this file, you make a single entry: a signed integer representing the number of hours west (positive) or east (negative) of GMT, with the appropriate sign. IMPORTANT NOTES: *** This change should be made on the Cim-IO server file. *** For positive time differences (i.e west of GMT), you do not have to enter the + sign: simply enter the hour integer value. Keywords: References: None
Problem Statement: Error : 1114. Failed to Connect to Link IP21: Specified Driver could not be loaded due to system error 1114 当在 Aspen SQLplus 配置 ODBC OAM Connection 的时候,为什么会出现如上错误1114?
Solution: 如果系统变量没有正确的配置,那么当创建新的Oracle database的ODBC OAM Connection 的时候就会出现以下的错误讯息。 为了解决此问题,需要在系统变量 Path 中添加正确的 BIN 文件夹路径。 此问题是 ORACLE 相关的错误,而且已经记录在Oracle的文档中。 Keywords: 1114 system error ODBC SQL CN- References: None
Problem Statement: How can I send an e-mail through Microsoft Exchange 2010 using a query.
Solution: The following query sends an important e-mail through Microsoft Exchange 2010 and attaches the file dbclock.out. -- This query sents a simple important e-mail through Microsoft Exchange 2010 -- and attaches tsk_dbclock.out. local objOutLook; local itemMailOutLook; -- -- Declare objects for Microsoft Outlook Application and e-mail item -- objOutLook=CreateObject('Outlook.Application'); itemMailOutLook=objOutLook.createitem(olMailItem); -- -- Fill in fields for the e-mail recipient and subject line -- itemMailOutLook.to = '[email protected]'; itemMailOutLook.subject = 'Test Message'; -- -- Add the body of the message -- itemMailOutLook.body = 'This is a simple important message'; -- -- Set the importance of the message to olImportanceLow, olImportanceNormal, or olImportanceHigh -- itemMailOutLook.importance = olImportanceHigh; -- -- Attach a file -- itemMailOutLook.attachments.add('C:\ProgramData\AspenTech\InfoPlus.21\db21\group200\tsk_dbclock.out'); -- -- Send the message -- itemMailOutLook.Send; Before running the query, you must include the com object for Microsoft Office by selecting View-> Keywords: e-mail Microsoft Office Microsoft Outlook References: s from the Aspen SQLplus tool bar and including the Microsoft Office Office Library. Also, Microsoft Exchange 2010 must be installed on your Aspen InfoPlus.21 server.
Problem Statement: 在Aspen SQLPlus运行SQL脚本时出现如下错误
Solution: 此问题是因为在算术计算中没有说明数据类型而使用本地变量。 如果本地变量没有说明数据类型,那么默认为Variant本地变量。 在SQL脚本中可以用下列语句定义变量的数据类型。 LOCAL variable_name <data_type> Keywords: variant arithmetic failed variant CN- References: None
Problem Statement: How do I add an external task into the Aspen InfoPlus.21 Manager list of defined tasks without actually using the Aspen InfoPlus.21 Manager to do so?
Solution: You can use Aspen SQLplus to call the Aspen InfoPlus.21 utility TSK_CLIENT which can be found in the default code directory for Aspen InfoPlus.21 (<drive>:\Program Files\AspenTech\InfoPlus.21\db21\code, where <drive> is the disk drive where InfoPlus.21 is installed). Below is an example SQL script which will add an external task called TSK_M_TEST. LOCAL name CHAR(4); name = 'TEST'; SYSTEM '..\code\tsk_client /add_task %SETCIMCODE%\cimio_c_client.exe /name=TSK_M_' || name; Keywords: None References: None
Problem Statement: When trying to connect an aspen SQLplus client to an Aspen InfoPlus.21 server, the following error messages may sometimes appear: Error: Unable to get client user context Error: Unable to access a secured SQLplus server due to incompatible SQLplus client!
Solution: The problem is that the SQLplus server task is unable to find out who you are logged in as. Usually it relates to Win9x client PC's that do not use secure login or clients that are not on a (trusted) Windows domain. The problem has at its core Windows authentication problems. The SQLplus server task at the InfoPlus.21 node doesn't recognize the Windows account used by the client node. To bypass this problem, add a -n to your port number in the command line parameters of your TSK_SQL_SERVER task in the IP.21 manager. Your command line parameters should then look like this: 10014 -n. This will allow the SQLPlus client machines to connect without authenticating the users, but you will not be able to use security. If you would like to restrict your users from writing data via SQLplus to the IP.21 database, you can add a -r so the command line parameter becomes: 10014 -n -r Keywords: SQLplus SQLPlus References: None
Problem Statement: There may be situation in which you want to retrieve information on what machines are connecting to the Aspen InfoPlus.21 database using Aspen InfoPlus.21 Administrator, Aspen Process Explorer, Aspen SQLplus Query Writer, etc. This
Solution: aims to provide an example of how an Aspen SQLplus script can be used to retrieve the machines that are connected.Solution There are a few important points to note. 1. The account used to run the Aspen SQLplus script must have permission to Windows Management Instrumentation (WMI). 2. The WMI version must support the use of CommandLine property from Win32_Process. This is a new property for Windows XP. Windows 2003 Server has this new property. 3. The account must have permission to execute SYSTEM command in Aspen SQLplus. 4. The account must have permission to execute Netstat. 5. Netstat must be able to display active TCP connections and includes the process ID (PID) for each connection. This will mean that the -o option is available to be used with Netstat. This parameter is available on Microsoft Windows XP and Windows Server 2003. 6. The Aspen SQLplus script is written to run on the Aspen InfoPlus.21 machine though you should be able to modify it to run on a remote machine. The attached Aspen SQLplus script will be able to list out the connections to the following tasks: TSK_ADMIN_SERVER TSK_APEX_SERVER TSK_EXCEL_SERVER TSK_DEFAULT_SERVER TSK_BATCH21_SERVER TSK_SQL_SERVER The attached SQL script is provided AS IS to provide a sample and will not be supported by AspenTech Support. Additional Tips: For TSK_SQL_SERVER, the Aspen SQLplus script is written to detect the default port, 10014. If you are using any other port, changed the line which is assigning the variable SQLport to the port you used. If you are unable to create WMI in Aspen SQLplus but are able to use WMI through command cscript.exe execution, rewrite the WMI portion to be executed through cscript.exe and have the output written to a file. In Aspen SQLplus, you will need to have permission to the SYSTEM command in order to execute cscript.exe. You will need to simply read the output file of WIMI execution using cscript.exe to update the Process ID of the tasks into the temporary table MODULE.Task. If you are going to save the Aspen SQLplus script as a QueryDef record, note that the script is not written to take into account of the 80 characters length limit of QueryDef. Some modification may be needed. Alternatively, you can save it as a CompQueryDef. You can create custom definition and another set of Aspen SQLplus script that will update the custom definition with the information such as timestamp, task, foreign IP.address. In this way, when it is scheduled to run frequently, with the timestamp of the start of the connection and end of the connection, you can approximate the length of time for the connection and the period of connection. You can choose to use Aspen InfoPlus.21 historian or any other relational database to store the information. Keywords: SQL connection TSK_ADMIN_SERVER TSK_APEX_SERVER TSK_EXCEL_SERVER TSK_DEFAULT_SERVER TSK_BATCH21_SERVER TSK_SQL_SERVER References: None
Problem Statement: How can I connect my SQLplus Query Writer tool to my Setcim or IP-X on an Alpha via ODBC but have it be read-only?
Solution: To Change An Existing Service to Read-only: Login to Alpha Type UCX to enter UCX management tool. Type show services to see existing services. Find the SQL service (something like SQLP10014, SQLPportnumber ,SQLPxxxxx). Disable the current SQL service by typing disable service SQLPxxxxx Change the command file that the service points to. The existing file should be SETCIMCOM:SQLPLUSNET.COM. This will be changed to SETCIMCOM:SQLPLUSNETRO.COM. Type: set service SQLPxxxxx /file=SETCIMCOM:SQLPLUSNETRO.COM Make the service enabled again by typing enable service SQLPxxxxx Check the service to make sure it is configured with the correct file by typing show service SQLPxxxxx /full You should be able to connect to the port number through ODBC, but as a read-only connection. You can test this by trying to update something through SQLplus on a PC. The SQLPLUSNETRO.COM is a small com file to handle the VMS command procedures. Basically, your SQLPLUSNETRO.COM file is a copy of your SQLPLUSNET.COM file with a few modifications. Set your privileges (suggest TMPMBX, NETMBX), set up a symbol for the sqlplusnet.exe, and then pass the symbol a parameter of r for read only. Then comment out the line that RUNs the .EXE. Keywords: read-only Setcim IP-X References: None
Problem Statement: This Knowledge Base article describes how to construct a loop in Aspen SQLplus which loops through the elements in descending order. For example, instead of looping from 1 to 10 (ascending order), loop in descending order -- from 10 down to 1.
Solution: Below are two Aspen SQLplus code examples which illustrate how to accomplish this: LOCAL x INTEGER; LOCAL y INTEGER; FOR x = 1 to 10 DO y = 10 - x; WRITE y; END In the above example, the FOR LOOP is still processing in ascending sequence (the x variable). However, the y variable can be used as the descending variable in the rest of the query. LOCAL x INTEGER; x = 10; WHILE x > 1 DO WRITE x; x = x - 1; END In the above example, the x variable can be used as the descending variable. Keywords: order structure References: None
Problem Statement: When I attempt to include the Microsoft Excel 12.0 object library in SQLPlus (View ->
Solution: 117590). Solution In order to successfully reference Microsoft Excel 12.0 Object Library, it is necessary that Microsoft Office 2007 has been installed on the InfoPlus.21 Server as well as the workstation running the Client software. The reason why it is possible to use the library in Process Explorer but not in AspenTech SQLPlus is due to the fact that the Client machines uses the InfoPlus.21 Server reference list. This as opposed to Process Explorer VBA which gets the reference information from the local Client machine registry. Keywords: SQLplus Excel Query COM object References: s) there is a problem and it is reported as not being available. It is however possible to find the object library using Process Explorer (Visual Basic (Tools > References). The object library is used for a number of advanced functionality such as Sending SQLplus query output directly to an EXCEL spreadsheet using a COM object (Knowledge Base
Problem Statement: Why can't I use the value of a MACRO definition immediately after defining it?
Solution: SQLplus requires a statement between the MACRO definition and its use. This statement can be anything including a null statement (;). For Example, the following does not work: MACRO TestMacro='RC345'; '&TestMacro'->Value=10; The problem is that SQLplus has read the next token after the ; before it has executed the macro statement. This only happens when the macro is used in the first token after the ;, so the following two examples work. The first, because an additional ; was added and the second, because the macro isn't the first token after the ; MACRO TestMacro='RC345';; '&TestMacro'->Value=10; MACRO a 'DefinitionDef'; SELECT * FROM &a; Keywords: macro References: None
Problem Statement: Why does SQLPlus return only 99 columns when using the Cross By query?
Solution: There is a limit on the number of columns in a cross query. The default for this limit is 100 but a different Value can be specified with a FIRST clause after the BY. Example: Select ts, max(value) by name first 200 from history Where name in (select name from ip_analogdef) Group By ts; Keywords: column First By SQLplus Cross By References: None
Problem Statement: A user is trying to create an event from an Aspen SQLplus script using 'e21_chg_key' and 'e21_rec_evnt' commands but SQLplus does not seem to recognize these commands. This KB article shows a couple of methods to create an event in Aspen Event.21.
Solution: There are two command line programs, e21_chg_keys.exe and e21_rec_event.exe, that can be used to accomplish that. They are located at: Program Files\AspenTech\InfoPlus.21\c21\e21\server\e21_chg_keys.exe Program Files\AspenTech\InfoPlus.21\c21\e21\server\e21_rec_event.exe But some users do not like these .Net versions because they start up slower than when they use the Aspen Event.21 API, which is much faster. The Event.21 API and samples get installed with Event.21 client (PE) to Program Files\AspenTech\APEx\Samples\EventPlots\API Attached to thisSolution is one such SQLplus example we have. Keywords: References: None
Problem Statement: Aspen Process Controller (APC) Online fails to install with a 1722 error on Windows Server 2008 when Firewall is disabled
Solution: Part of the APC Online install is to open ports in the Windows Firewall. If the Firewall is disabled during the install, this part of the install fails with a 1722 error. The Windows Firewall must not be disabled during the install process. Keywords: None References: None
Problem Statement: What files are required when I am asked to submit my workspace libraries to reproduce an issue? What files are required by AspenTech Support to reproduce my issue?
Solution: To reproduce the issue, we need: 1. Workspace libraries 2.Configuration file 3. Backup of the workspace Workspace Libraries The workspace libraries are found on your server machine at the location below: ..\\AspenZyqadServer\AspenZyqadxx.x\WorkspaceLibraries. The best thing would be to zip up your Workspaceslibraries folder. You can keep the path structure when zipping up the folder and files. Configuration file You need to mention that which configuration file (*.cfg) under workspacelibraries folder is used by your workspace or you can send us the workspace.cfg file found in your workspace folder which is typically under ..\\AspenZyqadServer\AspenZyqadxx.x\Workspaces\WorkspaceName folder Backup of the workspace We may need your workspace data to reproduce the issue. You can use backup utility (AZ***Backup.exe) under ..\Program Files \AspenTech\Basic Engineering V*.*\DataServices\bin to create a backup of the workspace. You can checkSolution 127109 to learn how to create backup of the workspace. Keywords: workspace libraries References: None
Problem Statement: How to access the flow of a specific component in a datasheet or label.
Solution: The composite view route linked to the classview attribute must be similar to the following one: MaterialPorts[Name=Inlet].Flow.BulkFlow.Components.MoleFraction[Name=Water] The component name which is case sensitive is specified as condition at the end of the route. An azci file including an example is attached to thisSolution. In this example, the attribute is linked to the mole fraction of water in the inlet port of a Vessel. Keywords: Class Library Editor Composite view Class view Conditional route References: None
Problem Statement: When trying to connect the SQLplus Query Writer Tool on the PC or the SQLplus Query Writer for Motif on the Setcim server to the Oracle database, this error is received: Failed to connect to link <link name>: Error while trying to retrieve text for error: ORA-12203.
Solution: The SQLplus 4.8 User's Manual starting on page 2-3 describes the complete installation and configuration required to run SQLplus. Page 2-10 discusses Enabling Oracle Access. Basically, SQLplus requires Oracle logical names to be defined before it can access the Oracle database. These logical names are set up using an ORAUSER file. This file is usually located at: disk:[oracle7.code.util]orauser.com where disk is the name of the disk where SQL*Net is installed. The manual states that this ORAUSER.COM file should be called from the LOGIN.COM file in the SETCIM:[SQL] directory. Instead, this ORAUSER.COM file needs to be called from the SQLPLUSNET.COM file in the SETCIMCOM directory. Keywords: ORAUSER ORAUSER.COM Oracle ORA-12203 References: None
Problem Statement: If an SQLplus client is attempting to connect to an unresponsive or powered down SQLplus server, the client can take a (seemingly) long time to return a no connect error. However, it is possible to minimize the timeout period by adjusting TCP/IP registry settings. The following Tech Tip provides directions on changing one such variable.
Solution: The timeout period for connecting either the Query Writer or Desktop ODBC to an SQLplus server is partially controlled by the registry setting TcpMaxConnectRetransmissions. This parameter specifies the number of times the server will attempt to retransmit a connection acknowledgement before aborting the connection. On a Windows NT 4.0 computer, the default value for TcpMaxConnectRetransmissions is set to 3. The timeout period for each reconnection is doubled, with an initial timeout period of 3 seconds. This gives a total timeout of 45 seconds (3+6+12+24 = 45) for an NT computer. To help decrease the total timeout period, it is possible to change the TcpMaxConnectRetransmissions setting. This will help lower the amount of time the client needs to acknowledge that the SQLplus server is not responding. This variable is set on the SQLplus client, since it is the machine initiating the request. To set this registry key: Open HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TcpIp\Parameters on the SQLplus client. Create a DWORD value called TcpMaxConnectRetransmissions Set the value to 1, which will give a total timeout value of about 9 seconds (3+6). Reboot the computer for the parameter to take effect. Note: This timeout is the default for all TCP/IP connections, not just SQLplus. Keywords: tcp/ip timeout References: None
Problem Statement: What Aspen InfoPlus.21 tasks are the ProcedureDef records run on? Are these records run by a single Aspen InfoPlus.21 task?
Solution: The Aspen SQLplus product uses external TSK_IQ tasks (i.e. tasks that start an occurrence of the C:\Program Files\AspenTech\InfoPlus.21\db21\code\iqtask.exe executable) to run queries and procedures. Stored Procedures are always executed on the same task as the query that calls them. For example, if a QueryDef record is on TSK_IQ2 and it calls a stored procedure, the stored procedure will also be executed by TSK_IQ2. So, there is no reason to try to change the EXTERNAL_TASK_RECORD for a stored procedure. SQLplus recognizes that a record is a stored procedure by the fact that its definition record has a record activation code of 4 and an external task record of TSK_IQ1. If you change the External_Task_Record for ProcedureDef it will not be recognized as a stored procedure definition record. Keywords: procedure, task References: None
Problem Statement: How to find an InfoPlus.21 record's folder and the various sequence of parent folders.
Solution: This example will return a string with the name of the record and the folder structure. Function FolderTree(n1 record) local tmp string; tmp = '/' || n1; n1 = (SELECT name FROM Folderdef WHERE record_name = n1); WHILE n1 IS NOT NULL DO tmp = '/' || n1->name || tmp ; n1 = (SELECT FOLDER_PARENT FROM Folderdef WHERE name = n1->name); end; return tmp; end; Save this function as a ProcedureDef record in InfoPlus.21. Call the procedure and pass it the name of the desired record. For example: write FolderTree('atcai'); The output will look similar to this '/RootFolder/Folders/OPC_tags/3down/ATCAI' Keywords: References: None
Problem Statement: Is there a way to use SQLplus, either in the Query Writer Tool or via ODBC, to connect to an Excel spreadsheet while the spreadsheet is open and avoid this error: failed to connect to link....it is already opened exclusively by another user or you need permission to view its data...
Solution: Make the Excel Workbook shared. To do this: 1. Open the workbook in Excel. 2. Selected Tools/Share Workbook... from the menu. 3. Check the Allow changes by more than one user at the same time box. 4. Click OK. SQLplus will them be able to read the spreadsheet even if it is open by someone else. Keywords: References: None
Problem Statement: Can parameters be passed via the IQ or IQNP commands?
Solution: Yes, they are passed just like standard DOS parameters to a *.bat file. See the following example: Create a file C:\temp\query1.sql that contains: select &1, ip_description from &2; Use this command in a DOS box: C:\>C:\Program Files\AspenTech\InfoPlus.21\db21\code\iq.exe C:\temp\query1.sql name atcai returns: name ip_description ATCAI Sine Input Keywords: syntax arguments variables References: None
Problem Statement: Is it possible to subtract a large number of days from a timestamp value?
Solution: You can subtract (or add) values from a timestamp in SQLplus by subtracting the value in 1/10 second intervals. So to subtract 1 day this would be 1*24*60*600 (1 day * 24 hours * 60 minutes * 600 tenths seconds). For example: local dayvalue int; local t1 timestamp; t1 = '01-Mar-14 10:25:30.1'; dayvalue = 35; write (t1 - dayvalue*24*60*600); This works fine until you try and use a value of greater than 2485 days, after which the results are incorrect. This is due to specifying local variable type integer. In SQLplus integer is 4 byte value (32-bit) and can store numbers in the range -2147483648 to 2147483647. A day value of 2486 for the calculation uses 2486 * 24 * 60 * 600 = 2147904000 and this exceeds the integer range. To avoid this problem you can specify the dayvalue as real. Keywords: integer 32-bit 2147483647 References: None
Problem Statement: When executing an SQL script, the following error messages may appear: Invalid TIMESTAMP value YEAR field out of range when converting CHARACTER to TIMESTAMP Invalid timestamp <timestamp>, check format is YYYY-MM-DD HH:MM:SS and numbers are in range All of these error messages indicate a problem with a timestamp setting within the SQL script.
Solution: Check on the version of Aspen SQLplus used. ISO timestamp formats are only supported in v6.0 and above. A query using ISO timestamp being executed on a pre-v6.0, will result in error messages. Ensure that Aspen InfoPlus.21 database and the SQL script are configured with the same time setting. To check the time setting for the Aspen InfoPlus.21 database, 1. Launch Aspen InfoPlus.21 Administrator. 2. Right-click on the nodename. 3. Select Properties from the context menu. 4. Select Time Parameters tab. The Time Parameters tab in the Properties dialog is where the time format setting for Aspen InfoPlus.21 database is configured. In the SQL script, if CAST function is used to cast an expression to timestamp, the date and time format of the expression in the query must match with the date and time format set in the Time Parameters tab in Aspen InfoPlus.21 Administrator. For example, the date format had been set to DD/MM/YY in the Time Parameters tab. CAST('06-Sep-07 2:18:00' AS TIMESTAMP); When the above SQL script is run, the following error message is encountered. Casting a timestamp character value from the format DD-MON-YY HH:MI:SS to another format using CAST FORMAT results in the error message below. The below is an example which will give the error message above. CAST('06-Sep-07 14:18:00' AS TIMESTAMP FORMAT 'MM/DD/YYYY HH:MI:SS' ); There are a few thing to note. 1. The expression given is of the data type CHARACTER. Running CAST('06-Sep-07 14:18:00' AS TIMESTAMP) will just simply convert it from one data type to another. In this case from CHARACTER to TIMESTAMP. 2. The expression is represented in Aspen InfoPlus.21 format and not in ANSI format. Running TIMESTAMP '06-Sep-07 14:18:00' will give the following error message. So it would not be possible to use the following SQL script. CAST(TIMESTAMP '06-Sep-07 14:18:00' AS CHAR FORMAT 'MM/DD/YYYY HH:MI:SS') The YYYY-MM-DD HH:MM:SS format is the representation of timestamp in ANSI format and SQL is regulated by the American National Standards Institute (ANSI) which Aspen SQLplus is based on. In order to CAST FORMAT, the expression need to be CAST into a TIMESTAMP data type first as shown below. CAST(CAST('06-Sep-07 14:18:00' AS TIMESTAMP) AS CHAR FORMAT 'MM/DD/YYYY HH:MI:SS') Keywords: ISO timestamp character cast format References: None
Problem Statement: The EXECUTE and EXEC commands allow you to execute queries on remote nodes. The remote query appears in single quotes following the EXECUTE or EXEC command. If the remote query is long or is complex, it can be difficult to handle in the Aspen SQLplus query writer. This
Solution: describes how to work around this problem.Solution Knowledge base article 138104 describes how to split a long EXECUTE command over several lines. You can also place the command into a text file and read the query from the file as follows: 1) Save the query in a text file, for example C:\Temp\MyQuery.txt 2) Use next SQLplus code: Local QueryLine; QueryLine = (Select LINE from 'C:\Temp\MyQuery.txt'); Execute QueryLine On MyIP21; Replace the file path inside the QueryLine variable for the path to your file. Note, there is still an absolute limit - LINE pseudo column supports up to 4048 characters. Keywords: SQLplus EXECUTE References: None
Problem Statement: How can I recover an automated Aspen SQLplus report that has been deleted?
Solution: When a Aspen SQLplus report is deleted via the web interface then the record that is associated with in the Aspen InfoPlus.21 database definition record SQLReportDef will be deleted. However the XML file associated with the report is still available in the folder Documents and Settings\All Users\Application Data\AspenTech\SQLplus\automated. The report can be re-instated by 1. Locating a copy of the Aspen InfoPlus.21 snapshot that contains the SQLReportDef record for the report. 2. On a non-production server you should load this snapshot and then create a recload file (.RLD file) for the report record. SeeSolution 108789 for detail on how to create a recload file. 3. Copy the recload file to the production server and load it into the currently running snapshot. SeeSolution 111481 for detail on how to load a recload file into the Aspen InfoPlus.21 database. 4. Verify that the automated report is accessible from the web interface of SQLplus Reporting. Important: If the XML file doesn't exist then the report will need to recreated via the web interface. Keywords: SQLplus reporting automated report recreation References: None
Problem Statement: When you run a query using the Aspen SQLplus Query writer, the default timeout value for the query is 180 seconds; A however, an external task like TSK_IQ1 executing a query defined by QueryDef or CompQueryDef records, by default has no timeout.A This article explains how to add a timeout parameter to an external task that processes a query record, usually referred to as an IQ task.
Solution: Using the Aspen InfoPlus.21 Manager, modify the command line parameters field for the IQ task (TSK_IQ1, for example) to add the switch /t=nn, where nn is the timeout in seconds.A This switch sets the timeout for all queries processed by the IQ task.A If other query records require a different timeout value, you will need to create a separate IQ task in order to specify a different timeout value. Keywords: cancel hang querydef compquerydef max time terminate query stop query References: None