C:\MasterPageWeb\HAPR\docu\HAPR_VB6_version15sept06.rtf 19/10/08. HARP_VB projet en VB6

Similar documents
Programming with visual Basic:

Lecture 4 DLLs and Custom Hardware Programming

ISA PCI Peripherals Connect Interface ISA. Enhanced Parallel Port EPP

Visual Basic. The Integrated Development Environment. Menu Bar

Please answer questions in the space provided. Question point values are shown in parentheses.

VBA. VBA at a glance. Lecture 61

Design & Application of Computer Controlled Switch

TD 2. Correction TP info

IS 320 Spring 96 Page 1 Exam 1. Please use your own paper to answer the following questions. Point values are shown in parentheses.

Function: function procedures and sub procedures share the same characteristics, with

variables programming statements

HELP - VB TIPS. ANIMATE AN IMAGE BOX Insert a module. In this module, create a global variable: Global x

Relational Operators. > greater than < less than >= greater than or equal to <= less than or equal to <> not equal to = equal to

Data Acquisition over Ethernet using Serial Device Server - NPort 5210 PRL-TN

Universitas Sumatera Utara

An InputBox( ) function will display an input Box window where the user can enter a value or a text. The format is

Tutorial :.Net Micro Framework et.net Gadgeteer

Angel International School - Manipay 1 st Term Examination November, 2015

Mardi 3 avril Epreuve écrite sur un document en anglais

Lookup Project. frmlookup (Name: object is a combo box, style 2); use 4 labels: 2 for phone, 2 for mail. MsgBox Function:

Java et Mascopt. Jean-François Lalande, Michel Syska, Yann Verhoeven. Projet Mascotte, I3S-INRIA Sophia-Antipolis, France

# Project Tracker Status Priority Subject Updated Category Target version 559 Auto Multiple 05/09/2018 1/10

VISUAL BASIC SERVER INTERFACE CODE. Visual Basic 6 Graphical Interface 103. Visual Basic Module rtsscomm.bas Code.115

MARQUE: STEELSERIES REFERENCE: ARCTIS 5 NOIR CODIC:

EMPLOYEE PAYROLL SYSTEM

Universitas Sumatera Utara

Modbus Server. ARSoft International

Visual Basic 6 Lecture 7. The List Box:

Crystal Reports. Overview. Contents. Using Crystal Reports Print Engine calls (API) in Microsoft Visual Basic

CS130/230 Lecture 12 Advanced Forms and Visual Basic for Applications

PROGRAM 1: SIMPLE CALCULATOR

EXCEL WORKSHOP III INTRODUCTION TO MACROS AND VBA PROGRAMMING

CSE 123 Introduction to Computing

Information Hiding In Images Using Randomly Selected Points

NATIONAL DIPLOMA IN COMPUTER TECHNOLOGY

LAMPIRAN A : LISTING PROGRAM

Angel International School - Manipay 1 st Term Examination November, 2015

VHDL par Ahcène Bounceur VHDL

PRO7_TEL ver1_0 FINAL.BS2

Financial Functions (all with subtypes: Normal, Stairs, Points, Height, Hollow, Colors, Marks, No Border except where indicated):

PROGRAM BASCOM AVR. ' inisialisasi '

Mechatronics Laboratory Assignment 2 Serial Communication DSP Time-Keeping, Visual Basic, LCD Screens, and Wireless Networks

'... '... '... Module created: unknown '... Proj finished: March 21, 2012 '... '...

Beispiel Joystick. Code frm_joytest

Analyse statique de programmes avioniques

PROJECT ELECTRONIC CONTROL GAS INJECTION SYSTEM

VBA Handout. References, tutorials, books. Code basics. Conditional statements. Dim myvar As <Type >

Level 3 Computing Year 2 Lecturer: Phil Smith

LAMPIRAN. Universitas Sumatera Utara

CS 112 Introduction to Computing II. Wayne Snyder Computer Science Department Boston University

OPTIS Labs Tutorials 2013

Bulk Transfers Using Visual Basic 6.0

22. VB Programming Fundamentals Data Access with Data Objects

EGR1301_Linear_Equation_Solver_ docx. 1. Select Options 2. Select Add Ins. 3. Select Solver Add in and press OK.

20. VB Programming Fundamentals Variables and Procedures

On Railway Reservation. U G D C A Semester VI. Roll No DA

PC-BASED COST EFFECTIVE DATA ACQUISITION AND CONTROL

Before We Begin. Introduction to Computer Use II. Overview (1): Winter 2006 (Section M) CSE 1530 Winter Bill Kapralos.

Programming Concepts and Skills. Arrays continued and Functions

1 Using your Legacy WN-1 WaveNode Wattmeter on Windows 7, 8 and 10.

Understanding the MsgBox command in Visual Basic

Projet 0 - Correc,on. Structures de données et algorithmes

Procedures. This is a common situation -- there is some functionality that computers should have that the do not the solution is to write a procedure

Compilation TP 0.0 : The target architecture: Digmips

Upgrading Applications

The following are required to duplicate the process outlined in this document.

Before We Begin. Introduction to Computer Use II. Overview (1): Winter 2005 (Section M) CSE 1530 Winter Bill Kapralos.

Contents Introduction Getting Started Visual Basic Form Configuration Entering the VB Code

VB FUNCTIONS AND OPERATORS

Descriptif de communication Page 2 29 CALEC ST II KNX TP1

Using a 74HCT259 8 Bit Addressable Latch with BasicX

SERIE N 1. 4 ème Année informatiques. Exercice 3. Exercice 4 (Manuel Scolaire) Page [1] Les enregistrements & Les fichiers Infoslpm.e-monsite.

Private Sub Cours_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

SUMARI 1 I. CLASSES DEL SUBPROGRAMA DE CÀLCUL 3. A. Classe CEstructura...3 B. Classe CElement...74 II. MÒDULS DEL SUBPROGRAMA DE CÀLCUL 127

Sales flow. Creation of a lead until the payment and the reminder through the consultation of the stock

NOTES: Procedures (module 15)

UNIT 1 INTRODUCTION TO VISUAL BASICS 6.0

Start Visual Basic. Session 1. The User Interface Form (I/II) The Visual Basic Programming Environment. The Tool Box (I/II)

VISUAL BASIC 6.0 OVERVIEW

DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6)

Tutorial 1 : minimal example - simple variables replacements

Chapter 1. Block Diagram. Text .. 1

Chapter 6: VB.net Program Running In Wincon Access To ISaGRAF Variables

The Control Properties

2. (16) Salesperson bonuses are paid based on a combination of total unit sales and the number of new accounts according to the following table:

File Organization and Management

Instructions for TSCLIB.DLL functions

SunVTS Quick Reference Card

DroidBasic Syntax Contents

Description de tous les champs du fichier de statut de retour pour l échange FATCA - version 0.4

How to use JS Automation I/O driver

Visual Programming 1. What is Visual Basic? 2. What are different Editions available in VB? 3. List the various features of VB

TLP Pro 525M, 725M, and 1025M Series Setup Guide

CONTROL OF MED INPUT/OUTPUT MODULES FROM OTHER LANGUAGES

Language Fundamentals

with Ada.Numerics.Float_Random; with Ada.Containers.Vectors; procedure CalculDeMatrices is

Catalyst Development Corporation An Introduction to TCP/IP Programming With SocketWrench

C-DIAS Analog Module CAO 086 For eight ±10 V Outputs

LPTCOM. Bruce Misner Lakehead University h d3 RD2 pin 21. RD3 pin h d4. RD4 pin 27 RD5 pin h d5. RD6 pin 29 RD7 pin H d6

Premiers retours d expérience sur l utilisation de GPU pour des applications de mécanique des structures

Transcription:

HARP_VB projet en VB6 Option Explicit Dim Value As Integer Dim i As Integer Dim il As Long Dim LL, L1S, L250µS, L500µS, L1mS, L2mS, L5mS, L10mS As Single Dim offsetdepart As Long Dim police(256, 8) As Byte Dim table(256, 8) As Byte Dim Valid As Integer Dim PortAddress As Integer Dim Msg, Style, Title, Help, Ctxt, Response, MyString Dim Marche_Arret As Boolean Dim Texte$ Page 1 sur 6

Private Declare Sub Sleep Lib "kernel32" (ByVal dwmilliseconds As Long) ' -> VB WorkShop 'mai 2004 V.0 'sept 2006 correction bug majeur! Value non prise en compte dans champ text1-change! oublié! Private Sub Check1_Click() If (Check1.Value = 1) Then Lect0.Enabled = True Text2.Enabled = True Lect0.Enabled = False Text2.Enabled = False Private Sub Combo1_Change() offsetdepart = CLng(Text6.Text) Private Sub Command1_Click() Msg = "Application en VB6, OK sous XP" & Chr(13) & Chr(10) & "Rev1.0 PF 15 sept 2006" ' Définit le message. Style = vbinformation ' Définit les boutons. Title = "Test HAPR sur LPTx (use of Inpout32 DLL)" ' Définit le titre. Help = "" ' Définit le fichier d'aide. Ctxt = 0 ' Définit le contexte de ' la rubrique. ' Affiche le message. Response = MsgBox(Msg, Style, Title, Help, Ctxt) Unload HAPR Sub Affichage_HAPR() Dim i, j, k, l, Value As Integer Dim col, row, p, nl As Long Dim a$ Out PortAddress, 0 'attente synchro l = 0 If Option3(0).Value = True Then a$ = Text8.Text a$ = Time$ k = Inp(PortAddress + 1) Loop While k = 191 ' position de depart For LL = 0 To offsetdepart: Next LL 'For LL = 0 To L1mS: Next LL For i = 1 To Len(a$) col = Asc(Mid$(a$, i, 1)) Page 2 sur 6

For row = 1 To 8 Value = police(col, row) Out PortAddress, Value Events For LL = 0 To L250µS: Next LL Next row For LL = 0 To L1mS: Next LL Out PortAddress, 0 Next i k = Inp(PortAddress + 1) Events 'l = l + 1 Loop While k = 63 Events Loop While MarcheArret = True ' And l < 5000000 Out PortAddress, 0 Private Sub EcriturePort_Click() EcriturePort.Caption = "Ecriture sur port" & CStr(PortAddress) Out PortAddress, Value Private Sub Form_Load() Dim t, t1, t2 As uble Dim i, j, k, l As Integer Dim car As Byte Dim b$ Dim a$ 'Test program for inpout32.dll i = MsgBox("Inpout32.DLL doit etre accessible " & Chr(13) & Chr(13) & "Choisir un port!" & Chr(13) & "double click dans le cadre LPT", vbcritical, "Test PORT LPT sous XP (en VB6)") Value = 0 PortAddress = 255 Valid = False EcriturePort.Enabled = False Lect0.Enabled = False Text2.Enabled = False Lect1.Enabled = False Text3.Enabled = False Lect2.Enabled = False Text4.Enabled = False Check1.Enabled = False ' Option1.Enabled = True ' Option2.Enabled = True Option1.Enabled = False Option2.Enabled = False MarcheArret.Enabled = False ' mauvais calcul automatique du nb de boucles en 1 sec 't1 = Timer 'Sleep (1000) 't2 = Timer 't = t2 - t1 't1 = Timer 'For LL = 0 To 1000000: Next LL 't2 = Timer 't = t2 - t1 Page 3 sur 6

'L1S = 1000000 / t ' => valeur forcée experimentalement L1S = 35000000 Text5.Text = L1S L250µS = L1S / 4000 L500µS = L1S / 2000 L1mS = L1S / 1000 L2mS = L1S / 500 L5mS = L1S / 200 L10mS = L1S / 100 offsetdepart = L1mS Text6.Text = offsetdepart Text7.Text = "C:\MasterPageWeb\HAPR\datas\matrice8x8_127car.txt" Lecture_Fichier Texte$ = "PaulFjujo" Text8.Text = Texte$ Private Sub Frame1_DblClick() Option1.Enabled = True Option2.Enabled = True Private Sub Lect0_Click() If (Valid = True) Then Out PortAddress + 1, 32 ' bascule bit 5 at @ Port+1 Text2.Text = Inp(PortAddress) Private Sub Lect1_Click() Text3.Text = Inp(PortAddress + 1) Private Sub Lect2_Click() Text4.Text = Inp(PortAddress + 2) Private Sub MarcheArret_Click() If Marche_Arret = False Then Marche_Arret = True Text8.ForeColor = &HFF& 'rouge Affichage_HAPR Marche_Arret = False Text8.ForeColor = &H404040 ' noir Events Private Sub Option1_Click() PortAddress = 888 ' &h378 validation_port Private Sub Option2_Click() PortAddress = 632 '&H278 validation_port Page 4 sur 6

Private Sub validation_port() EcriturePort.Caption = "Ecriture sur port " & CStr(PortAddress) & " (" & CStr(Hex(PortAddress)) & "H)" EcriturePort.Enabled = True Label1.Enabled = True Text1.Enabled = True Lect1.Enabled = True Text3.Enabled = True Lect2.Enabled = True MarcheArret.Enabled = True Text4.Enabled = True Valid = True Check1.Enabled = True Sub Lecture_Fichier() Dim i, j, k, l As Integer Dim a$, b$ On Error Resume Next Open Text7.Text For Input As #3 'Open "C:\MasterPageWeb\HAPR\datas\" & Text7.Text For Input As #3 If Err = 53 Then Beep i = MsgBox("PB de Lecture " & Text7.Text & Chr(13) & "Fichier absent ou non accessible " & Chr(13) & "=> sortie de prg", vbcritical, "Fichier Police de caracteres") For LL = 0 To L1S: Next LL Command1_Click j = 1 Line Input #3, a$ ' Debug.Print j, a$ For i = 1 To 8 l = InStr(a$, ",") If l > 0 Then b$ = Left$(a$, l - 1) police(j, i) = Val(b$) ' Debug.Print police(j, i), a$ = Right$(a$, Len(a$) - l) police(j, i) = Val(a$) Next i j = j + 1 Loop While j < 127 And Not EOF(3) Close #3 i = MsgBox("Lecture " & Text7.Text & " : OK", vbinformation, "Fichier Police de caracteres") On Error GoTo 0 Private Sub Option3_Click(Index As Integer) If Index = 0 Then Text8.Text = Texte$ If Index = 1 Then Text8.Text = Time$ Private Sub Text1_Change() Value = CInt(Text1.Text) Page 5 sur 6

Private Sub Text7_Change() If Right$(Text7.Text, 1) = Chr(13) Then Lecture_Fichier Private Sub Text8_Change() If Option3(0).Value = True Then Texte$ = Text8.Text Page 6 sur 6