LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Collecting and interpretting data in Labview

Solved!
Go to solution

@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.

Download All
0 Kudos
Message 31 of 35
(1,034 Views)

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:

  • anything in brackets is optional
  • <CR> means CarriageReturn aka 0x0D aka \r
  • <LF> means LineFeed aka 0x0A aka \n

(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:

check.png

Why did you use a typedef for this string constant???

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 32 of 35
(1,025 Views)

Sorry, it's my fault. I realize that I have attached wrong files Smiley Sad 

Now I've added what I did. 

Download All
0 Kudos
Message 33 of 35
(1,016 Views)

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!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 34 of 35
(1,001 Views)

Thank you very much GerdW for your advice and solution Smiley Happy

0 Kudos
Message 35 of 35
(987 Views)