Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus Ethernet TCP/IP control for PLC Modicon-Quantam.

Solved!
Go to solution
Has anyone used LabVIEW to program a Modicon-Quantam PLC successfully using Ethernet TCP/IP? I have tried the MB Ethernet (Master/Slave) examples in the download nimodbus121 and it is not working. I really need to know the best way to connect and communicate to a Modicon-Quantam PLC using LabVIEW, Ethernet Modbus TCP/IP using Excel Spreadsheet. I need to write to input registers shift (write) into and read from holding registers. The software I have for SMTX Modbus/TCP Master ActiveX Control is not completely working for me. I can ping to the PLC from cmd prompt. I viewed this webcast - Creating a Modbus TCP I/O Server with the LabVIEW Datalogging and Supervisory Control Module 8. I also viewed a webcast on OLE for Process Control (OPC). What do I need to write LabVIEW control and view registers using LabVIEW indicators? Does anyone have a LabVIEW example that I can start with? Should I purchase the DSP module for $1280.00? Will this solve my problems?
0 Kudos
Message 1 of 5
(7,695 Views)

Alabama-RickP

 

There are two basic methods of communicating with a 3rd Party ModBus device from LabVIEW.

 

1.The Modbus Library is a free LabVIEW toolkit you can use to communicate with a Serial or Ethernet Modbus device. This toolkit is essentially a LabVIEW instrument driver that uses simple serial commands to implement Mod Bud read and writes. Check out this example.

 

2. The second method is use DSC. With DSC you will be able to set up a Modbus I/O server and bind a LabVIEW shared Variable to a particular address on the PLC. Once it is linked you will have built-in tools for datalogging, alarms, and custom control over all of the update settings.  Read this help doc for more info on how to create I/O servers.

 

Message 2 of 5
(7,675 Views)

 

Thanks Hueter -

 

 

I am still working with (Since February) the Datalogging and Supervisory Control toolkit and finally have the program running 38 machines successfully with the exception of reading time from the PLC or transferring time through the PLC out to an indicator.  Basically anything coming from the PLC as time is not indicating correctly.  I can see the data is moving into the holding registers correctly (using the PLC software)  but going out from a DSC register into the LabVIEW indicator is not displaying correctly.  I have tried changing the representation and display formats and have either not hit the correct one or have been unsuccessful on finding the correct coercion parameter.

 

 

 

I heard that some PLC's output a hexadecimal word and needs conversion to out into LabVIEW.  I tried using code conversion to no avail.  The output is very sparatic and non-linear.  I have posted more about this in the Instrument Control Forum.  I am stuck as to moving forward.  Has anyone ever had a problem with DSC toolkit timing using a Modicon - Quantum PLC?

 

 

 

https://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Modbus-Time-reads-into-register-fine-but-the...

 

 

 

 

 

 

 

 

 

0 Kudos
Message 3 of 5
(7,144 Views)
Solution
Accepted by topic author TMC-RickP

If you are getting back data that you don't understand I would recommend trying to send a known output from the PLC so you can at least determine what kind of conversion needs to happen. This document talks about the Optomux protocol which can be used with some PLCs. You will need to find specific documentation that tells you how to convert that data into LabVIEW. Also you may want to start a new forum since this is a separate issue from the original.

 

-Hunter

Message 4 of 5
(7,110 Views)

Give us an example of some data values. What are the values in the plc registers?? and what is the time that they should display?? Is your plc software displaying them as I16, I32, U16, U32, double precision,...??  Are these 4xxxx holding register values or trying to read the real time clock in the plc??

0 Kudos
Message 5 of 5
(7,084 Views)