<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <meta name="generator" content="Adobe RoboHelp 2019" />
 <title>バイナリ値を電圧値へ変換</title>
<link rel="StyleSheet" href="../../ms_help.css" type="text/css" />
 <script type="text/javascript" language="JavaScript">
//<![CDATA[
function reDo() {
  if (innerWidth != origWidth || innerHeight != origHeight)
     location.reload();
}
if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
	origWidth = innerWidth;
	origHeight = innerHeight;
	onresize = reDo;
}
onerror = null; 
//]]>
</script>
<style type="text/css">
<!--
div.WebHelpPopupMenu { position:absolute;
left:0px;
top:0px;
z-index:4;
visibility:hidden; }
p.WebHelpNavBar { text-align:right; }
-->
</style>

<script type="text/javascript" src="../../template/scripts/rh.min.js"></script>
<script type="text/javascript" src="../../template/scripts/common.min.js"></script>
<script type="text/javascript" src="../../template/scripts/topic.min.js"></script>
<script type="text/javascript" src="../../template/scripts/constants.js"></script>
<script type="text/javascript" src="../../template/scripts/utils.js"></script>
<script type="text/javascript" src="../../template/scripts/mhutils.js"></script>
<script type="text/javascript" src="../../template/scripts/mhlang.js"></script>
<script type="text/javascript" src="../../template/scripts/mhver.js"></script>
<script type="text/javascript" src="../../template/scripts/settings.js"></script>
<script type="text/javascript" src="../../template/scripts/XmlJsReader.js"></script>
<script type="text/javascript" src="../../template/scripts/loadparentdata.js"></script>
<script type="text/javascript" src="../../template/scripts/loadscreen.js"></script>
<script type="text/javascript" src="../../template/scripts/loadprojdata.js"></script>
<script type="text/javascript" src="../../template/scripts/mhtopic.js"></script>
 <link rel="stylesheet" type="text/css" href="../../template/styles/widgets.min.css">
 <link rel="stylesheet" type="text/css" href="../../template/styles/topic.min.css">
<script type="text/javascript" >
gRootRelPath = "../..";
gCommonRootRelPath = "../..";
gTopicId = "5.4.0_5";
</script>
 <meta name="brsprev" value="usage/saving_data/csv_file_formation.htm">
 <meta name="brsnext" value="usage/printing.htm">
 <meta name="topic-breadcrumbs" content="使用方法 > データの保存・読み込み" />
</head>

<body>
<script type="text/javascript" src="../../ehlpdhtm.js"></script>

<!-- Google Tag Manager (noscript) -->
<noscript>
<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-P45RPFN" style="width: 0px; 
		 height: 0px; display: none; visibility: hidden;">
 <p>&#160;</p>
</iframe>
</noscript>
<!-- End Google Tag Manager (noscript) -->
<div><script type="text/javascript" language="javascript">//<![CDATA[
document.write("<p  style=\"text-align:left;\" class=\"breadcrumbs\">");
AddMasterBreadcrumbs("../../c_logger.htm", "breadcrumbs", " &gt; ", "ホーム", "../../welcome/c_logger.htm");
document.write("<a class=\"breadcrumbs\" href=\"../usage.htm\">使用方法<\/a>  &gt;  <a class=\"breadcrumbs\" href=\"../saving_and_loading_data.htm\">データの保存・読み込み<\/a>  &gt;  バイナリ値を電圧値へ変換<\/p>");
//]]></script>
</div>

<h1>バイナリ値を電圧値へ変換</h1>
<hr align="left" />
<p>CSV形式の収集データファイルには、バイナリ値（１０進数）が保存されています。<br />
このため、C-LOGGER以外のアプリケーションソフトで、収集データファイルを見込む場合は、バイナリ値を電圧データへ変換する必要があります。</p>
<p>バイナリ値を電圧値へ変換する場合は、次の算出式を利用します。</p>
<p style="margin-left: 40px; font-weight: bold;">電圧値 = バイナリ値 × （レンジ最大値 
 - レンジ最小値） ÷ 分解能 + レンジ最小値</p>
<p style="margin-left: 40px;">&#160;</p>
<p>右辺式の各固有の値は、CSVファイル内の「収集実行情報」や、「収集チャネル情報」に格納されています。<br />
このため、CSV形式の収集データファイルを読み込めば、容易に電圧データへ変換することができます。</p>
<p>詳細は、「<a href="csv_file_formation.htm">CSV形式ファイルの構成</a>」トピックを参照ください。</p>
<table class="AlternateBlueWithBlankHeader" style="margin-left: 40px; border-collapse: separate; 
		 border-collapse: separate;" cellspacing="0px" width="100%" border="1">
	<col style="width: 23.077%;" />
	<col style="width: 38.462%;" />
	<col style="width: 38.462%;" />
	<tr class="t1st">
		<td><p>算出パラメータ</p></td>
		<td><p>収集データファイル内のブロック</p></td>
		<td><p>収集データファイル内の項目</p></td>
	</tr>
	<tr class="t2Row">
		<td><p>バイナリ値</p></td>
		<td><p>収集データ</p></td>
		<td><p>&quot;Data&quot;行以降</p></td>
	</tr>
	<tr class="t1Row">
		<td><p>レンジ最大値</p></td>
		<td><p>収集チャネル情報</p></td>
		<td><p>MaxScale</p></td>
	</tr>
	<tr class="t2Row">
		<td><p>レンジ最小値</p></td>
		<td><p>収集チャネル情報</p></td>
		<td><p>MinScale</p></td>
	</tr>
	<tr class="t1Row">
		<td><p>分解能</p></td>
		<td><p>収集実行情報</p></td>
		<td><p>Resolution</p></td>
	</tr>
</table>
<p style="margin-left: 40px;">&#160;</p>
<p style="margin-left: 0px;">使用されたデバイスタイプによって、右辺の「分解能」に代入する値が異なります。</p>
<table class="AlternateBlueWithBlankHeader" style="margin-left: 40px; border-collapse: separate; 
		 border-collapse: separate;" cellspacing="0px" width="100%" border="1">
	<col style="width: 25%;" />
	<col style="width: 25%;" />
	<col style="width: 25%;" />
	<col style="width: 25%;" />
	<tr class="t1st">
		<td><p>デバイスタイプ</p></td>
		<td><p>Resolution</p></td>
		<td><p>バイナリ値(10新数)の範囲</p></td>
		<td><p>右辺に代入する分解能</p></td>
	</tr>
	<tr class="t2Row">
		<td><p>12ビット分解能デバイス</p></td>
		<td><p>12</p></td>
		<td><p>&#160;0～4095</p></td>
		<td><p>4096</p></td>
	</tr>
	<tr class="t1Row">
		<td><p>16ビット分解能デバイス</p></td>
		<td><p>16</p></td>
		<td><p>0～65535</p></td>
		<td><p>65536</p></td>
	</tr>
</table>
<p>&#160;</p>
<p>&#160;</p>
<p>例１）16ビット分解能のデバイスを使用し、入力レンジを±10Vで収集</p>
<p style="margin-left: 40px;">バイナリ値が32767の場合の電圧値は、以下の計算により -0.0003V となります。</p>
<p style="margin-left: 40px;">（詳細）16ビット分解能のデバイスの場合、式に代入する分解能は65536です。</p>
<p style="margin-left: 80px;">電圧値 = バイナリ値 x (レンジ最大値 - レンジ最小値) ÷ 分解能 + レンジ最小値<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;= &#160;32767 
 × ( 10 – (-10) ) ÷ 65536 + (-10) <br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;＝ -0.0003V</p>
<p style="margin-left: 40px;">&#160;</p>
<p>例２）12ビット分解能のデバイスを使用し、入力レンジを4～20mAで収集</p>
<p style="margin-left: 40px;">バイナリ値が3072の場合の電流値は、以下の計算により 16.000mA となります。</p>
<p style="margin-left: 40px;">（詳細）12ビット分解能のデバイスの場合、式に代入する分解能は4096です。</p>
<p style="margin-left: 80px;">電流値 = バイナリ値 x (レンジ最大値 - レンジ最小値) ÷ 分解能 + レンジ最小値<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;= &#160;3072 
 × ( 20 – 4 ) ÷ 4096 + 4 <br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;＝ 16.000 
 mA</p>
<p>&#160;</p>
<p>&#160;</p>
<div style="width: 100%; position: relative;" id="footer">
	<hr align="center" />
	<p>当サイトでは、お客様の利便性向上のために、Cookieを使用しています。<a href="https://www.contec.com/jp/privacy#anc-01">詳細はこちら。</a></p>
</div>
</body>
</html>
