Origin C provides many global functionsFunctions, Predefined for performing a variety of tasks. These global functions fall into twenty-six categories.
Please refer to the Global Functions section for a complete list of functions with examples.
Origin C supports user-defined functionsFunctions, User-defined. A user-defined function allows Origin C programmers to create functions that accept their choice of arguments and return type. Their function will then operate on those arguments to achieve their purpose.
The following creates a function named my_function that returns a double value and accepts a double value as its only argument.
double my_function(double dData) { dData += 10; return dData; }
The following code snippet shows how to call the above function.
double d = 3.3; // Declare 'd' as a double value d = my_function(d); // Call the above function out_double("d == ", d); // Output new value of 'd'
Origin C functions can also be called from LabTalk.
d = 3.3; // Assign 3.3 to 'd' d = my_function(d); // Call the above function d=; // Output new value of 'd'