01-16-2024 10:55 PM
Of course does it give you an error! you tell it to read 1024 byre but your device only rdd we turns 1 byte and there is no termination character on which the read could detect that the message is finished!
Use at least Serial,writeln() on the Arduno side, but what I wrote before still applies, That only solves the problem from your device to the PC. The communication from your PC to your device is still unsynchromized.
01-16-2024 11:00 PM
But everything seems to work fine in putty and coolterm
01-16-2024 11:03 PM - edited 01-16-2024 11:07 PM
Those are terminal programs and work a little bit different. You wouldn’t want to talk with a Spectrum Analyzer with putty, would you?
You could program a terminal like application in LabVIEW but it would be a lot more unreliable to do “real” instrument control, than using proper command termination so that both sides reliably know when the other side has finished talking.
01-17-2024 07:38 AM
@ms6 wrote:
But everything seems to work fine in putty and coolterm
But now you are trying to program what YOU do with the terminal. This gets into how I see programming: you have to slow down your brain and figure out what it does and force the computer to that. You send your command and then you sit there and wait for the response and you know when the response is complete. How do you know it completed? This is why you need a proper messaging protocol to make it obvious when a message is complete.