LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert a dynamic data type to array of strings

    I want to perform a serial communication between two computers that I´ll call them A and B. The computer A (transmitter) will send a signal (sinusoidal) to computer B (receiver). I´m using a VISA Serial Communications Set (VISA Configure Serial Port.vi, VISA Write.vi, VISA Read.vi and VISA Close.vi).  VISA Write accepts only string data type and VISA Read reads only string data type, but the signal that I generated (on transmitter) is dynamic data and I need to perform this conversion to run my program sucessfully. How can I perform this conversion?!
0 Kudos
Message 1 of 4
(8,539 Views)

Hello,

The easiest way I can think of to perform this conversion is to use the "From DDT" Express VI, located in the Express > Signal Manipulation subpalette.  You can convert your DDT value into an array of numerics, then use one of the "number to string" functions to convert this into an array of strings.  I have attached a screenshot of a VI that would do this.

Hope this helps,

-D

0 Kudos
Message 2 of 4
(8,536 Views)
Darren,

Your answer gave me new ideas about how to perform this conversion. I´m replying your answer because your solution does not work as I thought. When I convert dynamic data type at first time to array (1-D) with a From DDT.vi I loss information, because the input waveform signal is a 2-D array. Summarising, I want to see a waveform signal on Waveform Chart and I would like to convert dynamic data type to "string (2-D)" and vice-versa. I don´t know if I can you undesstand.

Thanks, for help me...

Rafael Rorato (my name!)
0 Kudos
Message 3 of 4
(8,522 Views)

Hi Rafael,

You can configure the From DDT Express VI to convert your dynamic data to any number of different types.  By default, the Express VI will convert to a 1D array of numerics...however, you can configure it (either when you first drop it, or by double-clicking it) to convert to a 2D array of numerics...additionally, you can configure it to convert based on channel data being in columns or rows.  I have attached another screenshot that shows converting the dynamic data into a 2D numeric array. 

I hope this helps.

-D

0 Kudos
Message 4 of 4
(8,514 Views)