LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 74 Unflatten from String in video streaming using TCP

I am working on video streaming ( source: USB camera) using TCP. However, am constantly getting held up in "Unflatten from String" with Error 74 occuring stating "Memory corrupt". Kindly help me through in solving the issue.

 

Attached is the VI having both the send/ recieve together and communicating using localhost. 

0 Kudos
Message 1 of 4
(4,457 Views)

Problems I see:

 

  • You are using an IMAQ Flatten function to flatten the image data to a string, but then trying to unflatten the data into an IMAQ reference to an image. This doesn't make any sense. Unflatten the flattened string using the appropriate IMAQ Unflatten function. This is like mailing someone piece of paper with the address of a house and expecting them to receive the entire house.
  • You are only reading 2 bytes of data in the receive loop and trying to unflatten that. Why 2 bytes? Do you really expect your image to be two bytes? Check the Example Finder for examples like Simple TCP Server and Simple TCP Client that show how to send and receive data of an arbitrary size.
Jarrod S.
National Instruments
0 Kudos
Message 2 of 4
(4,436 Views)

Thanks  for the reply!

 

Restricting the TCP sent dta to two bytes was a mistake, that has been rectified.

 

However, we are unable to resolve the "Unflatten from String". their just doesn't seem to be any sub-VI or function, that I can find which could convert the string to IMAQ image!

 

Kindly help in the same!

 

Best. 

0 Kudos
Message 3 of 4
(4,420 Views)

Shoaib Akhtar wrote:

Thanks  for the reply!

 

Restricting the TCP sent dta to two bytes was a mistake, that has been rectified.

 

However, we are unable to resolve the "Unflatten from String". their just doesn't seem to be any sub-VI or function, that I can find which could convert the string to IMAQ image!

 

Kindly help in the same!

 

Best. 


Actually at least in earlier versions of IMAQ the normal Unflatten from string should be able to createthe IMAQ image when you transmit the right data. You can try that by writing the string from IMAQ Flatten.. to a file and reading it back and unflattening. If that works, you know you are making some errors in the TCP communication.

Message Edited by rolfk on 01-11-2010 08:37 AM
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 4 of 4
(4,408 Views)