WRITE_REC FUNCTION
- used to write a single DataLog record to the DataLogger.
Summary:
write_rec();
Description
The
write_rec
function is used to write a single DataLog record to the DataLogger. All values
selected for logging on the DataLogger programming form will be logged once when this
function executes, regardless of whether or not the DataLogger is actually running or not. This
function is useful for event driven datalogging functions such as when an I/O point goes out
of range or when an alarm exists. Do not allow this function to execute continuously or large
amounts of data will accumulate in the datalogger. Also, do not allow this function to execute
more often than once a second because the DataLogger can only resolve timestamps to the
nearest second and will throw out records with identical time stamps.
Example:
/* This program will write a datalog record once per minute */
/* if input 0 is greater than 100 */
int last_minute;
main ()
{
if (read_uaf(input,0,0)>100.0)
/* if input 0 is greater than
100*/
{
if (minutes != last_minute)
/* is it a new minute? */
{
write_rec();
/* then write a datalog record
*/
last_minute=minutes;
/* reset minute check */
}
}
}
/* End of program */
ARRAYS
Arrays allow you to store a lot of related information in a convenient, organized fashion. An
array lets you use one line of programming to create a series of variables. These variables share
the same basic name and are distinguished from one another by a numerical tag.
Example:
float count[10];
This means that an array named count has 10 members or “elements”, with each element hav-
ing its own value, starting with 0 and ending with 9. The first element is count[0], the second
element is count[1], and so on up to count[9]. The type float means that the actual numerical
value of each element is a float.
Example:
count[2] = 2.45
count[4] = 55000
count[9] = -200000
16-10
SCADA 3000 User’s Manual
Summary of Contents for Sensaphone SCADA 3000
Page 1: ...Sensaphone SCADA 3000 User s Manual Version 2 34...
Page 6: ...vi SCADA 3000 User s Manual...
Page 10: ...x SCADA 3000 User s Manual...
Page 30: ...1 6 SCADA 3000 User s Manual...
Page 48: ...4 6 SCADA 3000 User s Manual...
Page 70: ...9 8 SCADA 3000 User s Manual...
Page 122: ...12 8 SCADA 3000 User s Manual...
Page 190: ...15 30 SCADA 3000 User s Manual...
Page 211: ...lead 1 lag 0 else lead 0 lag 1 16 21 Chapter 16 Programming in C...
Page 212: ...16 22 SCADA 3000 User s Manual...
Page 236: ...21 8 SCADA 3000 User s Manual...
Page 248: ...22 12 SCADA 3000 User s Manual...
Page 258: ...23 10 SCADA 3000 User s Manual...
Page 274: ...25 8 SCADA 3000 User s Manual...
Page 288: ...27 8 SCADA 3000 User s Manual...
Page 294: ...28 6 SCADA 3000 User s Manual...
Page 296: ...A 2 SCADA 3000 User s Manual...
Page 302: ...D 2 SCADA 3000 User s Manual...
Page 318: ...I 2 SCADA 3000 User s Manual...
Page 320: ...J 2 SCADA 3000 User s Manual...
Page 322: ...K 2 SCADA 3000 User s Manual...
Page 335: ...Test Log...
Page 336: ......