고정밀 환경 SENSOR

SIMPLE, FAST, PRECISE, ACCESSIBLE

커맨드라인에서 장치 데이터 액세스 하기 - dracal-usb-get

dracal-usb-get을 사용하여 Dracal 장치의 데이터에 액세스하십시오.

소개

커맨드 라인 도구 dracal-usb-get은 사용자를 위해 특별히 개발되어 모든 Dracal 센서에서 생성 된 데이터에 직접 액세스 할 수 있습니다. USB 프로토콜을 통한 통신. 이러한 도구를 사용할 때의 장점은 다양하며, 그 중 가장 주목할만한 것은 선택한 소프트웨어에 데이터를 통합하는 것입니다. 로 이동 리소스 사이트의 섹션은 방법에 대한 구체적인 예를 찾아 내기 위해 dracal-usb-get을 여러 프로그래밍 언어로 사용하십시오. 또는 예를 보려면 LabVIEW에서의 통합 소프트웨어. 이 페이지에서 명령 줄 도구에서 제공하는 주요 기능에 대한 문서를 찾을 수 있습니다. dracal- usb-get. 일부 기능을 로컬 버전에서 사용할 수 없는 것 같으면 최신 버전을 무료로 다운로드 하십시오..

1) 설치

윈도우 그리고 맥 OS X 사용자 : dracal-usb-get.exe

dracal-usb-get 명령줄 도구는 드라칼뷰. Windows 또는 Mac OS X에서는 DracalView를 설치하기만 하면 됩니다.
설치 후 설치 디렉토리로 이동합니다 (일반적으로 "c : program files\DracalView"또는 "c : program files (x86) \DracalView")에서 dracal-usb-get.exe 파일을 찾을 수 있습니다.

리눅스 사용자 : Compile dracal-usb-get

dracal-usb-get 명령줄 도구는 리눅스에서 드라칼 센서 사용 페이지의 지침을 따라 소스에서 컴파일해야 합니다.

2) 도움말

시작하려면 원하는 만큼 자주 명령을 실행하여 사용 가능한 명령의 완전하고 자세한 목록에 액세스 하십시오

dracal-usb-get -h

C:\Program Files (x86)\DracalView> dracal-usb-get -h

Valid arguments:

-V Display version information

-v Verbose mode

-h Displays help

-l List and display info about available sensors

-f Full list mode. (shows unused/unconfigured channels)

-s serial Use USB sensor with matching serial number. Default: Use first.

-i id<,id,id...> Use specific channel(s) id(s) or 'a' for all. Default: 0

-R num If a USB command fails, retry it num times before bailing out

-T unit Select the temperature unit to use. Default: Celsius

-P unit Select the pressure unit to use. Default: kPa

-F unit Select the frequency unit to use. Default: Hz

-M unit Select the length unit to use. Default: m

-C unit Select the concentration unit to use. Default: Sensor default

-p Enable pretty output

-7 Use 7-bit ASCII output (no Unicode degree symbols)

-u Print uncalibrated values, i.e. do not apply user calibration configured by dracal-usb-cal

-L logfile Log to specified file (use - for none)

-I interval Log interval. In milliseconds. Default: 1000

-x num Set number of digits to display after the decimal separator. Default: 2

-S value Set standard sea level pressure (Pascals) used to compute altitude. Default: 101325

-o option Enable specified option (see below). You may use -o multiple times.


Options:

no_humidex_range Calculate humidex even if input values are out of range.

no_heat_index_range Calculate heat index even if the input values are out of range.

old_sht75 Use the old SHT RH compensention coefficients.

legacy_errors Output channel errors in the old (unspecific) way.

For instance: The string 'err' instead of 'ProbeDisconnected'


Valid temperature units:

Celsius, C, Fahrenheit, F, Kelvin, K


Valid pressure units:

kPa, hPa, Pa, bar, at (98.0665 kPa), atm (101.325 kPa), Torr, psi, inHg


Valid frequency units:

mHz, Hz, kHz, MHz, rpm


Valid length units:

mm, cm, dm, m, mil, in, ft, yd


Valid concentration units:

ppb, ppm, percent


Errors:


When an error occurs reading a channel, the value is replaced by an error string:

Undefined Unknown/undefined error.

Saturated Sensor (or resulting value) is saturated and unusable.

SensorError The physical sensor or interface circuitry is not working properly

ProbeDisconnected Indicates that the probe is disconnected or cable is cut/open

OutOfRange The reading falls outside the sensor possible or supported range

InvalidData The data received from the sensor did not make sense or was incomplete


Note: If pretty output is enabled (see -p) there will be spaces in the error messages. See also

the 'legacy_errors' option to restore the old behaviour of returning 'err', regarless

of what the specific error was.


Return value:

- On success, dracal-usb-get returns 0.

- If the requested serial number (see -s) was not found, or if no devices were found (-f and -l) a non-zero value is returned.

3) 센서 목록 : -l

명령을 실행하여 통신 프로토콜이 USB인 장치에 연결된 모든 Dracal 센서의 일반적인 특성을 나열하고 가져옵니다. 아래 예제에서는 USB-DXC100과 USB-PTh300이라는 두 개의 센서가 연결되어 있습니다.

dracal-usb-get -l

C:\Program Files (x86)\DracalView> dracal-usb-get -l

Found: 'USB-PTh300', Serial: 'E00004', Version 1.3, Channels: 7

Channel 0: MS5611 Pressure [Pressure]

Channel 1: SHT31 Temperature [Temperature]

Channel 2: SHT31 Relative Humidity [Relative Humidity]

Virtual Channel 256: Dew point [Dew point]

Virtual Channel 257: Humidex [Humidex]

Virtual Channel 258: Heat index [Heat index]

Virtual Channel 262: Altitude [Height]

Found: 'USB-DXC100', Serial: 'E00001', Version 1.1, Channels: 3

Channel 0: SCD30 CO2 GAS PPM [CO2 Gas PPM]

Channel 1: SCD30 Temperature [Temperature]

Channel 2: SCD30 Relative Humidity [Relative Humidity]

감지된 각 센서에 대해 제품 코드(Found: ), 일련 번호(Serial: ), 펌웨어 버전, 사용 가능한 데이터 채널 수 그리고 그들의 설명이 표시됩니다.
참고 1: 가상 채널은 데이터가 "실제" 채널로부터 계산되는 채널입니다. 실제 채널은 센서가 직접 측정한 물리량에 해당합니다.
참고 2: Linux에서 센서가 발견되지 않으면 도구를 실행하는 사용자에게 필요한 액세스 권한이 없기 때문일 수 있습니다. 상담 액세스 권한 구성 의 섹션 리눅스에서 드라칼 센서 사용 자세한 내용은 페이지입니다. 이제 정확한 센서의 데이터에 관심이 있음을 지정하려면 USB-PTh300 E00004 와 같은 일련 번호를 입력해야 합니다.

4) 다른 채널의 데이터 액세스 : - i 및 - s 명령

우리는 USB-PTH300이 7 개의 데이터 채널, 3 개의 실제 및 4 개의 가상을 사용할 수 있음을 발견했습니다. 이제 명령을 통해 센서에서 생성 된 데이터에 액세스하는 방법을 살펴 보겠습니다. 이 명령은 센서의 일련 번호(-s 명령을 통해)를 입력해 표시할 채널을 사용합니다. 다음 예제에서는 처음 세 채널, 즉 채널 0,1 및 2의 데이터에 액세스합니다. -i

dracal-usb-get -i

C:\Program Files (x86)\DracalView> dracal-usb-get -s E00004 -i 0,1,2

103.17, 25.11, 28.40

데이터가 표시되는 순서는 채널의 입력 순서에 해당합니다. 예를 들어 처음 3개 채널을 역순으로 나열하려면 다음 명령을 보내면 됩니다. 만일 하나의 센서만 연결되어 있는 경우에는 일련번호를 입력할 필요가 없습니다.

C:\Program Files (x86)\DracalView> dracal-usb-get -s E00004 -i 2,1,0

28.37, 25.14, 103.17

4.1) 모든 채널을 나열하지 않고 액세스: -a 명령

전체 채널 목록 (여기에는 7 개가 있음)에 액세스하려면 다음과 같이 채널 목록을 매개 변수 a로 바꿉니다.

C:\Program Files (x86)\DracalView> dracal-usb-get -s E00004 -i a

103.17, 25.11, 28.38, 5.50, 24.57, 25.11, -152.22

4.2) 세부사항 수로: 명령 -p

-p 명령("pretty output")을 추가하여 각 채널의 내용을 자세히 설명할 수 있습니다. 바로 위의 예제를 사용하여 -p 명령을 추가하면 다음과 같은 결과를 얻을 수 있습니다. -7 옵션은 특수문자를 제거하고 표시합니다.

C:\Program Files (x86)\DracalView> dracal-usb-get -s E00004 -i a -p -7

Pressure: 103.15 kPa

Temperature: 25.04 C

Relative Humidity: 28.35 %

Dew point: 5.43 C

Humidex: 24.47 C

Heat index: 25.04 C

Height: -150.82 m

우리가 압력, 온도, 상대 습도 및 해발 위의 높이에만 관심이 있다고 가정하면 명령을 입력 할 수 있습니다.

C:\Program Files (x86)\DracalView> dracal-usb-get -s E00004 -i 0,1,2,262 -p -7

Pressure: 103.15 kPa

Temperature: 24.99 C

Relative Humidity: 28.29 %

Height: -150.99 m

5) 단위 지정: 명령 -T,-P,-F,-M,...

일련 번호가 E00004 인 센서 USB-PTh300의 데이터를 계속 사용하여 출력 단위를 변경하는 방법을 살펴 보겠습니다. -help 명령을 참조하여 현재 버전의 DracalView에서 지원하는 장치 유형(온도, 압력, 길이 등) 목록과 각 유형에 사용할 수 있는 장치 목록을 가져옵니다. 다음 예제에서는 -P bar 명령을 추가하여 압력 단위(기본적으로 kPa)를 bar로 변환합니다. (변환 없이)

C:\Program Files (x86)\DracalView> dracal-usb-get -s E00004 -i 0 -p

Pressure: 101.98 kPa


C:\Program Files (x86)\DracalView> dracal-usb-get -s E00004 -i 0 -p -P bar

Pressure: 1.02 bar

이 첫 번째 변환 외에도 -T f 명령을 추가하여 화씨에 온도 단위를 표시 할 수 있습니다. (변환 없이)

C:\Program Files (x86)\DracalView> dracal-usb-get -s E00004 -i a -p -7 -P bar -T f

Pressure: 1.02 bar

Temperature: 74.41 F

Relative Humidity: 34.66 %

Dew point: 44.71 F

Humidex: 74.48 F

Heat index: 74.41 F

Height: -52.48 m

6) 고도 계산: -S 명령

가상 "고도"채널은 측정 된 대기압과 기본적으로 해수면에있는 "기준"대기압을 기반으로 계산되는 채널입니다. 후자는 101325 Pa로 설정됩니다. 그러나, -S 명령으로 기준 대기압의 값을 변경할 수 있다. 이것은 우리가이 시점에서 대기압의 값을 알고 있다면 기준점에서 높이를 계산할 수있게합니다. 예를 들어, 현재 높이를 제로 높이로 설정하려면 먼저 대기압을 측정합니다.

C:\Program Files (x86)\DracalView> dracal-usb-get -f -i 0.262 -7 -p -P Pa

Pressure: 101167.00 Pa

Height: 13.16 m

7) 교정 된 데이터 관리 : 명령 -u

일부 드라칼 제품 드라칼 3 포인트 교정 기능이 있습니다.. 교정 가능한 제품에서는 교정 지점의 추가가 등록 즉시 적용됩니다. 따라서 보정 지점이 설정되면 DracalView 및 dracal-usb-get에 의해 표시되는 데이터는 기본적으로 즉시 보정됩니다. 그러나 교정 설정의 효과를 시각화하고 검증하기 위해 이러한 도구에 보정되지 않은 데이터에 액세스하고 표시하도록 요청할 수 있습니다. dracal-usb-get에서 -u (uncalibrated) 옵션을 사용하면 사용자가 Dracal 장치의 보정되지 않은 데이터에 액세스 할 수 있습니다. 예를 들어 USB-PTh300-CAL에 대해 압력 보정 지점이 하나만 입력되었다고 가정합니다.

C:\Program Files (x86)\DracalView> dracal-usb-cal -s E16026 -l -p

Device: 'USB-PTh300-CAL', Serial: 'E16026', Version 1.4, Channels: 3

Channel 0: MS5611 Pressure [Pressure]

Point 0: 101.2, 101.3 [kPa]

Point 1: ** none **

Point 2: ** none **

Channel 1: SHT31 Temperature [Temperature]

Point 0: ** none **

Point 1: ** none **

Point 2: ** none **

Channel 2: SHT31 Relative Humidity

Point 0: ** none **

Point 1: ** none **

Point 2: ** none **

8) 파일에 데이터 저장 : -L 명령

-L 명령을 사용하여 데이터를 .csv 형식으로 파일에 저장합니다. 지정된 파일이 없으면 명령을 보낼 때 파일이 작성됩니다. 이미 존재하는 경우 데이터는 파일의 기존 내용("추가 모드")에 연결됩니다. 예를 들어 C:UsersPublicDocuments에 있는 test.csv라는 파일에 데이터를 저장하려면 다음 명령을 입력합니다.

C:\Program Files (x86)\DracalView> dracal-usb-get -s E00004 -i a -L C:UsersPublicDocumentstest.csv

Log mode on.

Opened file 'C:UsersPublicDocumentstest.csv' for logging. Append mode.

101.57, 24.47, 33.85, 7.51, 24.68, 24.47, -20.12

101.57, 24.47, 33.84, 7.51, 24.68, 24.47, -20.21

101.57, 24.51, 33.88, 7.56, 24.75, 24.51, -20.21

101.57, 24.51, 33.85, 7.55, 24.74, 24.51, -20.12

101.57, 24.50, 33.87, 7.55, 24.73, 24.50, -20.21

101.57, 24.47, 33.84, 7.51, 24.68, 24.47, -20.04

^C

8.1) 데이터 저장 주기 변경: -I 명령

이 명령을 사용하여 데이터 기록 빈도를 밀리초(ms)로 지정합니다. 기본 기록 주파수(지정되지 않은 경우)는 1000ms입니다. 요점을 설명하기 위해 다음 두 명령을 연속적으로 실행하여 작성하는 새 파일 "test2.csv"을 만듭니다.-I


C:\Program Files (x86)\DracalView> dracal-usb-get -s E00004 -i a -L "C:UsersPublicDocumentstest2.csv -I 100"