luc desruelle's Blogue

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Modbus RTU over TCP Master with LabVIEW

Desruelle_luc
Trusted Enthusiast

I have used it successfully to create a Modbus RTU Master or Modbus IP Master or Modus IP Master with a gateway (with unit ID). My new goal is to create a Modbus RTU over TCP master : an RTU protocol but an TCP transport.

 

plus d'infos sur Modbus avec LabVIEW sur https://decibel.ni.com/content/blogs/Luc_Desruelle/2013/06/20/modbus-et-labview

 

La nouvelle API Modbus pour NI LabVIEW est vraiment très bien

NI LabVIEW Modbus API Discussion

 

 

Pour le "transport" série, il y a le protocole RTU (le plus utilisé) ou ASCII. Le "unit ID" est alors l'adresse de l'appareil sur le bus. Il utilise l'API VISA.

Modbus RTU Master.png

Modbus ASCII Master.png

 

Pour le « transport » TCP, il y a le protocole TCP. Le « unit ID » n’est alors pas utilisé, sauf lorsqu’il existe une passerelle (Gateway), ou pour activer certaines options sur des automates. Par défaut il n'est pas "cablé" sur le vi "create IP Master", mais il existe un vi dans la palette modbus qui permet de modifier cette configuration.

 

Il existe un dernier cas, Modbus RTU over TCP. Le protocole RTU mais sur le transport TCP. Avec la nouvelle API, il faut créer son vi « Modbus RTU over TCP master.vi » qui va définir l’utilisation de l’ADU RTU mais via la couche réseau TCP.

Modbus over TCP Create Master.png

Modbus over TCP Create Master code.png

 

le code devient

create Modbus RTU over TCP master exemple.png

 

plus d'information ici https://decibel.ni.com/content/message/114904#114904

 

Luc Desruelle | avatar_ld.gif | Voir le profil LinkedIn de Luc DesruelleVoir mon profil

Auteur livre LabVIEW "Programmation et applications" édition Dunod, jusqu'au niveau pour l'examen CL...

 

CLA : Certified LabVIEW Architect / Certifié Architecte LabVIEW
CLD : Certified LabVIEW Developer / Certifié Développeur LabVIEW

Contact

 

 

banniere Luc Livre NXG Champion.png

Luc Desruelle | Mon profil | Mon blog LabVIEW | Auteur livre LabVIEW : Programmation et applications - G Web
Certified LabVIEW Architect (CLA) & Certified TestStand Developper (CTD) | LabVIEW Champion

MESULOG - LinkedIn site | NERYS - NERYS Group
| directeur CEO MESULOG
| CODIR - NERYS group

Comments
odoria
Member

Thanks for your post.

 

Where can I get that library?

 

 

Desruelle_luc
Trusted Enthusiast

hi, what's your LabVIEW version ?

https://www.ni.com/fr-fr/innovations/white-papers/12/introduction-to-modbus-using-labview.html

 

 

NI provides three primary mechanisms for interfacing with Modbus devices: (1) a high-level OPC server, (2) a Modbus I/O server, and (3) a low-level Modbus API introduced in NI LabVIEW 2014 .

 

which LabVIEW version do you have?

 

in this post, i have used https://forums.ni.com/t5/NI-Labs-Discussions/NI-LabVIEW-Modbus-API-Discussion/td-p/3373078 toolkit.

A+

Luc

banniere Luc Livre NXG Champion.png

Luc Desruelle | Mon profil | Mon blog LabVIEW | Auteur livre LabVIEW : Programmation et applications - G Web
Certified LabVIEW Architect (CLA) & Certified TestStand Developper (CTD) | LabVIEW Champion

MESULOG - LinkedIn site | NERYS - NERYS Group
| directeur CEO MESULOG
| CODIR - NERYS group