LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEWで特定の数値のみを表示させる方法

LabVIEWで特定の数値を表示器を用いて表示させたいです。文字、数字、文字、数字となっている文から数字のみを抜き取りたいです。今回の場合0025.4のみを表示させたいです。日本人なので拙い英語で申し訳ないです。よろしくお願いいたします。

 

I want to display a specific number in LabVIEW using a display unit. I want to extract only numbers from a sentence that has letters, numbers, letters, and numbers. In this case I want to display only 0025.4. Sorry for my poor English, I am Japanese. Thank you in advance.

0 Kudos
Message 1 of 4
(779 Views)

Hi kazunari,

 


@kazunari wrote:

I want to display a specific number in LabVIEW using a display unit. I want to extract only numbers from a sentence that has letters, numbers, letters, and numbers. In this case I want to display only 0025.4. Sorry for my poor English, I am Japanese. Thank you in advance.


ScanFromString is your friend:

There are more options to parse a string, depending on your other requirements…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(767 Views)

Dear GerdW, Thank you for taking the time to reply.
Sorry for the lack of explanation. I want to control a temperature measuring device and display the measured values. When I create and run the program as you have taught me, I get an "Error code - 1073807339" and it times out. Should I put a delay time in this case? If so, how should I do it?
Thank you in advance.


Kazunari

0 Kudos
Message 3 of 4
(714 Views)

Hi kazunari,

 


@kazunari wrote:

When I create and run the program as you have taught me, I get an "Error code - 1073807339" and it times out. Should I put a delay time in this case? If so, how should I do it?


That error is not related to string parsing as requested in your first message…

It is a simple "serial comm timeout" error: your device does not respond within the (default) timeout period!

Placing another delay in the VI will not help here: how should it improve to receive a device response?

 

Solution:

  • Read the manual of your device to learn how to send correct commands and how to receive responses.
  • Implement error handling in your VI.
  • Watch this excellent video about proper serial communication.
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(701 Views)