---------------
Time Function ||
---------------
variables
{
Timer t1;
}
on start
{
setTimer(t1, 5); // Initializes a 5-second cyclic timer
}
on timer t1
{
...
setTimer(t1, 5); // Resets timer for another 5 seconds
}
cancelTimer Stops an active timer
getLocalTime Gets windows time information
getLocalTimeString Gets windows time information in a string
setMsgTime Assigns time to message (obsolete)
timeDiff Calculates time difference between two messages
timeNow Gets the current system time
setTimer Sets a timer
--------------------------
String Handling Functions ||
--------------------------
atol Converts a string to a long integer
ltoa Converts a number to a string
snprintf Creates a formatted string
strlen Gets the length of a string
strncat Concatenates two strings
strncmp Compares two strings
strncpy Copies a string
long z1;
long z2;
z1 = atol(�200�);
z2 = atol(�0xFF�);
// Result: z1 = 200, z2 = 255
----
long length;
char buffer[100] = "CANalyzer";
length = strlen(buffer);
Result:
length = 9
------------
strncpy(char dest[], char src[], long len);
This function copies src to dest. len indicates the size of the string that shall
be copied. The function ensures that there is a terminating '\0'. Thus, a maximum
of len-1 characters are copied.
variables {
char s1[7] = "Vector";
char s2 [32];
}
on key 'z'
{ Output to the Write-Window:
strncpy (s2,s1,elcount(s2));
write ("Result: %s",s2); Result: Vector
}
---------------------------
long strncmp(char s1[], char s2[], long len);
long strncmp(char s1[], char s2[], long s2offset, long len)
on key 's'
{
char s1[7] = "Vector";
char s2[7] = "Vector";
if(strncmp(s1,s2,strlen(s1)))
write("not equal");
else
write("equal");
}
Form 2 starts the comparison in s2 at the specified offset.
----------------
void strncat(char dest[], char src[], long len);
This function appends src to dest. len indicates the maximum length of the
composite string.