LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to break a string into individual charachters so that it can be used to create a command string for RS-232 communication?

I'm reading a numerical string or a number from a remote device.
I then need to take this string and send these values via RS-232 to another device.
My problem is that the device I need to send the command to requires that each individual number be entered one at a time followed by a command charachter.
 
I know how to use the concognate string command to put the command back to the other device, but I can not figure how  to break the string from the first device into individual charachters.
 
Example:
 
I read "2.45" from the first device.  I need to beak this into "2", ".", "4","5" individually so that I can enter them back into the other device using VISA.
Also the number of charachters of the nuber I read may sometimes vary.
 
Example:
 
Instead I read "23.343" from the first device.  I need to beak this into "2", "3", ".","3","4","3" individually so that I can enter them back into the other device using VISA.
 
A typical command line for sending the example of "2.45" above would be m2\rm:\rm4\rm5\r
The decimal "." is replaced by ":"
 
If anyone knows how to do this, I would greatly appreciate the help.
 
Patrick
 
 
0 Kudos
Message 1 of 3
(2,730 Views)
Sure. Look at this. This example replicates the inter-character delay option in Hyperterminal. In order to do what you want, you just have to append the LF at the VISA Write.
0 Kudos
Message 2 of 3
(2,720 Views)
An alternative mechanism uses arrays by converting the string to a byte array and interleaving the "m" and "\r" characters, and then just using a for-loop that's autoindexed. See attached example. Modify as needed.
0 Kudos
Message 3 of 3
(2,705 Views)