Input operation with acknowledgment using WinCC input/output fields - Database & Sql Blog Articles

SMD aluminum electrolytic capacitor
Brand AVX TPSE226M035R0125 Low impedance tantalum capacitor AVX 22
Electronic scale crystal oscillator 3.2*2.5mm 3225 16M (16.000MHZ) 12PF 10PPM 20PPM 30PPM
Huaqiang Square crystal original spot stock

During real-world project implementation, certain key data inputs require the operator to confirm potential errors before proceeding. For example:


Figure 1

When a value of "99" is entered into an input/output field and the Enter key is pressed, the system does not immediately update the variable. Instead, a confirmation message box appears. If the user selects "Yes," the new value is applied. If "No" is selected, the original value remains unchanged in the variable. This article explains how to implement this behavior using WinCC's input/output fields.

1. Prerequisites

Create two variables of the same data type: DisplayValue and TempValue. DisplayValue is the actual variable that will be controlled, while TempValue acts as a temporary storage for the user input before it's confirmed.


Figure 2

2. Input/Output Field Property Settings

Create a new input/output field on the screen and open its properties dialog. Navigate to Properties → Output/Input → Output Value. Right-click the dynamic part to access the settings.


Figure 3

Open the dynamic dialog and select the variable you want to control—DisplayValue in this case—and configure the data type accordingly.


Figure 4

3. Input/Output Field Event Settings

3.1 Change Action Settings

Select the same input/output field and open the Properties dialog. Go to Event → Attributes → Output/Input → Input Values, then right-click the Change Actions section.


Figure 5

Open the direct connection dialog. Keep the source as default and connect the target directly to the temporary variable, TempValue.


Figure 6

3.2 Keyboard Release Action Settings

Again, select the same input/output field and open the Properties dialog. Go to Event → Keyboard → Release, and right-click the action part.


Figure 7

Open the C Action Editor and write code that checks if the user has finished entering data and pressed Enter.


Figure 8

The code looks like this:

Int TempValue = GetTagWord("TempValue");
Char szBuffer[20];
Sprintf(szBuffer, "Input number: %d", TempValue);
If (nChar == 13) // if Enter key is pressed
{
    Int xRet = MessageBox(NULL, szBuffer, "Confirmation window", MB_YESNO | MB_ICONQUESTION | MB_SYSTEMMODAL);
    If (xRet == IDYES) // if user confirms
    {
        SetTagWord("DisplayValue", TempValue); // update the main variable
    }
}

Once the system runs, pressing Enter in the input field triggers the confirmation window shown in Figure 1.

4. Additional Notes

This setup was tested on Windows XP Professional SP2 with WinCC V7.0 SP1 ASIA. For more details about the MessageBox function, refer to Microsoft’s official documentation.

Aluminum Solar Cable

Aluminum core Solar Cable is a photovoltaic circuit using aluminum as a conductive material. It is widely used in solar power generation systems to transport the electricity generated by solar panels.

Compared with traditional copper solar cable, aluminum solar cable has some obvious advantages, the most important of which is low cost.

1. Low price: Aluminum is a common metal, and its price is cheaper than that of copper. Therefore, the use of aluminum solar cable can reduce the cost of the system and make the entire photovoltaic power generation project more economical.

2. Lightweight: Aluminum has a lower density and is lighter than copper. The aluminum core optical cable can reduce the weight of the cable and facilitate installation and maintenance.

3. Strong corrosion resistance: Aluminum has good corrosion resistance and can maintain a long service life under harsh environmental conditions. This makes the aluminum solar cable more reliable for outdoor use.

4. Excellent conductivity: although the conductivity of copper is higher than that of aluminum, the aluminum solar cable can make up for the shortcomings of the low conductivity of aluminum to a certain extent by optimizing the design and process and ensure the efficiency and stability of power transmission.

It should be noted that there are also some limitations and precautions for aluminum solar cable. Due to the low conductivity of aluminum, the resistance of the aluminum solar cable will be relatively high, so it is necessary to choose the wire diameter and length reasonably when designing and installing to ensure the efficiency of power transmission. In addition, aluminum is prone to electrochemical reactions when it comes into contact with copper, so corresponding measures need to be taken when connecting aluminum solar cable and other components, such as using special connectors or coating protective layers.

In general, aluminum solar cable with its low cost, corrosion resistance, light and other advantages, has been widely used in solar power generation systems, and brings economic and reliability benefits to photovoltaic power generation projects.

Aluminum Solar Cable,Photovoltaic Solar Cable,TUV Aluminum solar cable,Aluminum Energy Cable

Suzhou Yonghao Cable Co.,Ltd. , https://www.yonghaocable.com