Modbus TCP to Modicon PLC using Modus library

Hello. First, FWIW, I have zero experience using a network or Modbus. I need to communicate to a Modicon Quantum PLC using the modbus library.  Looking at the provided examples of TCP in the library it seems straight forward but I am evidently missing something.  It seems regardless of the address I send to the PLC I receive no response. I am using the "MB Ethernet example Master.vi".  Since the PLC is currently in operation I deleted the "coils to write" and "registers to write" events from the example since I didn't want to accidently cause any operational problems.  That leaves me with the simple 'time out' event executing every 100 ms reading coils and registers. I have the network address of the PLC and using a cross over cable directly from the computer, I can see the tcp receive and send lights flashing on the plc's communiction module as I attempt to read coils or registers.  But, I get no visible response written to the slave discrete inputs or the slave input registers arrays on the example front panel.  I added a loop to write addresses starting at 0 and let it run up to 12000 with no response.  The only documentation that has been provided to me about the PLC is a list of the PLC variable memory addresses.  All the addresses are either a 6 digit number starting with 4 (400063) or a 3 digit number such as 299.  If I try to send a 6 digit address the example returns an error and sending any other number ,at least up to 12000, gets no visible indication of response in the example.  I would appreciate someone cluing me in to what I'm not doing or what I'm doing wrong. Hope the question makes sense.  Thanks.

I'm a bit confused as to what you are trying to do. From your post it appears as if you are using the MB Ethernet Example Master VI, but are you also using the MB Ethernet Example Slave VI as well? If you are running the Slave VI and update the Discrete Inputs or Input Registers, the Master VI should pick up on that if they are set up correctly. Also, you modified the Master VI, did you also modify the Slave VI?
Stephanie O.
DIAdem Product Manager
National Instruments

Similar Messages

  • Using Modbus TCP I/O Server with new DSC Shared Variables in LabVIEW 8.6

    Hello,
    I'm using LabVIEW 8.6 and want to communicate with a Beckhoff BK9000 Ethernet TCP/IP Bus Coupler via Modbus TCP. Instead of using the NI Modbus Library, I've tried the new LabVIEW 8.6 feature "DSC Shared Variables" as described at the bottom of this page: Latest NI LabVIEW DSC Module Features and Demos. Reading of analog input bus terminals works fine. However, I haven't figured out yet how to write on an anolog output bus terminal with these shared variables.
    It's about a 16 bit analog output and I need to write to the registers 0x1121 and 0x0801. It works with the NI Modbus Library (just using function code 6 and choosing the registers), but on the other hand I don't know which shared variables I have to choose for these registers. I've tried several data items (e.g. 400001 upwards as well as 402049 for 0x0801) but none of them worked. I would be glad for a short explanation - thanks in advance for your support!
    Regards
    utechle

    The Beckhoff documentation says, that holding registers start with 0x0800. I've checked this by using the NI Modbus Library. I used the "MB Ethernet Master Query.vi" togehter with the function code 6 for "Write Single Registers", changed the settings of the starting address to hexadecimal view and entered 801 (since it starts with a control byte in 0x0800 and the data out word follows in 0x0801). Furthermore, I had to address register 0x1121 in the same way for resetting the watchdog. As I've mentioned in my first post, this method works fine. However, I haven't found out yet which shared variables i have to use for accessing these registers.
    On the other hand, it's no problem to read data from analog input bus terminals using shared variables. They start with 0x0000 (status byte) and 0x0001 (data in word) and I can read data with the shared variable and data item 300001, respectively.
    Message Edited by utechle on 01-27-2009 11:12 PM

  • Is there a Modbus TCP driver built into Lookout ?

    Is there a built in ModbusTCP driver or do I need to add-in a third party OPC server.
    Thanks!
    Greg.
    Schneider Electric.

    The Modbus object in Lookout supports Modbus RTU/ASCII, Modbus Plus, and Modbus TCP.  I am using all three protocols with great success.

  • How to comminucate with multiple PLCs with Modbus TCP/IP using dynamic multithreads?

    I have an application in which I communicate with several PLCs using MODBUS TCP/IP toolkit. There is an array of IP addresses that the user can configure. Using for loops allows to work with this however if one PLC is out, the program waits for the timeout before polling the next PLC. I would like to use a multithreading type in order that all PLCs are polled at once and is not dependent of each other. In other words, I would like to dynamically simulate several while loops happening at the same time. Is this possible?
    Thanks
    arikb

    arikb wrote:
    Thanks A_Patel,
    I thought of doing that but do I need to run this as a VI server in that case? How would I pass inputs and outputs of the subvi?
    Appreciate the help,
    arikb
    Take a look at my Nugget on dynamically creating occurences found here.
    Just ignore the Occurence stuff and the rest of the code and verbage should help you. The example code creates a bunch of background processes and passes a unique parameter to each.
    Have fun,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Write values to PLC addresses via MODBUS/TCP

    I am trying to write values to some addresses on a PLC connected to my computer with MODBUS/TCP. I've mapped the addresses that I would like to write to on my project's MODBUS library as shared variables. However, I seem to neither be able to read from nor write to them these addresses. I've tried viewing the variables in LabVIEW's Distributed Systems Manager and the variables, when configured as read-only or read/write, report an unknown value, and when configured as write only, they do not display a value.
    I've verified that the PLC is connected properly, and I am able to read from other addresses on the PLC that I do not wish to write to. There also does not appear to be a communication error either. I have also successfully read from and written to the addresses using a third-party application, but for some reason, Labview will not do the same.
    Any suggestions on what might be wrong?
    Thanks!

    Hello Griffon,
    How did you set up your Modbus I/O Server? Did you follow the steps in this document?
    Connect LabVIEW to Any PLC With Modbus
    Make sure when setting up your server that you put in the IP address of your PLC (not localhost, or 127.0.0.1). 
    Also make sure that you're adding variables using the "create bound variables" dialog.
    If you did set everything up in that way, and it still not working, can you clarify what you mean with this sentence?
    "I've verified that the PLC is connected properly, and I am able to read from other addresses on the PLC that I do not wish to write to"
    Does this mean that you can read values out of the PLC using modbus, just not the values you want?
    Colden

  • Modbus TCP - Fatek PLC

    Hello everybody.
    I am kind of new in Labview a made some simple visa 232 connections, but now I have problem with modbus TCP. I would like to make communication between my PLC and labview, but the problem is i can newer find some simple working TCPmodbus example. I download library from the NI site but didnt work. I also read a lot topics regarding my problem, but I never see the solution.
    That You for our help.
    Best regrds
    Andrej

    Hi Andrej,
    What library are you using for TCP Modbus? Do you use the one from Sophir? http://sine.ni.com/nips/cds/view/p/lang/ro/nid/209754
    Or are you using the option with DSC module??
    You can find more information about how Modbus works on the following link http://www.ni.com/white-paper/7675/en
    Best regards,
    I.R.

  • Has anyone tried to use LabVIEW as a modbus slave with a PLC master?

    Hello.  I use modbus extensively with PLCs as slaves.  I am finding that it might be benificial to make the PLCs be the master in my next application.  I have tried this with the MB Ethernet Example Slave.vi without any luck.  Can anyone help?
    I am running LabVIEW 8.6 on Windows XP with AutomationDirect PLCs using ethernet communication.
    Thank you in advance for your help.
    Ron Deavers, CLD

    Hi
    There are two options to connect to a Modbus device. Either the Modbus IO Servers (found in the NI LabVIEW Datalogging and Supervisory Control Module) or the free Modbus Library.
    FLAsh
    National Instruments
    Applications Engineer

  • Using modbus tcp/ip to control vfd speed

    Hi, I'm brand new to Modbus and fairly new to LabVIEW. I do not have any code constructed yet, so I'm posting to here so that hopefully I can get led in the right direction. I have downloaded the free modbus library because after explaining to NI what I needed, they told me that this would give me enough functionality. I am trying to read the vfd frequency and display it on my front panel, as well as be able to adjust the frequency of the vfd through the front panel. I'm sure that this is a fairly simple and straightforward solution, but since I am brand new to modbus, I really am not sure what values I need to get in order to make this happen. I'm assuming that I need to initialize a tcp master, but what values do I need to feed it so that it can read anything from my vfd? I have an ABB ACS355 VFD with a FENA-01 ethernet adapter. I have the manuals for both and I see lots of parameters and numbers but I don't know how to make sense of them. Are there any keywords I should be looking for in these manuals? Sorry for posting such a general question but I really don't know how to begin this properly. Thanks in advance for any help!

    Hello,
    A great place to get started will be the shipping examples in the example finder. In LabVIEW, if you go to Help>> Find Examples and the search "Modbus" you will see and example called Modbus Fundamentals.lvproj. This uses shared variables and can communicate with TCP/IP (or ethernet etc) and is set to connect to the localhost. This example also shows how to read and write  using Modbus. There is a readme also included in the project if you need more information.
    Additionally, there is a great getting started white paper that may be helpful for you. I've linked it below:
    Introduction to Modbus: http://www.ni.com/white-paper/7675/en/
    I hope this helps!
    Best regards,
    Anna L
    Applications Engineer
    National Instruments

  • Using modbus/TCP with USB ethernet adapters

    I have a test stand where I have a handful of USB instruments and a single modbus/TCP slave.  I'm considering adding a USB ethernet adapter to the stand so that there is a single USB cable connecting the computer to the hardware rather than both a USB and an ethernet connection.  Does anybody out there have experience (good or bad) using USB ethernet adapters with modbus/TCP slaves?
    The existing USB instruments all use ASCII/SCPI-style command sets.  The Modbus/TCP slave is an Automation Direct EBC-100.  Nothing high-bandwidth or low-latency.  Basically, the computer issues no more than a handful or command or request (ether SCPI or Modbus/TCP) per minute.
    Mark Moss
    Electrical Validation Engineer
    GHSP

    Adam G wrote:
    Hello Mark,
    I was wondering what NI hardware you are going to be using in your application? Also are you going to be using LabVIEW for the programming? Have a great day!
    Best Regards,
    Adam G 
    The test software is written in LabVIEW, and the test stand uses M-Series cards for data acquisition.
    Mark Moss

  • Controlling a Load Drive using Modbus TCP or Ethernet IP

    Hello,
    My name is Francisco Loras. My team and I are looking forward to building a dynamometer in order to obtain test standards for motors. We're going to use a Load Drive in order to control the Load Motor. The Drives we have been looking at are either from ABB or from Yoskawa (a1000), both offer the option of connecting via Modbus TCP/IP or via Ethernet IP. I was wondering if someone has previously worked with them and could give me some feedback on either the drive or connection type. I would preferrably use Ethernet because the complete system we're building requires at least one more ethernet connection (for a Power Analyzer).
    Besides this, we were counting on using a Chassis from NI to put everything together. When looking at the specific modules, we considered two options:
    1- Using an ethernet module (from NI that fits in the Chassis) to drive in both the Power Analyzer and the Load Drive.
    2- Using an ethernet switch setting specific IP addresses. 
    Has someone used any of these before? A switch would be close to 50 times cheaper than using the ethernet module itself so I'm a bit worried there might be something that limits it or that I'm missing (noise maybe?).
    To conclude, I'm looking forward to se if someone has:
    1) Used Ethernet IP or Modbus TCP/IP to control a Load Drive, which connection type is best if any.
    2) Recommended any specific load drive
    3) Experience with using an ethernet switch or an ethernet module.
    Thankyou very much for your help and time,
    Francisco
    PD. If something is unclear (which I sense it is) please ask me and I can develop more on it.

    Florasga,
    Which ethernet module are you looking at? And what kind of chassis are you planning on using?
    There's some more information on Modbus here. Also, have you seen this forum post? 
    Kyle T.
    Applications Engineering
    National Instruments

  • MODBUS/TCP very slow execution

    Dear all
    We are new user to Labview and to LabVIEW forum.
    We are designing a LabVIEW application that interacts with PLCs.
    We are trying to exchange information between a PC/labview and a PLC. Both support the MODBUS/TCP protocole. We have designed the 2 programs easily, the PC/LabVIEW one being easily made with VI Library.
    We first the PC/LabVIEW as a cleint and the PLC as server and it works perfect. It is quite fast as it takes less than 1 second.
    We test the reverse configuration ie PLC as client and PC/LabVIEW as server. Of course we use different programs there and monitor the MODBUS/TCP frames with WireShark.
    It works also but the execution on the PC/LabVIEW is very long (in the debug mode) : it takes 5 secondes to execute the Write Multiple Register function ( 2 data to write) to prepare the response frame and to send it back. It is very nice to see the animation on the diagram but why is it so long ? This long time frame is a very big problem for our application.
    We re not sure to know where to dig in !
    Thank you in advance for your help.
    Regards
    Thierry

    It sounds like you need to learn more about the LabVIEW development environment if you were confused about the slow speed of highlight execution.
    I would recommend looking at the online LabVIEW tutorials
    LabVIEW Introduction Course - Three Hours
    LabVIEW Introduction Course - Six Hours

  • Communicate through Modbus TCP

    Hi every one,
    I'm new at researching the LabVIEW Software.
    I'm having a thesis in University.
    My project is, use LabVIEW draw in PC a model of automation system. Then, use two Schneider Premium PLCs in mode Redundancy to control and supervisory this model through Modbus TCP.
    I don't know how to Model LabVIEW in my PC communicate with PLC? Do i need any device for that communication (Ex: any Card?...)?
    Anyone used to solve this problem can help me now.
    Thanks all.

    The only HW you need is an ethernet port.
    For the SW, see this discussion about the Modbus libraries for LabVIEW. You will find links to :
     third-party library (SAPHIR)
     current (never really supported) library from NI
     new, not yet officially released library from NI
    I have developped several applications with the second library how still works with the current version of LabVIEW.

  • Modbus TCP server/slave implementation

    Does anybody have experience to implement a modbus server or slave application? My computer needs to communicate with a PLC. The configuration is: computer is TCP server or slave, PLC is TCP client or master. Computer to write input registers for PLC to read. Computer read holding registers from PLC. Cannot find any labwindows examples.
    Thanks a lot.

    Thank you all for the replies. Most the links are for modbus tcp client (master) instead of modbus server (slave).
    Now I am trying to use a modbus slave activeX control (trial version) from Automated Solutions Inc: http://www.automatedsolutions.com/products/modbusslave.asp.
    I created an instrument driver using Create ActiveX Controller wizard. I can get a correct object (modbusHandle) with the first line below (status = 0). But the second function (set a property) gives negative status return (status = -2147418113).
    status = ASMBSLVLib_New_DASMBSLV (NULL, 1, LOCALE_NEUTRAL, 0, &modbusHandle);
    status = ASMBSLVLib__DASMBSLVSetDataMode (modbusHandle, NULL, ASMBSLVLibConst_DATA_MODE_MB_TCP);
    Did I create the activeX control correctly? Automated Solutions told me that the ActiveX control is a windowless control. It's a runtime control. Is it a problem?
    Thanks in advance.
    jzhu0000.

  • Modbus tcp on c-rio

    Hello everyone. I already wrote an application to control via modbus tcp the plc of my brushless motor. It works fine.  Now i'd like to do the same thing using 2nd ethernet port of c-rio (just set like ni guide). It's possible this application?
    thanks a lot
    Francesco

    Ok, I understand what you would like to do.
    Yes you can do this, as soon as the shared variables hosted on the cRIO will not be served  to both subnets at the same time. I found this information in the following link, under NI Dual Ethernet Technology.
    Introduction to Dual Ethernet Architectures
    http://zone.ni.com/devzone/cda/tut/p/id/7103
    I think that also this example will help you:
    Using Secondary Ethernet Port on a Remote Target for Data Transfer:
    https://decibel.ni.com/content/docs/DOC-8744
    Antonios

  • MODBUS/TCP in CVI

    Dear All,
    I need help to write MODBUS/TCP coding to read data from a third party device.
    The deveice is getting connected with help of "ConnectToTCPServer" function. But i am not able to get the data from the module. Any idea how to send the qurey and get the data.
    regards,
    Kumar.E

    Hi Kumar,
    I have a few questions that will really clear up a few things for me. Are you actually using Modbus or are you using the TCP functions in CVI? What are you trying to do, basically what do you want to be able to do? The actuall functions that you need to call should be in your device manual. Do you have this information?
    We have a Modbus library for LabVIEW but we do not have one for CVI. Please reply with more information on what you are trying to do.
    Regards
    Krista S.
    Applications Engineering
    National Instruments

Maybe you are looking for