From: lmd2 on
If I was allocating space by wiring a copy of the STRUCT (cluster) to the node, then I could understand populating the cluster but if I am allocating space with an empty byte array how would I initialize the byte array in any meaningful way? maybe typecast a struct into a byte array, and then resize the array to 131078 bytes?Message Edited by lmd2 on 07-02-2008 03:33 AM
From: rolfk on
lmd2 wrote:If I was allocating space by wiring a copy of the STRUCT (cluster) to the node, then I could understand populating the cluster but if I am allocating space with an empty byte array how would I initialize the byte array in any meaningful way?maybe typecast a struct into a byte array, and then resize the array to 131078 bytes?Message Edited by lmd2 on 07-02-2008 03:33 AMSeveral ways are possible but the Typecast one is a good one if you only need to initialize the first struct element in that buffer. Just don't forget that Typecast will standardize your data to Big Endian when turning your cluster into an byte stream so when interfacing with shared libraries on x86 platforms you should first wire the cluster through Swap Words and Swap Bytes before wiring it to Typecast.Or if you use a recent LabVIEW version use Flatten instead and its type set to "Native, host order". Don't forget to set "Prepend array or string size byte" to False too, just to be sure.Rolf Kalbermatter
From: lmd2 on
I'll be heading to work in about an hour and give this a try - since I am going to type cast the cluster into a byte stream, should I treat the bundled arrays as arrays, or continue to treat them as an in-line cluster and a pointer, once it is cast into a byte stream, would the same restrictions apply? yeah I guess so,I'll type cast as an embedded cluster and a U32 (memory location)
From: lmd2 on
No good, the function still returns the same error: Invalid Buffer I am attaching the diagram, don't see how the buffer could be better initialized


diagram.jpg:
http://forums.ni.com/attachments/ni/170/337190/1/diagram.jpg
From: MikeS81 on
Hi lmd2, where do you get the error, at the second dll call within the case structure? Is it the RtlMoveMemory function? If yes try to lock it before read from it.Hope it helps.Mike
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8 9 10
Prev: error 200279
Next: CMD.EXE Output Not Showing up