HCBBS Forum (Português)
Submit Chemical Projects / Find Solutions
Amplify Your Requirements on a Broader Chemical Platform *Engineering · Technology · Equipment · Solutions*
Submit Request

Exemplo de script Wincc O controle 3-MSHFGrid classifica registros por campos

2016-04-16View Original

Thread Content

Às vezes também precisamos permitir que os operadores classifiquem por campos após clicar no controle MSHFGrid. Este artigo apresenta como implementar esta função. Primeira preparação: Crie uma nova variável interna do tipo número de ponto flutuante de 32 bits Classificar no Wincc para marcar se deseja classificar em ordem crescente ou decrescente. Insira um texto estático na página Wincc, altere o nome para txt, defina Properties-Effect-Global Color como "No", Properties-Color-Background Color "Transparency" como 100 e Border Thickness como 0. Segundo script de classificação Escreva o seguinte script em MSHFGrid Control Event-Object Event-mouseup: Dim MSHFGrid,txt,sort Set MSHFGrid=ScreenItems("MSHFGrid") Set sort=HMIRuntime.Tags("Sort") Set txt=ScreenItems("txt") If MSHFGrid.TextMatrix(0,item.MouseCol)"DateTime" Then If sort.Read =2 Then MSHFGrid.Sort=1 'Organizar em ordem crescente por valor numérico sort.Write 1 txt.Text ="Atualmente organizado em ordem crescente de acordo com " & MSHFGrid.TextMatrix(0,item.MouseCol) & "Field" Else MSHFGrid.Sort=2 'Organizado em ordem decrescente por valor numérico sort.Write 2 txt.Text ="Atualmente organizado em ordem decrescente de acordo com " & MSHFGrid.TextMatrix(0,item.MouseCol) & "Campo" End If Else If sort.Read =2 Then MSHFGrid.Sort=5 'Organizar em ordem crescente de caracteres sort.Write 1 txt.Text ="Atualmente de acordo com" & MSHFGrid.TextMatrix(0,item.MouseCol) & "Organizar campos em ordem crescente" Else MSHFGrid.Sort=6 'Organizar em ordem decrescente de caracteres sort.Write 2 txt.Text ="Atualmente de acordo com" & MSHFGrid.TextMatrix(0,item.MouseCol) & "Organizar campos em ordem decrescente" End If End If End Sub Depois de salvar e executar, você pode ver o efeito. Este script é baseado no projeto do blog anterior. Como conectar o MSHFGrid à tabela de dados, consulte outras postagens recomendadas pelos scripts wincc.
Reply #22016-04-17
Você pode fazer upload de um arquivo de pacote?

Submit a Project

**Looking for Chemical Technology, Equipment & Solutions?** No Registration Required Broader Platform Exposure | Global Chemical Service Provider Connections

Submit Request — Free Consultation

Disclaimer

This is an automated machine translation of the original thread. Some technical terms may have inaccuracies; the original text shall prevail. Click "View Original" at the top right to access the source page, which supports IP-based automatic real-time language translation. Please watch out for contact details and sales inducements to prevent fraud. All content and translations are for reference only, representing solely the poster's personal views. For enquiries, email service@hcbbs.com.