Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

concatenated string to RS-232 but the output doubles the backslashes not allowing the commands through to the display.

I am trying to input a string from an excel spreadsheet through a concatenated string and output is to RS-232 to backslash code display, but the output doubles the backslashes not allowing the commands through to the display.  I know the input string is normal format and the display expect to see '\' code display format, but I cannot figure out a way to convert the string without having each backslash double.
0 Kudos
Message 1 of 6
(3,802 Views)

What do mean by 'output' and 'display'? Is the output the concantanate string function or something else? Is the display a string indicator?

If you could post your VI with some actual data, it would to understand what you are trying to describe. You don't have to provide the Excel file but if you could create a constant with the data you've read, select Edit>Make Current Values Default, save it, then post that, it would make things simpler.

0 Kudos
Message 2 of 6
(3,791 Views)
Here is the program I am running.
I'm simply trying to take a string out of an excel file and output it through the com port to a dot matrix display, but the excel file strin is in normal format and the com port translates it into a '\' code display format which double the backslashes and my dot matrix display than write the entire command as text and doesn't recognize the space line feed or carriage return command.

0 Kudos
Message 3 of 6
(3,773 Views)
There is no translation being done by the VISA Write. It will send whatever you pass to - unaltered. Since you did not do like I asked and provide some real data, I cannot look at what you are sending but you must be reading a control character in your file (i.e. a LF or CR) and passing that to this VI. Just because you might have one string indicator set for normal display and another set for '\' Codes Display, that does not mean a translation of the actual data takes place.
0 Kudos
Message 4 of 6
(3,762 Views)
I did try as you asked to make current values default, save and post.  I'll include the entire function including the excel spreadsheet I'm currently using,  So you are able to see what is happenning.  Thank you for you assistance so far.
0 Kudos
Message 5 of 6
(3,757 Views)
It looks like what you want to do id convert the '\' and 'n' characters in your excel file to the LF control code. The LF control code is represented as \n when in '\' Codes Display but it is actually a single character - hexA. I think if you were to search for the '\n' pair and replace with the correct character, you will be sending the correct data out the VISA Write. You cannot simply replace one ascii character )or two) with another like you are doing now.
0 Kudos
Message 6 of 6
(3,743 Views)