Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Foreign Languages > French Forum
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

librairie in/out pour wago 740-841

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-23-2011, 07:16 PM
Knows the basics
 
Join Date: May 2011
Posts: 66
Default librairie in/out pour wago 740-841

je viens de faire une librairie "WAGO_B4A" pour B4A pour communiquer avec le wago 740-841 je gere les entrées et sortie digitale pour le moment en lectue/ecriture

si cela intéresse quelqu'un faite moi signe

voici une démonstration vidéo

Wago 750-841 sous android - YouTube
Wago 750-841 sous androide - YouTube

voici le code de la deuxième vidéo

'Activity module
Sub Process_Globals
Dim adr_ip As Double
Dim my_wago As MODBUS_TCP_MASTER_B4A
Dim timer1 As Timer

End Sub

Sub Globals
Dim Input_1 As CheckBox
Dim Input_2 As CheckBox
Dim label1 As Label
Dim etat_1,etat_2,etat_3,etat_4,etat_5,etat_6,etat_7,e tat_8,etat_9,etat_10 As Label
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim x As String
If FirstTime Then
Timer1.Initialize("timer1", 500)
timer1.Enabled = True
Activity.LoadLayout("1")
my_wago.Ip("192.168.2.50")
my_wago.Connection
End If
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
Sub timer1_Tick
Dim x As String
Dim i As Boolean
Dim b As String
Try
Input_1.IsInitialized
Input_2.IsInitialized
x=my_wago.ReadInput(512,16) '16 bits de sortie lus
label1.Text=x

'lampes temoins
If x.CharAt(7)=1 Then
etat_1.Color=Colors.Green
Else
etat_1.Color=Colors.LightGray
End If
If x.CharAt(6)=1 Then
etat_2.Color=Colors.Green
Else
etat_2.Color=Colors.LightGray
End If
If x.CharAt(5)=1 Then
etat_3.Color=Colors.Green
Else
etat_3.Color=Colors.LightGray
End If
If x.CharAt(4)=1 Then
etat_4.Color=Colors.Green
Else
etat_4.Color=Colors.LightGray
End If
If x.CharAt(3)=1 Then
etat_5.Color=Colors.Green
Else
etat_5.Color=Colors.LightGray
End If
If x.CharAt(2)=1 Then
etat_6.Color=Colors.Green
Else
etat_6.Color=Colors.LightGray
End If
If x.CharAt(1)=1 Then
etat_7.Color=Colors.Green
Else
etat_7.Color=Colors.LightGray
End If
If x.CharAt(0)=1 Then
etat_8.Color=Colors.Green
Else
etat_8.Color=Colors.LightGray
End If
If x.CharAt(16)=1 Then
etat_9.Color=Colors.Green
Else
etat_9.Color=Colors.LightGray
End If
If x.CharAt(15)=1 Then
etat_10.Color=Colors.Green
Else
etat_10.Color=Colors.LightGray
End If
Catch
End Try
End Sub

'bouttons on
Sub Button_on1_Up
my_wago.WriteOutput(0,True)
End Sub
Sub Button_on2_Up
my_wago.WriteOutput(1,True)
End Sub
Sub Button_on3_Up
my_wago.WriteOutput(2,True)
End Sub
Sub Button_on4_Up
my_wago.WriteOutput(3,True)
End Sub
Sub Button_on5_Up
my_wago.WriteOutput(4,True)
End Sub
Sub Button_on6_Up
my_wago.WriteOutput(5,True)
End Sub
Sub Button_on7_Up
my_wago.WriteOutput(6,True)
End Sub
Sub Button_on8_Up
my_wago.WriteOutput(7,True)
End Sub
Sub Button_on9_Up
my_wago.WriteOutput(8,True)
End Sub
Sub Button_on10_Up
my_wago.WriteOutput(9,True)
End Sub

'bouttons off
Sub Button_off1_Up
my_wago.WriteOutput(0,False)
End Sub
Sub Button_off2_Up
my_wago.WriteOutput(1,False)
End Sub
Sub Button_off3_Up
my_wago.WriteOutput(2,False)
End Sub
Sub Button_off4_Up
my_wago.WriteOutput(3,False)
End Sub
Sub Button_off5_Up
my_wago.WriteOutput(4,False)
End Sub
Sub Button_off6_Up
my_wago.WriteOutput(5,False)
End Sub
Sub Button_off7_Up
my_wago.WriteOutput(6,False)
End Sub
Sub Button_off8_Up
my_wago.WriteOutput(7,False)
End Sub
Sub Button_off9_Up
my_wago.WriteOutput(8,False)
End Sub
Sub Button_off10_Up
my_wago.WriteOutput(9,False)
End Sub

Last edited by alan1968 : 10-05-2011 at 03:00 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Librairie Animation brossden69 French Forum 2 07-03-2011 03:34 PM
Banniere pour le site GallyHC French Forum 5 02-03-2009 12:43 PM


All times are GMT. The time now is 05:44 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0