Graeme Posted January 30, 2009 Report Share Posted January 30, 2009 Hello all, I have a requirement to convert a string to an array of the string's characters, each element of the array containing sequentially one character of the string. I can't believe no one has ever wanted to do this but various searches reveal little. I attach my effort but wonder if there is an even simpler way. Risking two questions in one posting I'll say why I'd like to do this. I have a company home brew box that I can send a string command to via HyperTerminal, quite successfully. However, in LabVIEW the box will only accept one character at a time, so a VISA Write in a For Loop indexed by said array of characters. Can anyone enlighten me as to why HyperTerminal sends the string successfully in one go (apparently) , but via LabVIEW it must be a character at a time. As ever, indebted. Regards, Graeme. Quote Link to comment
jdunham Posted January 30, 2009 Report Share Posted January 30, 2009 Your VI is fine. I don't think there is any simpler way. People don't do this very much because a lot of functions which could handle one character also handle the characters as U8 integers. For example the IsDigit? function and its siblings Can handle strings or U8s. It seems like it would be better to focus on your real problem. I use LabVIEW serial all the time and I have never had that issue. Is your box expecting Serial flow control? If you dig in to all of the hyperterminal settings and make sure you set the exact same settings in NI-VISA (using attribute nodes on your VISA refnum) then they will perform the exact same way. AFAIK Visa is just wrapping the same Microsoft OS Serial port functions as Hyperterm. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.