Click here to Skip to main content
15,886,046 members
Home / Discussions / C#
   

C#

 
AnswerRe: avoid blinking screen+window form application c# Pin
Gerry Schmitz11-Feb-16 5:04
mveGerry Schmitz11-Feb-16 5:04 
QuestionHow to implement class /component Versioning using abstract class in c# Pin
Tridip Bhattacharjee10-Feb-16 21:51
professionalTridip Bhattacharjee10-Feb-16 21:51 
AnswerRe: How to implement class /component Versioning using abstract class in c# Pin
Richard MacCutchan10-Feb-16 22:03
mveRichard MacCutchan10-Feb-16 22:03 
GeneralRe: How to implement class /component Versioning using abstract class in c# Pin
Tridip Bhattacharjee11-Feb-16 21:50
professionalTridip Bhattacharjee11-Feb-16 21:50 
GeneralRe: How to implement class /component Versioning using abstract class in c# Pin
Richard MacCutchan11-Feb-16 22:14
mveRichard MacCutchan11-Feb-16 22:14 
QuestionHow to red variable continuously Pin
Zefir110-Feb-16 20:34
Zefir110-Feb-16 20:34 
AnswerRe: How to red variable continuously Pin
OriginalGriff10-Feb-16 20:50
mveOriginalGriff10-Feb-16 20:50 
GeneralRe: How to red variable continuously Pin
Zefir110-Feb-16 21:20
Zefir110-Feb-16 21:20 
Hi.
I'm sorry from my negligence.
I create Windows Forms application. In this application I would like to read data form PLC (Real Variable).
Now when I run this program I read value but only one time.
In my PLC I see that my variable has change but in C# application not.
In conclusion I would like to read my variable continuously or if it change.

My Code:

C#
private void Form1_Load(object sender, EventArgs e)
       {
           SIS7.Net.Channel myChannel = new SIS7.Net.Channel();
           SIS7.Device myDevice = new SIS7.Device("10.228.216.156,0,1", SIS7.Model.S7_1200);

           SIS7.Group myGroup = new SIS7.Group(false, 500);

           SIS7.Item myItem = new SIS7.Item("DB4.DBD68", 1, SIS7.DataType.Int32);
           SIS7.Item myItem1 = new SIS7.Item("DB4.DBD100", 1, SIS7.DataType.Single);
           myChannel.Devices.Add(myDevice);
           // Add group to device
           myDevice.Groups.Add(myGroup);
           // Add item to group
           myGroup.Items.Add(myItem);
           myGroup.Items.Add(myItem1);
           System.Single myFloat32;
           try
           {
               // Perform a read, save value to text box
               myItem.Read();
               myItem1.Read();
               textBoxItemRead.Text = myItem.Values[0].ToString();
               textBox1.Text = myItem1.Values[0].ToString();
           }
           catch (Exception ex)
           {
               // Error occurred, implement error handler
           }
           // Dispose channel at application shutdown
           myChannel.Dispose();
       }



Regards
Pawel
GeneralRe: How to red variable continuously Pin
OriginalGriff10-Feb-16 21:38
mveOriginalGriff10-Feb-16 21:38 
QuestionFTP vs SCP Pin
Kevin Marois10-Feb-16 7:42
professionalKevin Marois10-Feb-16 7:42 
AnswerRe: FTP vs SCP Pin
Richard Deeming10-Feb-16 10:11
mveRichard Deeming10-Feb-16 10:11 
GeneralRe: FTP vs SCP Pin
Kevin Marois10-Feb-16 10:29
professionalKevin Marois10-Feb-16 10:29 
GeneralRe: FTP vs SCP Pin
Eddy Vluggen10-Feb-16 10:41
professionalEddy Vluggen10-Feb-16 10:41 
QuestionBeginner on TCP Server/Client Implementation Pin
Member 1018338210-Feb-16 6:18
Member 1018338210-Feb-16 6:18 
QuestionProgrammatically login to website that uses 2 steps. Pin
Dralken10-Feb-16 2:18
Dralken10-Feb-16 2:18 
AnswerRe: Programmatically login to website that uses 2 steps. Pin
OriginalGriff10-Feb-16 4:14
mveOriginalGriff10-Feb-16 4:14 
GeneralRe: Programmatically login to website that uses 2 steps. Pin
Dralken10-Feb-16 4:30
Dralken10-Feb-16 4:30 
GeneralRe: Programmatically login to website that uses 2 steps. Pin
Luc Pattyn11-Feb-16 0:29
sitebuilderLuc Pattyn11-Feb-16 0:29 
GeneralRe: Programmatically login to website that uses 2 steps. Pin
OriginalGriff11-Feb-16 0:35
mveOriginalGriff11-Feb-16 0:35 
SuggestionRe: Programmatically login to website that uses 2 steps. Pin
Richard Deeming10-Feb-16 4:16
mveRichard Deeming10-Feb-16 4:16 
AnswerRe: Programmatically login to website that uses 2 steps. Pin
V.10-Feb-16 20:21
professionalV.10-Feb-16 20:21 
QuestionIssue with Serial Port class Pin
Member 120616009-Feb-16 23:13
Member 120616009-Feb-16 23:13 
SuggestionRe: Issue with Serial Port class Pin
Richard MacCutchan10-Feb-16 0:14
mveRichard MacCutchan10-Feb-16 0:14 
GeneralRe: Issue with Serial Port class Pin
Member 1206160010-Feb-16 0:23
Member 1206160010-Feb-16 0:23 
GeneralRe: Issue with Serial Port class Pin
Richard MacCutchan10-Feb-16 0:30
mveRichard MacCutchan10-Feb-16 0:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.