LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

After the program is ran,I get an intializer must be constant error:status=FP_Open(valve,&identfiy);All the variables are declared,so I d

on't know were the problem is.To correct the error I made all the function calls equal to status,the error still exists.I tried to make the initial variables constant.What is meaning of the error and do I need to restart using the function panel?Thank-you!LabWindows/CVI w/Field Point Explorer.Problem occurs with functions. Here is a segment of my program: Thank-you:
#include "FieldPoint.h"
IAStatus Function;
IAString valvetests;
IAHandle identify_servers;
unsigned long BufferSize;
Buffersize [200];
IAHandle create;
IAByte Written_Device_Data[150];
IAByte Buffer[100];
SYSTEMTIME TIME;
Fun
ction = FP_Open (valvetests, &identify_servers);
Function = FP_CreateTagIOPoint (identify_servers, "FP Res",
"FP-AO-200@1", "Channel 0", &create);
Function = FP_Write (identify_servers, create, Written_Device_Data, BufferSize);
Function = FP_Read (identify_servers, create, Buffer, 100, &TIME);
Function = FP_DestroyIOPoint (identify_servers, create);
Function = FP_Close (identify_servers);
I am trying to find out if the function calls are declared correctly. I get an error of the �intializer must be constant� for the line I have underlined. The error message is repeated 8 times and it refers to the same line. Is there a another why to declare this function? Or do I needed a different library include.
0 Kudos
Message 1 of 2
(3,017 Views)
on't know were the problem is.To correct the error I made all the function calls equal to status,the error still exists.I tried to make the initial variables constant.What is meaning of the error and do I need to restart using the function panel?Thank-you!Hi,

The overall flow of you code looks correct and I don't see any problems with the include statement. The best starting point would be to see if you can open one of the FieldPoint examples that install with FieldPoint Explorer. "C:\Program Files\National Instruments\Measurment Studio\CVI\samples\FieldPoint" Try to run the example in CVI and see if you get the same errors. If you do, I would reinstall FieldPoint Explorer to make sure you don't have a corrupt FieldPoint.h file or supporting file. If the example does work for you I would carefully examine the example and compare the code.
0 Kudos
Message 2 of 2
(3,017 Views)