I need to send a string command to a piece of hardware. it consists a letter and a number, such as "M100". I guess I should first give "M" then "100" then combine them into an array and then convert the array into a string. but the out come string has only M plus some machine code. how to do it correctly?
Send M100 as a string to the hardware. No conversion necessary. Usually an instrument will accept characters for its command string, not actual numeric values. GPIB uses characters only. You send "FR1000Hz" to set frequency to 1000Hz. You might read from a DMM "15.000" as a string of characters, not a value. The string can be converted to a value if necessary. Try just sending M100 as a string to the instrument.
Thanks tbob, that works. but I need to increase the value of the number part using a for loop. for example, I need the user to say "M100" and the loop will run 100 times sending commands like "M1" "M2" ... all the way to "M100"
Wow! Thank you very much! I did not expect someone will solve the problem for me, but Thank you! You used some many things that I have never seen before. This is quite a big lecture you have gave me. I will carve this into my head.
Unfortunately, I am using LV7.0 and not able to enjoy what the Counter.vi could have offered 😛 However, I have this vi created for your problem. Perhaps, you wanna take a look at it and let me know if it works and helps?
Ian, your VI works just as good. It does the same as the counter VI with very minor differences. Plus I am absolutely shocked by the fact that it is built on a entire philosophy. This also inspires me greatly, thank you very much!