The textual language contains a number of predefined functions:
Returns the absolute value of a.
Returns the cosine value of a.
real max(real a1, real a2, ... , real an)
Returns the largest argument. The function can take any number of arguments ≥ 1.
real min(real a1, real a2, ..., real an)
Returns the smallest argument. The function can take any number of arguments ≥ 1.
Returns a uniformly distributed value, a, where 0.0 ≤ a < 1.0.
Returns the sine value of a.
Returns the square root value of a.
Removes all messages from the message list.
Returns the formatted value of a. The formatting is performed using the Java DecimalFormat with MaximumFractionDigits = 3 and MinimumFractionDigits = 1 and a dot as decimal separator.
Writes msg to the terminal.
Adds msg first in the message list.
Returns the scan cycle time for the current workspace in milliseconds.
Returns a string containing the current date and time, formatted with the system's default locale.
Returns a string containing the CHEM timestamp format version of the current time. No millisecond or timezone information is used. An example of what the string might look like is 2003-06-06T11:29:31.
Extracts the blue color component as a value in the range 0.0 - 1.0 from the integer RGB value a.
Extracts the green color component as a value in the range 0.0 - 1.0 from the integer RGB value a.
Extracts the red color component as a value in the range 0.0 - 1.0 from the integer RGB value a.
int RGBToInt(real red, real green, real blue)
Converts a color represented by three real RGB components red, green, and blue in the range 0.0 - 1.0 to an integer RGB value.
Print the amount of free memory of JGrafchart in the command window from which JGrafchart was started.
Print the maximum amount of memory that can be used by JGrafchart in the command window from which JGrafchart was started.
Print the amount of total memory used by JGrafchart in the command window from which JGrafchart was started.
Compiles the application named name. Returns true if the compilation was successful.
Closes the application named name.
Loads the file path into JGrafchart. Returns the name of the opened application.
Loads the file path into JGrafchart and compiles it.
void loadCompileStart(string path)
Loads the file path into JGrafchart, compiles it, and starts it.
void new(string class, string name, string workspace, int x, int y)
Creates a new object of the given class. The name of the object is set to name. The object is added to the workspace named workspace at the position x, y. Currently only the classes "Rectangle" and "Ellipse" are supported.
Starts the application named name. Requires that the workspace has been successfully compiled.
Stops the application named name.
Adds the palette if it was previously hidden.
returnType applyStaticMethod(string class, string method, string returnType, string arg1Type, arg1Type arg1, ..., string argNType, argNType argN)
Generic function that makes it possible to call an arbitrary static method of any Java class. The function is implemented using Java Reflection. The first argument is the name of Java class. The second argument is a string containing the name of the method to be invoked. The third argument is a string that decides the return argument type of the method. This type will also be the type of the returned value of applyStaticMethod. Legal values are "string", "real", "int", and "boolean". The remaining arguments consist of argument pairs where the first argument in the pair decides how the second argument should be evaluated. The legal values are the same as for the return type. For example, the following call to applyStaticMethod calls the random() method of the Math class. applyStaticMethod("java.lang.Math","random","real").
Executes command in a separate operating system process.
Hides the palette if it was previously visible.
returnType stringApply(string object, string method, string returnType, string arg1Type, arg1Type arg1, ..., string argNType, argNType argN)
Generic function that makes it possible to apply an arbitrary Java method to a string. The function is implemented using Java Reflection. The first argument is the string that the method should be applied to. The second argument is a string containing the name of the method to be invoked. The third argument is a string that decides the return argument type of the method. This type will also be the type of the returned value of stringApply. Legal values are "string", "real", "int", and "boolean". The remaining arguments consist of argument pairs where the first argument in the pair decides how the second argument should be evaluated. The legal values are the same as for the return type. For example, the following call to stringApply extracts the substring "Graf" from the argument "JGrafchart". stringApply("JGrafchart","substring","string","int",1,"int",5).
Programmatic connect to CCOM.
Programmatic disconnect from CCOM.
Returns the CCOM login name.
Returns the CCOM port.
Returns the IP address to the CCOM server.
Returns true if connected to CCOM.
void setCCOMLoginName(string name)
Sets the CCOM login name. (Default = JGrafchart)
Sets the CCOM port. (Default = 3412).
void setCCOMServer(string IPaddress)
Sets the IP address of the CCOM server.
Subscribes to a CCOM topic.
void unsubscribe(string topic)
Unsubscribes from a CCOM topic.
string dpwsGetEvent(DPWSObject obj, string opName)
Get the next opName event on obj.
string dpwsGetFault(DPWSObject obj)
Get the next stored fault on obj. If the list is empty and obj is known to be unavailable a generic fault message is returned.
bool dpwsHasEvent(DPWSObject obj, string opName)
Returns true if and only if there is an opName event on obj.
bool dpwsHasFault(DPWSObject obj)
Returns true if and only if there are any stored faults on obj or if obj is known to be unavailable.
void dpwsSubscribe(DPWSObject obj, string duration)
Subscribe to events in obj for a certain duration. The duration uses the xsd type xsd:duration which is specified on the ISO 8601 format, i.e. P<date>T<time>. Example: PT2H10M means 2 hours and 10 minutes.
Note: The used implementation states that the year and month fields are not used.
void dpwsUnsubscribe(DPWSObject obj)
Cancel the current subscription to obj.
string xmlAdd(string elemName, string value, string xml="")
Adds an element with name elemName and text value to an xml string xml and returns the new complete xml.
Example: xmlAdd("elem", "val") returns "<elem>val</elem>"
Example: xmlAdd("elem", "val", "<elem>val</elem>") returns "<elem>val</elem><elem>val</elem>"
string xmlFetch(string xml, string xpath, string multiHandler="first")
Fetch the element text for the element given by the XPath xpath, which is called on the root element.
multiHandler specifies how to handle multiple matching elements.
If the multiHandler value is illegal, the default MultiHandler is used.
bool lcReceived(LabCommObject obj)
Returns true if and only if a sample has been received on the LabComm Object obj since the previous scan cycle.
void lcSend(LabCommObject obj, string sampleName=*)
Send the sample named sampleName in the LabComm Object obj. If the second parameter is omitted, all samples in the LabComm Object are sent.