Digital Input Sample (Lamp Linkage)


Show the sample that gets digital input data (bit 0) every one second from our device and displays it on the lamp.

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

*Other than DncDaq is using default settings.

 ・DncDaq

 ・DncLamp


■Setting Content

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

②Set 1 second cycle with timing setting.

③In the input task, link the data of the device to Lamp at the timing set in ②.

④Build and execute in Visual Studio.

 

 

■Execution Screen Image

   Display dncLamp on a Windows Forms application

 

 

■Setting Example

①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 1 second cycle.

   ・In the Timing, select Timer and specify 1000 msec with Interval(ms).

 

 

③In the input task, link the device data to Lamp 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 dncLamp1 added to the form at the Target, and select the Timing_00 set in ② for Timing.

   

 

④Build and execute in Visual Studio.

  Build and execute and make sure that the value of bit 0 is input every 1 second.

 

 

In this setting, bit 0 input 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 Input Task on the DncDaq property screen.

                                                          Also, select [NumberOfLamp: 8] on the DncLamp property screen.

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

                                                          Also, select [NumberOfLamp: 4] on the DncLamp property screen.

・To link the data when button is clicked          ⇒ Place DncButton in advance and select [Timing: DncButton] in the Timing on the DncDaq property screen.

 

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.)]