Benchtop Measurement and Test
Distributed Measurement and Control
High-Performance Test
Systems Engineering Software
Perspectives showcases how NI sees what’s next in the world of test and technology.
You can request repair, RMA, schedule calibration, or get technical support. A valid service agreement may be required.
Provides support for NI data acquisition and signal conditioning devices.
Provides support for Ethernet, GPIB, serial, USB, and other types of instruments.
Provides support for NI GPIB controllers and NI embedded controllers with GPIB ports.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
概要
文字列に16進数を入力する場合、標準表示で入力する場合と、16進数表示で入力する場合があるかと思います。その双方で、数値10進数として表示させる際の変換方法をご紹介します。
詳細
・16進数文字列からの変換の場合、型変換関数を使用します。
・標準文字列からの変換の場合、16進数文字列を数値に変換関数を使用します。
実装・実行方法
1. VIを実行し、16進数表示文字列と標準表示文字列双方の変換が同一であることを確認してください。
2. ブロックダイアグラムにてそれぞれどのように変換が行われているのか確認してください。
必要なもの
ソフトウェア
LabVIEW2016
もしくは
LabVIEW2013以降
VIスニペット
とてもよいサンプルありがとうございます。
このサンプルを使ったお客様からの連絡がありましたので、共有します。
上記にサンプルの注意点は型変換(Type Cast)を使う場合は文字を4の倍数入力する必要があります。
「16進数文字列を数値に変換」関数の場合: hex(AA) > hex(00AA)と扱われて 170 OK
「型変換」関数の場合: hex(AA) > hex(AA00)と扱われて -22016 NG
になります。
そのため、「型変換」関数でHex(AA)を変換したい場合は00AAを入力してください。
What do you need our team of experts to assist you with?
Thanks!
We'll be in touch soon!