Click here to Skip to main content
15,126,465 members
Home / Discussions / C#
   

C#

 
AnswerRe: avoid blinking screen+window form application c# Pin
Gerry Schmitz11-Feb-16 6:04
mveGerry Schmitz11-Feb-16 6:04 
QuestionHow to implement class /component Versioning using abstract class in c# Pin
Tridip Bhattacharjee10-Feb-16 22:51
professionalTridip Bhattacharjee10-Feb-16 22:51 
AnswerRe: How to implement class /component Versioning using abstract class in c# Pin
Richard MacCutchan10-Feb-16 23:03
mveRichard MacCutchan10-Feb-16 23:03 
GeneralRe: How to implement class /component Versioning using abstract class in c# Pin
Tridip Bhattacharjee11-Feb-16 22:50
professionalTridip Bhattacharjee11-Feb-16 22:50 
GeneralRe: How to implement class /component Versioning using abstract class in c# Pin
Richard MacCutchan11-Feb-16 23:14
mveRichard MacCutchan11-Feb-16 23:14 
QuestionHow to red variable continuously Pin
Zefir110-Feb-16 21:34
MemberZefir110-Feb-16 21:34 
AnswerRe: How to red variable continuously Pin
OriginalGriff10-Feb-16 21:50
mveOriginalGriff10-Feb-16 21:50 
GeneralRe: How to red variable continuously Pin
Zefir110-Feb-16 22:20
MemberZefir110-Feb-16 22: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 22:38
mveOriginalGriff10-Feb-16 22:38 
QuestionFTP vs SCP Pin
Kevin Marois10-Feb-16 8:42
professionalKevin Marois10-Feb-16 8:42 
AnswerRe: FTP vs SCP Pin
Richard Deeming10-Feb-16 11:11
mveRichard Deeming10-Feb-16 11:11 
GeneralRe: FTP vs SCP Pin
Kevin Marois10-Feb-16 11:29
professionalKevin Marois10-Feb-16 11:29 
GeneralRe: FTP vs SCP Pin
Eddy Vluggen10-Feb-16 11:41
professionalEddy Vluggen10-Feb-16 11:41 
QuestionBeginner on TCP Server/Client Implementation Pin
Member 1018338210-Feb-16 7:18
MemberMember 1018338210-Feb-16 7:18 
QuestionProgrammatically login to website that uses 2 steps. Pin
Vouksh10-Feb-16 3:18
MemberVouksh10-Feb-16 3:18 
AnswerRe: Programmatically login to website that uses 2 steps. Pin
OriginalGriff10-Feb-16 5:14
mveOriginalGriff10-Feb-16 5:14 
GeneralRe: Programmatically login to website that uses 2 steps. Pin
Vouksh10-Feb-16 5:30
MemberVouksh10-Feb-16 5:30 
GeneralRe: Programmatically login to website that uses 2 steps. Pin
Luc Pattyn11-Feb-16 1:29
sitebuilderLuc Pattyn11-Feb-16 1:29 
GeneralRe: Programmatically login to website that uses 2 steps. Pin
OriginalGriff11-Feb-16 1:35
mveOriginalGriff11-Feb-16 1:35 
SuggestionRe: Programmatically login to website that uses 2 steps. Pin
Richard Deeming10-Feb-16 5:16
mveRichard Deeming10-Feb-16 5:16 
AnswerRe: Programmatically login to website that uses 2 steps. Pin
V.10-Feb-16 21:21
professionalV.10-Feb-16 21:21 
QuestionIssue with Serial Port class Pin
Member 1206160010-Feb-16 0:13
MemberMember 1206160010-Feb-16 0:13 
SuggestionRe: Issue with Serial Port class Pin
Richard MacCutchan10-Feb-16 1:14
mveRichard MacCutchan10-Feb-16 1:14 
GeneralRe: Issue with Serial Port class Pin
Member 1206160010-Feb-16 1:23
MemberMember 1206160010-Feb-16 1:23 
GeneralRe: Issue with Serial Port class Pin
Richard MacCutchan10-Feb-16 1:30
mveRichard MacCutchan10-Feb-16 1: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.