06-08-2010 10:04 AM
I am using LabWindows/CVI 2009 and attempting to create Network variables within my c source. I am able to create the variable and set 'Single Writer' and 'Buffer Max Items' attributes but when attempting to set the prototype to boolean, no value parameter appears to work. Could anyone please advise what parameter I should use to prevent all my variables being of variant data type.
CNVNewVariable(process, name);
CNVSetVariableAttribute(process, name, CNVVariableSingleWriterAttribute, 0);
CNVSetVariableAttribute(process, name, CNVVariableServerBufferMaxItemsAttribute, 64);
CNVSetVariableAttribute(process, name, CNVVariablePrototypeAttribute, NotSureWhatToPutHere);
Regards
Solved! Go to Solution.
06-08-2010 10:21 AM
06-08-2010 11:04 AM
06-09-2010 11:31 AM
Hi Atroyd,
I'm afraid I don't have CVI 2009 installed right now so I can't test this, but a previous Service Request mentions the following works in CVI 2009 (will not work in 9.0 which is what I have installed currently, CVI 2009 is not the same as 9.0):
CNVData myData;
CNVNewVariable ("shared", "MyVariable");
CNVCreateScalarDataValue (&myData, CNVDouble, 20.0);
CNVSetVariableAttribute ("shared", "MyVariable", CNVVariablePrototypeAttribute, myData);
The code above creates a new variable called "MyVariable" in a process called "shared" that I already have on my computer. The next line creates a network variable pointer called "myData" and gives it a type of double and a value of 20 (myData must be initialized just as it is in the first line). The final line takes MyVariable and gives it the attributes of myData (mainly the data type double and the value of 20).
Please let me know if that works for you.
Regards,
Imtiaz Chowdhury
Project Manager
Green Running / Austin Consultants
06-10-2010 02:18 AM
Thank you for the reply. It has caused a partial success. The datatype is now as required but the default value is not recorded. Distributed System Manager reports a value of 'No Known Value'. Setting the default value after the supplied code corrects for this situation.
Regards
Atroyd