VBNET Control of ARDUINO Over TCP RS232

by manu4371 in Circuits > Robots

19424 Views, 36 Favorites, 0 Comments

VBNET Control of ARDUINO Over TCP RS232

installation.jpg

PROJET PUPITRE SERIAL OVER TCP
VB NET / XPORT (LAN) ou CSW M85 (WIFI LAN) ouCIE M10 (LAN) / ARDUINO

Introduction:

With this project you will be able to pilot outputs of an arduino with a virtual vb.net pusbutton or a switch for digital or analog (PWM filtered) control of whatever.

A more perfect HMI will be supplied later to pilot for example a 6 axes robot like the Esched VIII. With this instructable we will focus on the communication beetween the arduino and a PC or a tab via wifi or ethernet cable.

The arduino uno could send values or messages displayed on a VBNET HMI (using VB EXPRESS 2010). The communication is made with a simple special RS232 ASCII frame I created and wich is encapsulated in a TCP frame. The HMI is the client and the ethernet interface WLAN/LAN<->rs232 (link to arduino with RX TX) is the server.

For this application I used the following frame: o,o,003929

The first both characters are the state of the pushbutton of your HMI (f: pushed, o: no action) and the decimal value is send by a trimmer on the HMI.

-----------------------------------------------------------------------------------------------------------------------------------------------

Le but de ce projet est de piloter des sorties de l'arduino uno en tout ou rien par bouton poussoir ou en PWM par un bouton tournant.

L'interface sera améliorée pour piloter un robot Eshed 6 axes. Il s'agit pour l'instant d'un prototype visant à tester la communication.

L'arduino pourra envoyer des valeurs ou des messages affichés par le pupitre VB.net (Visual Basic Express 2010).

La communication se fera par envoi et réception de trame de caractères ASCII en RS232 over TCP IP.

Pour l'instant , la trame envoyée comme reçue a la structure suivante: o,o,003929

Les caractères o ou f reflètent l'état des boutons poussoirs de la HMI, la valeur décimal sur 6 digits est une valeur envoyée par le bouton tournant.

Présentation De L'interface VB.NET/ the VB.NET HMI

presse-papiers-1.jpg
presse-papiers-2.jpg
presse-papiers-3.jpg
presse-papiers-4.jpg

The VBNET HMI:

You can download here the prototype with communicates with the IP adress: 1921.168.1.244

The catchy buttons are available on a project called AdvancedHMI (thanx to Archie, one of the developpers) and DotNet shareware.

I used 2 timers : one to send the frame and receive the frame from the arduino (via the interface), another to refresh a trend curve whatever you want.

-------------------------------------------------------------------------------------------------------------------------------------------------------

Interface VBNET:
Voici l'aspect de l'interface prototype d'essai qui communique avec l'adresse 192.168.1.244

Les boutons tournants et poussoirs proviennent du projet AdvancedHMI et du logiciel DotNet pour VB express.
J'ai utilisé 2 timers: un timer pour organiser l'émission et la réception , un timer pour réactualiser une courbe de tendance.

Ci-joint le projet VB net:

Le Programme Arduino UNO/The Arduino Code

images.jpg

It will communicate via the WLAN/LAN <-> rs232 linked to the arduino with RX (D0) and TX (D1).

-----------------------------------------------------------------------------------------------------------------------------------------------------

Il communiquera via un des modules au choix cités plus haut dans le titre qui seront reliés aux bornes de l'arduino RX (D0) et TX (D1).

Ci-joint le programme:

Les Paramètre Du Xport De Lantronix: LAN/RS232

presse-papiers-9.jpg
presse-papiers-5.jpg
presse-papiers-6.jpg
presse-papiers-7.jpg

You need to use DeviceInstaller to setup this module. I choose an IP adress like 192.168.1.244 in the Network Menu.

I used too the port 502 usually need for odbus TCP. But you can use other ports like: 10001, 1470...But be carefull, some TCP/RS232 converter can run with modbus tcp, so use another.

-------------------------------------------------------------------------------------------------------------------------------------------------------

C'est en utilisant le logiciel DeviceInstaller du même constructeur et en se connectant à l'adresse IP du module que j'ai arbitrairement fixé à 192.168.1.244 dans la rubrique Network (non fournie ici).

J'ai utilisé le port 502 qui est généralement réservé au modbus TCP.
Vous pourrez si vous le souhaiter en utiliser un autre (10001, 1470,....) mais soyez sûr qu'il n'est pas déjà utilisé. Certains modules ont le port 502 réservés au MODBUS TCP.

Le Câblage Du Xport: LAN/RS232, 3.3V<->5V Adapter

presse-papiers-8.jpg

This schematic is made under PROTEUS and comes from a magazine: Electronique Pratique.

The Xport 1001000-03R (now I think obsolete) is supplied under 3.3V so you need a 3.3V to 5V converter to link it to the arduino.

Pin map: RX1 on D0, TX1 on D1.

----------------------------------------------------------------------------------------------------------------------------------------------------

Ce schéma a été réalisé sous PROTEUS et est inspiré d'un montage d'Electronique Pratique en vente partout.

Le Xport 1001000-03r est alimenté en 3.3V et ses bornes sont donc par là même compatible uniquement 3.3V. Cette interface réalise la conversion 3.3V/5V.

Les bornes RX1 et TX1 seront reliées respectivement et directement à RX et TX de l'arduino.

Les Paramètres Du CSW-M85: WLAN/RS232

images.jpg
presse-papiers-10.jpg
presse-papiers-11.jpg
presse-papiers-12.jpg
presse-papiers-13.jpg

You need EZmanager to communicate and setup this module in ISP mode. Look at the schematic on next pages.

----------------------------------------------------------------------------------------------------------------------------------------------------

En utilisant EZmanager avec une communication USB en mode ISP (cf montage ci-après).

Le Câblage Du CSW-M85: WLAN/RS232

presse-papiers-14.jpg

The schematic made with PROTEUS, a modified schematic of the famous EZ 80C (now obsolete).

In ISP mode (setup with Ezmanager) think to link CTS, RTS, ISP, SYTRST, RXD and TXD.
In communication mode RS232 (RX1 on RX (D0) arduino, TX1 on TX (D1) arduino) think to disconnect the pins RXD, TXD, ISP, CTS et RST.

---------------------------------------------------------------------------------------------------------------------------------------------------

Encore avec proteus et insipré de l'EZ 80 C (obsolète) et la revue Electronique Pratique.

En mode ISP (paramètrage par le logiciel Ezmanager) penser à câbler CTS, RTS, ISP, SYTRST, RXD et TXD.
En mode de communication RS232 (RX1 sur RX (D0) arduino, TX1 sur TX (D1) arduino) penser à débrancher les bornes RXD, TXD, ISP, CTS et RST.

Les Paramètres Du CIEM10: LAN/RS232

images-1.jpg
presse-papiers-15.jpg
presse-papiers-16.jpg
presse-papiers-17.jpg
presse-papiers-18.jpg

This converter is now obsolete but new version are available and the setup is nearly the same. You need ezTCP manager to setup the good IP adress.

I used the port 10001 because modbus TCP communication is running on this module, so the port 502 is not available for this application.

------------------------------------------------------------------------------------------------------------------------------------------------------

Ce composant est obsolète mais ses nouvelles versions sont voisines du point de vue fonctionnement.
Le paramétrage se fera grâce à ezTCP manager de eztcp.

J'ai utilisé cette fois-ci le port 10001 car le port 502 est réservé.

Le Câblage Du CIE M10: LAN/RS232, 3.3V<->5V Converter

presse-papiers-19.jpg

You need this kind of converter because this module is supplied under 3.3V.

-----------------------------------------------------------------------------------------------------------------------------------------------------

Encore une fois ce module s'alimente en 3.3V et il faut réaliser la compatibilité entre les bornes 3.3V et 5V de l'arduino.

L'interface Version 2: Saisie De L'adresse IP Et Du Port./VB.NET Source Code

presse-papiers-20.jpg

The VB.NET source code with french comments (sorry!):

-----------------------------------------------------------------------------------------------------------------------------------------------------

Le code source VBNET:

Remerciements

Many thanks for any running interresting shared tutorial on the net.

---------------------------------------------------------------------------------------------------------------------------------------------------

Un remerciement particulier à Andreas qui sans le savoir et dans l'indifférence générale à contribué à faire aboutir le projet avec son nouveau mode de communication TCP: http://www.zhinst.com

Un autre remerciement particulier pour David Shelato (thanx and best regards) et son interface tcp utilisant le socket TCP qui ne fonctionne plus sous windows 8 mais est très efficace sous XP. C'est son interface rudimentaire et désormais obsolète qui a tout initié: http://www.shelato.com

Les autres acteurs de l'ombre et des ténèbres:

http://www.lextronix.fr

http://www.eztcp.com

http://www.hellfest.fr

Revues à venir: arduino atmega644/1284 clone+ ethernet shield+modbus tcp+AdvancedHMI, carte d'axes du robot...