LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic memory is corrupt (Labwindows/cvi 2010)

Hi Nharish,

 

All the files are included except for nixnet.h. Please include this file.

 

Thanks,
Jackie

DAQ Product Marketing Engineer
National Instruments
0 Kudos
Message 11 of 19
(1,368 Views)

Where should I include this ? ? pl clarify...

-Nharish
0 Kudos
Message 12 of 19
(1,366 Views)

If you could upload this file to the FTP site as well, that would be sufficient. CVI is looking for this file when I try to run the project. I will add it to the folder you already uploaded and then navigate to this when CVI prompts me for it.

 

Jackie

DAQ Product Marketing Engineer
National Instruments
0 Kudos
Message 13 of 19
(1,362 Views)

NIXNET.H is the NI file for XNET...Anyway, I have dumped it in the ftp incoming.

 

ftp://ftp.ni.com/incoming/nixnet.h

 

 

-Nharish
0 Kudos
Message 14 of 19
(1,360 Views)

Jackie_B, any success ?

-Nharish
0 Kudos
Message 15 of 19
(1,343 Views)

Hi Nharish,


Not yet, I am still looking into this.

 

Regards,

Jackie

DAQ Product Marketing Engineer
National Instruments
0 Kudos
Message 16 of 19
(1,326 Views)

No problem, I was just trying to keep the communication channel open between us.

-Nharish
0 Kudos
Message 17 of 19
(1,323 Views)

Jackie_B, Are you able to reproduce my problem ?

 

Please let me know.

 

Regards

-Nharish
0 Kudos
Message 18 of 19
(1,311 Views)

Hi Nharish,

 

Yes, we was able to reproduce your problem and I have an explanation and solution for you. When you create the Thread Safe Queues like this "CmtNewTSQ(100, EthernetDataSize, OPT_TSQ_DYNAMIC_SIZE, &Queue_TCPRead_EthernetData);" The element size of the items in the queue is specified as EthernetDataSize, which evaluates to 128 bytes. In the threads, data is being written and read from the TSQs with functions like BytesRead = CmtReadTSQData (Queue_TCPRead_EthernetData, BufferEth, EthernetDataSize, TSQ_INFINITE_TIMEOUT, 0); where BytesRead is a 128 byte array, but EthernetDataSize number of elements is being written to it. This means that 128 128byte elements are being read from the queue and being written to a 128byte object. This is where the corruptions is coming from. Normally CVI would throw a Non-Fatal Run-Time Error when you attempt to write too much data to an array, but that does not occur when the datatype is void*. Every CmtReadTSQData and CmtWriteTSQData needs to be changed so that EthernetDataSize parameter is replaced with 1.

 

This should resolve the issue you are seeing. Good luck with your project and have a great day!

 

Regards,

Jackie

DAQ Product Marketing Engineer
National Instruments
0 Kudos
Message 19 of 19
(1,277 Views)