02-29-2008 10:06 AM
02-29-2008 10:25 AM
02-29-2008 10:27 AM
02-29-2008 10:27 AM - edited 02-29-2008 10:28 AM
02-29-2008 10:30 AM
02-29-2008 10:34 AM
02-29-2008 11:11 AM
Thanks for the prompt replies.
About Number/ASCII
I am using the Atmega128-Controller Chip to read in the signals sent from the computer serial port. Then it sends signals to the motor controller. The Atmega chip reads the ASCII string and converts it to hexadecimal number, sending that number to the motor controller. I can program the Atmega chip so that it either translates the ASCII string into hex as mentioned or accepts as it is. Either way, I want it to read two byte information at once (00 to 7F).
If the VISA serial write can send only one byte at a time, then I may have to program the chip so that it buffers the readings. I have tried using number/hex converter and number/string converter, either case, the fact that VISA Write spits one byte at a time hinders the programming. For example: I defined numbers 1 to 5 represents 20% to 100% power output with 20% increment Then I defined "10" as "90%" power, but it reads "1" "0" seperately, so the actual out put is "20%" then "0%".
I used the example VI provided by NI : advanced serial write/read. For convenience, attached here. Not all modification I made is saved.
02-29-2008 11:13 AM
02-29-2008 11:17 AM
Some of the things you are saying is contradictory. 00 to 7F is not two bytes, it is one byte.
All serial transmission is done one byte at a time, not just in LabVIEW.
Number/hex and Number/string conversion is not correct. If you want to send hex, the simplest way is to right click on your string contro/constant and select Hex Display. Now you can enter in a single byte (00 to 7F). You can also use a numeric control/constant and the Byte to String Array or just the Type Cast function.
03-01-2008 12:46 AM
Atmega128 also reads one byte at the time. And when the receiving info, is more than one byte, you always have to buffer it (in the mega128).
VISA works the the same way.
Raw numbers are easier to use, than ASCII. If you use ASCII the mega128 should decode the incomming data.