11-22-2011 12:03 PM
Hi,
I'm trying to use network variables to stream data from one computer to another and I'm having trouble with CNVInt16 data arrays. Whenever I use CNVInt32 arrays, data seems to post find to the process. I hope I'm just missing something obvious.
CNVData ShortData, IntData; CNVWriter ShortWriter, IntWriter; short ShortArrayData[20]; int IntArrayData[20]; size_t dims[1] = {20}; int i; int Exists; for (i=0; i<20; i++) { ShortArrayData[i] = (short)(i); IntArrayData[i] = i; } CNVProcessExists ("Simple Process", &Exists); if (! Exists) CNVNewProcess("Simple Process"); CNVProcessIsRunning ("Simple Process", &Exists); if (! Exists) CNVStartProcess("Simple Process"); CNVVariableExists("Simple Process","Short Array of Data",&Exists); if (! Exists) CNVNewVariable("Simple Process", "Short Array of Data"); CNVVariableExists("Simple Process","Int Array of Data",&Exists); if (! Exists) CNVNewVariable("Simple Process", "Int Array of Data"); CNVCreateWriter("\\\\localhost\\Simple Process\\Short Array of Data", NULL, 0, CNVWaitForever, 0, &ShortWriter); CNVCreateWriter("\\\\localhost\\Simple Process\\Int Array of Data", NULL, 0, CNVWaitForever, 0, &IntWriter); CNVCreateArrayDataValue(&ShortData,CNVInt16,ShortArrayData,1,dims); CNVCreateArrayDataValue(&IntData,CNVInt32,IntArrayData,1,dims); CNVSetVariableAttribute("Simple Process","Short Array of Data",CNVVariablePrototypeAttribute,ShortData); CNVSetVariableAttribute("Simple Process","Int Array of Data",CNVVariablePrototypeAttribute,IntData); CNVWrite(ShortWriter,ShortData,CNVWaitForever); CNVWrite(IntWriter,IntData,CNVWaitForever); CNVDisposeData(ShortData); CNVDisposeData(IntData); CNVDispose(ShortWriter); CNVDispose(IntWriter);
I've attached a screen shot from the distributed systems manager where it shows the Int32 data posting fine, but the Int16 data does not. I'm running Labwindows/CVI 2010.
Any help is greatly appreciated.
11-28-2011 07:22 PM
Tim,
It looks like this is actually a problem in Distributed System Manager and not your CVI code or the CVI API. I was able to reproduce this same issue in both CVI and LabVIEW. It looks like Distributed System Manager is not displaying Array of Int16 datatype. In fact, the same can be said of Array of Double and possibly other datatypes. However, the data is correctly written to the variable. You can see this by reading the data back and notice that it provides you the same data you wrote.
I have filed a bug report for this and will post back if I have any further information.