Analog Output Sample (Button, Textbox Linkage)


Show the sample that analog data (CH0) output with the value entered in the textbox from our device at the button click timing.

This setting example assumes that the following components are placed in the form.

*Other than DncDaq is using default settings.

 ・DncDaq

 ・DncButton

 ・DncTextBox


■Setting Content

①Register AIO000 with device setting.

②In the timing setting, button click is set.

③In the output task, set the textbox value to the device at the timing set in ②.

④Build and execute in Visual Studio.

 

 

■Execution Screen Image

   Display dncTextBox and dncButton on a Windows Forms application

 

 

■Setting Example

①Select [AIO000] in the device setting of DncDaq Property Screen.

   In this example, "Demo Device" is selected.

   The default settings are used, but you can set the output range on the AO Setting tab.

 

 

②In the timing setting, set the timing when the button is clicked.

   ・In the Timing, select [dncButton1].

    * The DncButton name placed in the form is displayed in the list.

 

 

③In the output task, set to output the value of the Textbox to the device at the timing set in ②.

・Set the device name set in ① in the device.

・Specify Analog (voltage/current output) in the Access type and specify [0] in the Input Num.

・Select dncTextBox1 added to the form at the output, and select the Timing_00 set in ② for Timing.

 

   

④Build and execute in Visual Studio.

   Build and execute and check the following operation.

・Put -5 to TextBox and click the button  ⇒ No voltage is output with [Demo Device]. To check the output voltage, you need to purchase analog output hardware separately.

 

 

・Put 5 to TextBox and click the button   ⇒ No voltage is output with [Demo Device]. To check the output voltage, you need to purchase analog output hardware separately.

 

 

In this setting, CH0 output data was linked, but setting change is possible in the following form.

 

・To link with binary value rather than voltage/current value     ⇒ Please select [Access type: AnalogBinary] in the Output Task on the DncDaq property screen.

・To link the data of CH0 to CH3             ⇒ Please specify [Input Num: 0-3] in the Output Task on the DncDaq property screen.

・To link the data every 1 second            ⇒ Please select [Timing: Timer] in the Timing on the DncDaq property screen and set the 1 second cycle.

 

The above settings can be changed not only the screen display in the designer mode, but also the screen display in the application startup.

* For details, refer to the Show property screen.

 

 

If DncDaq Init processing (initialization processing) is failed

DncDaq is set to perform automatic initialization at application startup by default.

 

If initialization is failed, the property page is displayed again.

The factors that fail to initialize may be considered if you are trying to refer to a nonexistent device or not found the component registered in the task setting.

 

For details, refer to the [The property screen is displayed when the application startup. (Init fails.)]