NI Home > Community > NI Discussion Forums

LabWindows/CVI

Showing results for 
Search instead for 
Do you mean 
Reply
Member
lilian
Posts: 10
0 Kudos

how to control a module using modbus protocol with LabWindows?

I use WAGO 750-316 modules using Modbus protocol and I want to control them with LabWindows. How can I do?
Proven Zealot
RobertoBozzolo
Posts: 5,225
0 Kudos

Re: how to control a module using modbus protocol with LabWindows?

I wrote some programs in VB and CVI to control PLC and devices with Modbus protocol. All devices I used were connected via RS232, but I assume this has no effect on the definition of the message to send to the device.

Attached you will find documentation (by Cal Technologies) to communicate with one device: in chapter 2.4 and following you will find the definition of the Modbus messages and some examples of communication (together with the code for CRC calculation and check).

Hope this helps
Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Zone Community
________________________________________
If I have helped you, why not giving me a kudos?
Member
lilian
Posts: 10
0 Kudos

Re: how to control a module using modbus protocol with LabWindows?

The WAGO 750-316 was connected via RS232 also.
Do you have a dll who allow the communication between Modbus and CVI?
If you have one, how can I use it?
Do you have some samples?
Thanks for your help.
Lilian.
Proven Zealot
RobertoBozzolo
Posts: 5,225
0 Kudos

Re: how to control a module using modbus protocol with LabWindows?

No, I don't have any dll to communicate with the instruments.
I simply added to my code the statements reported in the documentation I already posted, adapted to the specific messages and memory map of the individual device, and it worked.

The real problem for me was to interpret the numeric datas transmitted by the devices, particularly a Siemens S7 plc wich used compact format for numeric values being transmitted.
Another problem was to put the correct delay to wait for the instrument response to come (modbus protocol requires that every message sent has a response), but it was only a matter of attempts to discriminate the correct time delay.

If you want I can e-mail some example to you. In case you need it, write me to roberto.boz
zolo@eltra.net.

Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Zone Community
________________________________________
If I have helped you, why not giving me a kudos?
Member
Dreamer14388
Posts: 20
0 Kudos

Re: how to control a module using modbus protocol with LabWindows?

Hi 

 

I am new here and don't know how to post new question....Anyway I need to make a simple keypad that takes 1,2,3... from the user and displays on the screen like a one number...for example if a user enters 1 it displays 1 on the screen then user enter 4 it displays 4 on the screen and the number is 14 and then I have to use this no in further calculation.... I have made the UI and partial program but stuck here,,When I enter 1 it displays 1 but when I enter 2 it replaces 1 and displays 2 and I need it to take both as the no 12......Any help will be greatly appreciated...Thanks in advance.

If you are young work to Learn, not to earn.
Trusted Enthusiast
Wolfgang
Posts: 2,586
0 Kudos

Re: how to control a module using modbus protocol with LabWindows?

Hi,

 

if you don't know how to post a new question, read the help; you can find it here

 

forum_help.png

 

As a general rule

  • don't hijack other's threads
  • start by searching the CVI help and example programs
  • specify your problem such that it is possible to reproduce it, e.g. by providing the relevant lines of code