LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Collecting and interpretting data in Labview

Solved!
Go to solution

Can I run this .vi project for my aim?

0 Kudos
Message 21 of 35
(1,882 Views)

Hi bestecf,

 

Can I run this .vi project for my aim?

Yes.

 

In your "System.jpg" the controller "Inficon VGC501" is visible. The producer of that controller provides a manual for that device on its website. Download the manual, read it, and follow the descriptions given in chapter 5…

Best regards,
GerdW


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

I'm going to go step by step onto manual review with your help. 

1) I have a lv project which is read_vacuum.vi

2) I connected 2 usb cables to my computer.

3) Device manager doesnt give error about connection. But it shows 5 COM ports. (4 ATEN which is rs232 to usb converter device, 1 SERIAL PORT)

4) LV project has an error.

5) Then, I read first part of manual. page 65 , Should I write a COM command to while loop? / Which port should is read ?

 

I'm beginner sorry. Smiley Indifferent

0 Kudos
Message 23 of 35
(1,839 Views)

Hi bestecf,

 

1) I have a lv project which is read_vacuum.vi

That's just a VI, but no "project"…

 

2) + 3)

Totally irrelevant here…

 

4) LV project has an error.

It's not the "project", which has an error. It's the VI!

Just double-click the error to see the error in the block diagram…

 

5) Then, I read first part of manual. page 65 , Should I write a COM command to while loop? / Which port should is read ?

That "COM" command is explained on page 70. Read your manual…

Use the serial port which is used to connect your device with your computer.

 

General suggestion: It is not very nice to attach just images of VI(s). Attach the real VI…

Best regards,
GerdW


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

I connected to INFICON VGC501 with USB cable. There is no error but "dataout" didnt show anything from serial port. And I should add ASCII with 3-character mnemonics. (with VISA WRITE) 

How do I send the following line to port?

Transmit: COM [,1] <CR>[<LF>]

 

Download All
0 Kudos
Message 25 of 35
(1,788 Views)
Solution
Accepted by topic author bestecf

Hi bestecf.

 

don't use BytesAtPort!

 

Simple as this:

check.png

Take note of the display style of the string constant. Set your "data out" to also show \-codes!

(Put a wait of ~500ms into the loop.)

Best regards,
GerdW


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

@GerdW wrote:

Simple as this:

check.png


Thanks to show your simple example. 
If you check data_format.png in the previous, you may help me about writing ASCII with 3-character mnemonics. How to send it ? For example: COM [,1] <0D>[<0A>] hex format or only COM [,1] 0D0A ? And also i'm confused of entering byte count to VISA WRITE. 32 or 64, according to what.

 

Sorry for my questions Smiley Frustrated

 

0 Kudos
Message 27 of 35
(1,751 Views)

Hi bestecf,

 

How to send it ? For example: COM [,1] <0D>[<0A>] hex format or only COM [,1] 0D0A ?

Do yu see my snippet?

I entered the command "COM<0d><0a>" in the string constant. (Take care of choosing the right display style…)

 

And also i'm confused of entering byte count to VISA WRITE. 32 or 64, according to what.

As your device answers with a trailing LF (LineFeed, <0A>) you simply have to request more bytes than you expect in the answer string. In the snippet I choose 9, you may also request 32, 64, or even 999 bytes…

Best regards,
GerdW


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

 

 

(Take care of choosing the right display style…)

 

I understood better, thank you now it's ok. (codes_display.png) When I change display style," \s\n" is added by .vi. 

 

As your device answers with a trailing LF (LineFeed, <0A>) you simply have to request more bytes than you expect in the answer string. 

 

Thank you GerdW for your elucidating.

 

0 Kudos
Message 29 of 35
(1,738 Views)

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…
Best regards,
GerdW


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