12-14-2022 04:27 AM
Hi,
I'm trying to write a single dimension 32 element array (UInt16) to a network variable but I'm struggling to create the CNVData using CNVSetArrayDataValue().
Extract of code below which compiles but gives the runtime error -6352 Data handle is invalid.
int status = 0;
unsigned int dump[DUMPSIZE];
unsigned long dim[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
CNVData data = 0;
for(int i=0;i<DUMPSIZE;i++)
dump[i] = DumpList[1].MemoryLocation[i];
// convert data to integer array
status = CNVSetArrayDataValue (data, CNVUInt16, dump, 1, dim);
// write data
status = CNVWrite (wtr, data, 35);
CNVDispose(data);
Anyone have an working example on how to use this function?
Mike
12-14-2022 04:43 PM
Not sure whether this is the correct answer, but unsigned long is a 4-byte variable, so I would use CNVUInt32 data type.
12-16-2022 10:58 AM
Hi,
Thanks for your reply, that may not have helped but I found out I was being a bit of an idiot and needed to use the function CNVCreateArrayDataValue.
It's been a while since I've used LabWindows, quite a pleasant change to write a bit of C after years of LabVIEW.
Mike