07-31-2019 03:05 AM - edited 07-31-2019 03:08 AM
@GerdW wrote:
Hi bestecf,
I understood better, thank you now it's ok. (codes_display.png) When I change display style," \s\n" is added by .vi.
No, you don't understand that at all!
- The VI doesn't "add" any chars when changing the display style - it simply shows them in a different way. YOU inserted those chars (SPACE and LINEFEED).
- Don't add those "<0D><0A>" in that string constant. This is completely non-sense and shows you don't understand the meaning of the explanations in your manual. That "<0A>" is actually the "\n" in \-code display mode…
Other things:
- You don't need to set parameters at SerialPortInit when they are the default values.
- Use AutoCleanup! Right now there are hidden code parts…
Dear GerdW, you take great pains and also I'm trying/applying what you say. I might have misunderstood. Right now, I'm gonna try to connect device.
07-31-2019 03:19 AM - edited 07-31-2019 03:20 AM
Hi bestecf,
did you understand any of my comments from previous message?
You're not even using AutoCleanup…
The command is given as "COM[,a]<CR>[<LF>]" in the manual:
(All these items are surely explained in your manual!)
So your command can be given as "COM\r\n" in a string constant set to \-code display mode:
Why did you use a typedef for this string constant???
07-31-2019 03:27 AM - edited 07-31-2019 03:44 AM
Sorry, it's my fault. I realize that I have attached wrong files
Now I've added what I did.
07-31-2019 03:45 AM - edited 07-31-2019 03:47 AM
Hi bestecf,
But I dont understand in .vi, <CR> aka \s (I changed as \r), <LF> aka \n
Generic advice: Read Wikipedia on ASCII codes! (And learn this table…)
Specific advice: <CR> is NOT "\s", it's \r in \-code. "\s" is a simple SPACE aka 0x20. Read the LabVIEW help to learn about the possible \-codes!
07-31-2019 05:00 AM
Thank you very much GerdW for your advice and solution ![]()