<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Adobe RoboHelp 2019" />
<title>Fileサンプル</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.1.3.2.0_2";
</script>
 <meta name="brsprev" value="sdk/windows_api/sample/python/multi_channel_wave.htm">
 <meta name="brsnext" value="sdk/windows_api/faq/startup_for_visual_studio.htm">
 <meta name="topic-breadcrumbs" content="C-WaveformGenerator SDKについて > Windows API > サンプルプログラム > CUIサンプルプログラム一覧" />
</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_waveformgenerator.htm", "breadcrumbs", " &gt; ", "ホーム", "../../../../welcome/c_waveformgenerator.htm");
document.write("<a class=\"breadcrumbs\" href=\"../../../welcome/c_waveformgenerator_sdk.htm\">C-WaveformGenerator SDKについて<\/a>  &gt;  <a class=\"breadcrumbs\" href=\"../../windows_api.htm\">Windows API<\/a>  &gt;  <a class=\"breadcrumbs\" href=\"../sample_program.htm\">サンプルプログラム<\/a>  &gt;  <a class=\"breadcrumbs\" href=\"../sample_program_list_cui.htm\">CUIサンプルプログラム一覧<\/a>  &gt;  Fileサンプル<\/p>");
//]]></script>
</div>

<h1>Fileサンプル [FileOperation]</h1>
<hr align="center" />
<h2>外観</h2>
<p style="margin-left: 40px;"><img src="file_operation.png" alt="" style=" border:none; width:100%; max-width:381px;" border="0" /></p>
<p>&#160;</p>
<h2>概略</h2>
<p style="margin-left: 40px;">C-WaveformGeneratorを起動させるクライアントアプリケーションのサンプルです。</p>
<p style="margin-left: 40px;">このサンプルを実行する前に、以下の準備を行ってください。</p>
<p style="margin-left: 40px;">あらかじめC-WaverformGenerator本体でデバイス設定やチャネル設定を行い、デバイスから波形出力できること確認ください。<br />
正常にデバイスから波形出力できる状態で、ローカルドライブに設定内容をファイル保存してください。</p>
<p style="margin-left: 40px;">C-WaverformGeneratorの設定ファイルがない場合は、「<a href="multi_channel_wave.htm">複数チャネル波形設定サンプル</a>」を参照されることをおすすめします。</p>
<table class="AlternateBlueWithBlankHeader" style="margin-left: 40px;" cellspacing="0px" width="95%">
	<tr class="t1st">
		<td><p>サンプル仕様</p></td>
		<td><p>&#160;</p></td>
	</tr>
	<tr class="t2Row">
		<td><p>プログラム名</p></td>
		<td><p>FileOperation.py</p></td>
	</tr>
	<tr class="t1Row">
		<td><p>関連ファイル名</p></td>
		<td><p>CommonFunction.py<br />
		cgen_api.py</p></td>
	</tr>
</table>
<p>&#160;</p>
<h2>使用手順</h2>
<p style="margin-left: 40px;">１．<span style="font-variant-ligatures: normal; 
										 font-variant-caps: normal; font-size: 10pt; 
										 color: 黒; orphans: 2; widows: 2; 
										 -webkit-text-stroke-width: 0px; 
										 text-decoration-thickness: initial; 
										 text-decoration-style: initial; 
										 text-decoration-color: initial;">希望するプログラム名を指定し、プログラム実行させると、上記のような外観</span><span 
	 style="font-size: 13.3333px; background-color: 白; display: inline	 ! important ; 
	 float: none;">のCUI(Character User Interface)メニュー</span><span style="font-variant-ligatures: normal; 
	 font-variant-caps: normal; font-size: 10pt; color: 黒; orphans: 2; 
	 widows: 2; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; 
	 text-decoration-style: initial; text-decoration-color: initial;"> 
 が表示されます。<br />
　　ソフトウェアのバージョンによっては外観が異なることがあります。</span></p>
<p style="margin-left: 80px;"><span style="font-variant-ligatures: normal; 
									 font-variant-caps: normal; font-size: 10pt; 
									 color: 黒; orphans: 2; widows: 2; -webkit-text-stroke-width: 0px; 
									 text-decoration-thickness: initial; 
									 text-decoration-style: initial; text-decoration-color: initial;">プログラム実行例：　py 
 FileOperation.py</span></p>
<p style="margin-left: 40px;">２．初期化処理</p>
<p style="margin-left: 40px; font-variant-ligatures: normal; font-variant-caps: normal; 
	 font-size: 10pt; color: 黒; orphans: 2; widows: 2; -webkit-text-stroke-width: 0px;">　・CUIメニューから、[1 
 : GenOpenApplication]をコマンド選択すると、デバイス名を指定することができます。　<br style="color: 黒; 
														 font-family: メイリオ; 
														 font-size: 13.3333px; 
														 font-style: normal; 
														 font-variant-ligatures: normal; 
														 font-variant-caps: normal; 
														 font-weight: 400; 
														 letter-spacing: normal; 
														 orphans: 2; text-align: start; 
														 text-indent: 0px; 
														 text-transform: none; 
														 widows: 2; word-spacing: 0px; 
														 -webkit-text-stroke-width: 0px; 
														 white-space: normal; 
														 background-color: 白; 
														 text-decoration-thickness: initial; 
														 text-decoration-style: initial; 
														 text-decoration-color: initial;" />
　　デバイス名を指定すると、パラメータ（画面サイズ）CUIメニューが表示されます。<br />
　　パラメータ（画面サイズ）CUIメニューから、C-WaveformGeneratorの起動サイズを、画面サイズで指定します。（最小化、通常、最大化）</p>
<p style="margin-left: 40px; font-variant-ligatures: normal; font-variant-caps: normal; 
	 font-size: 10pt; color: 黒; orphans: 2; widows: 2; -webkit-text-stroke-width: 0px;">　　画面サイズを指定すると、GenOpenApplicationが実行され、CUIメニューが再度表示されます。<br />
　　<img src="file_operation1.png" alt="" style=" border:none; width:100%; max-width:385px;" border="0" /></p>
<p style="margin-left: 40px; font-variant-ligatures: normal; font-variant-caps: normal; 
	 font-size: 10pt; color: 黒; orphans: 2; widows: 2; -webkit-text-stroke-width: 0px;">　・GenOpenApplicationコマンドが正常終了すると、C-WaveformGeneratorが起動します。<br />
　　C-WaveformGeneratorが起動しない場合は、正常にC-WaveformGeneratorがインストールされていない可能性があります。<br />
　　<a href="../../../../software_uninstallation/application_uninstall.htm">アプリケーションのアンインストール</a>を行った後、再度<a 
	 href="../../../../software_installation/application_install.htm">インストール</a>を行ってください。</p>
<p style="margin-left: 40px;">　・CUIメニューから、[2 : GenSetDeviceName]をコマンド選択すると、デバイス名を変更することができます。</p>
<p style="margin-left: 40px;">３．設定ファイルの指定</p>
<p style="margin-left: 40px;">　・CUIメニューから、[4 : GenImportSettingFile]をコマンド選択すると、C-WaveformGenerator本体で保存した設定ファイルを指定できます。</p>
<p style="margin-left: 40px;">　　設定ファイル名を指定するとGenImportSettingFileが実行され、<span 
	 style="font-variant-ligatures: normal; font-variant-caps: normal; 
	 font-size: 10pt; color: 黒; orphans: 2; widows: 2; -webkit-text-stroke-width: 0px;">CUIメニューが再度表示されます。</span><br />
　　設定ファイルの内容が読み込まれ、C-WaveformGenerator本体に反映されます。<br />
　　<img src="file_operation2.png" alt="" style=" border:none; width:100%; max-width:514px;" border="0" /></p>
<p style="margin-left: 40px;">４．動作</p>
<p style="margin-left: 40px;">　・CUIメニューから、[9 : GenStartOperation]をコマンド選択すると、指定デバイスから波形出力が開始します。<br />
　　<img src="file_operation3.png" alt="" style=" border:none; width:100%; max-width:383px;" border="0" /></p>
<p style="margin-left: 40px;">　・CUIメニューから、[11 : GenStopOperation]をコマンド選択すると、指定デバイスからの波形出力が停止します。<br />
　　C-WaveformGeneratorの画面サイズを「通常」にすると、[GenStartOperation]/[GenStopOperation]の指示に呼応して、C-WaveformGenerator上の描画も更新されます。<br />
　　C-WaveformGeneratorの描画に関しては、C-WaveformGeneratorの<a href="../../../../screen_layout/screen_layout.htm">画面構成</a>を参照ください。<br />
　　<img src="file_operation5.png" alt="" style=" border:none; width:100%; max-width:374px;" border="0" /></p>
<p style="margin-left: 40px;">　・CUIメニューから、[10 : GenGetApplicationStatus]をコマンド選択すると、指定デバイスのステータスを確認できます。<br />
　　C-WaveformGeneratorの画面サイズが「最小化」になっていても、C-WaveformGeneratorの動作状態を確認することができます。<br />
　　<img src="file_operation4.png" alt="" style=" border:none; width:100%; max-width:378px;" border="0" /></p>
<p style="margin-left: 40px;">５．終了処理</p>
<p style="margin-left: 40px;">　・CUIメニューから、[12 : GenCloseApplication]をコマンド選択すると、C-WaveformGenerator本体がプログラム終了します。<br />
　　他のクライアントアプリケーションから、OpenApplication関数を実行することができます。<br />
　　<img src="file_operation6.png" alt="" style=" border:none; width:100%; max-width:372px;" border="0" /></p>
<p style="margin-left: 40px;">　・C-WaveformGeneratorから波形出力を行う場合は、再度、[1 : 
 GenOpenApplication]をコマンド選択してください。<br />
</p>
<p style="margin-left: 40px;">６．閉じる</p>
<p style="margin-left: 40px;">　・CUIメニューから、[q : 終了]をコマンド選択すると、クライアントアプリケーションが終了します。<br />
</p>
<p style="margin-left: 0px;">補足：</p>
<p style="margin-left: 0px;">　C-WaveformGenerator本体であらかじめ設定した設定ファイルを、[3 
 : GenImportSettingFile]コマンドで読み込むサンプルです。</p>
<p style="margin-left: 0px;">　この機能に加え、チャネル設定や、データファイル設定を微調整することもできます。<br />
　さらに、本サンプルプログラムで、設定を微調整した後、[3 : GenExportSettingFile]をコマンド選択すれば、所定の設定ファイル名に設定を保存することもできます。</p>
<p style="margin-left: 0px;">　チャネル設定の詳細については、C-WaveformGeneratorの<a href="../../../../screen_layout/basic_mode/operation_panel.htm">操作パネル</a>内の<a 
	 href="../../../../screen_layout/basic_mode/operation_chanel.htm">チャネル設定</a>を参照ください。</p>
<p style="margin-left: 0px;">　データファイル設定を行う場合は、[5 : GenSetWaveType]をコマンド選択した後、チャネル番号を指定し、[6 
 : 任意]をコマンド選択してください。<br />
　任意波形についての詳細は、C-WaveformGeneratorの<a href="../../../../screen_layout/waveform_panel.htm">波形選択パネル</a>内の「任意波形」の内容を参照ください。<br />
　<img src="file_operation7.png" alt="" style=" border:none; width:100%; max-width:379px;" border="0" /></p>
<p style="margin-left: 0px;">&#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>
