LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending array over TCP receiving array and creating image

Solved!
Go to solution

Hi

 

I am working with process tomography;

I want to send a 2-D array of double over TCP, receive the same array (2-D array of double) and create an image from this array.

 

From unflatten to string, I got 2-D array of string. How can I create the original array from this array of string?

 

Please take a look to my vi s.

Thanks in advance

 

 

 

Download All
0 Kudos
Message 1 of 11
(6,569 Views)

Hello,

 

I think the solution is to remove the "Number to Fractional String.vi" that you have in the transmit1.vi. You create a 2D array of doubles and you convert that array into an array of strings, and then you flatten them into a single string. This is not nessecary. You can simply wire the 2d array of doubles directly to the flatten to string vi.

See the pictures below.

 

hope this solves your problem,

labjunky

 

in the transmit vi

example2.png

 

in the receive vi

 

example.png

0 Kudos
Message 2 of 11
(6,560 Views)

Thank you for your suggestions Labjunky

 

I have modified the vi s accordingly, but unfortunately it did not solve the problem

 

In this case I do not get the data even in the form of string. Array in the receiver is empty.

 

Can you please take a look to the modified vi s?

 

 

Thanks:)

Download All
0 Kudos
Message 3 of 11
(6,549 Views)
Solution
Accepted by Mittani HD

You are writing a 2D DBL array, but are reading it as a 2D array of strings. replace the 2D string array constant with a 2D DBL array constant. (I haven't studied the rest of the code, because I don't have IMAQ)

0 Kudos
Message 4 of 11
(6,544 Views)

Hi

 

I made a search and could find the solution at

http://forums.ni.com/t5/LabVIEW/Convert-2D-string-array-to-2D-number-array/td-p/626652

 

It works fine now:)

Thank you for your advice.

 

Regards,

 

Mittani

0 Kudos
Message 5 of 11
(6,537 Views)

I can' t find this particular labview thing Capture.PNG how is it called?
Thanks in advance

0 Kudos
Message 6 of 11
(6,336 Views)

@HenkMCFree wrote:

I can' t find this particular labview thing Capture.PNG how is it called?


Unflatten From String Function

0 Kudos
Message 7 of 11
(6,311 Views)

Thanks alot!

0 Kudos
Message 8 of 11
(6,274 Views)

Hi, I have used your suggestion and the number vector communication is successful, thank you.

0 Kudos
Message 9 of 11
(2,670 Views)

Just be aware that every time you convert a floating point number to a string, you lose the actual floating point value.  You get an approximation of an approximation.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 10 of 11
(2,653 Views)