-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction.c
More file actions
51 lines (37 loc) · 1.07 KB
/
function.c
File metadata and controls
51 lines (37 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <cviauto.h>
#include "project.h"
#include <userint.h>
#include <rs232.h>
#include <ansi_c.h>
//#include "function.h"
#include <stdlib.h>
#include <stdio.h>
#include <dll.h>
FILE *fp;
void ReadDataFromComPort(double temp_arr[],double t[],double dt,int i)
{
int strLen; //Queue Data Len
char readBuf[200] = {0}; //Data
strLen = GetInQLen (9);
ComRd (3, readBuf, strLen);//Reading data
temp_arr[i] = strtod (readBuf, NULL);//string to double
t[i]=i*dt;//time interval
}
void file()
{
fp=fopen("file.txt","w+");
fputs("Temp[C]\t Time(sec)\n", fp);
}
void writedata(double temp_arr[],double t[],int i)
{
//fprintf(fp,"%f %f\n",temp_arr[i],t[i]);
fprintf(fp,"%f\t%f\n",temp_arr[i],t[i]);
}
void ProcessActiveXError(int error)
{
char errorMessage[500], errorText[500];
CA_GetAutomationErrorString (error, errorText, 500);
strcpy (errorMessage, "Outlook ActiveX Error: ");
strcat(errorMessage, errorText);
MessagePopup ("ActiveX Error", errorMessage);
}