Show the sample that analog data (bit 0) 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.
①Register DIO000 with device setting.
②In the timing setting, button click is set.
③In the output task, set the output to the device according to the value of the textbox at the timing set in ②.
④Build and execute in Visual Studio.
Display dncTextBox and dncButton on a Windows Forms application
①Select [DIO000] in the device setting of DncDaq Property Screen.
In this example, "Demo Device" is selected.
Depending on the selected device, you can also set the digital filter.
②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 the output to the device according to the value of the Textbox at the timing set in ②.
・Set the device name set in ① in the device.
・Specify DigitalBit (1 bit input) in the Access type and specify [0] in the Input Num.
・Select dncTextBox1 added to the form at the Source, and select the Timing_00 set in ② for Timing.
④Build and execute in Visual Studio. check the following operations.
Build and execute and check the following operations.
・Put 0 to TextBox and click the button ⇒ bit 0 output is turned off.
・Put 1 to TextBox and click the button ⇒ bit 0 output is turned on.
In this setting, bit 0 output data was linked, but setting change is possible in the following form.
・To link with data for 1 port (1 byte) ⇒ Please select [Access type: DigitalPort] in the Output Task on the DncDaq property screen.
・To link the data of bit 0-3 ⇒ 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.
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.)]
|