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

Similar Messages

  • Problem communicating via Modbus TCP with Honeywell UDC3200

    Hello:
    I have to read the temperature of the Input 1 of this controllers. I've succesfully read the temperatures in the controllers. I'm using Modbus TCP/IP for the communication through the NI Modbus Library 1.1. I'm working on LabVIEW 8.5.1. However, sometimes when I open the connection, I get error 56 (timeout), despite that the controller responds to a ping. When I can initiate all the connections to the controllers, some hours after the monitoring has started, randomly, I get an error 66 (the connection was closed by the peer). This error interrupts the connection and the temperature readings stop. This is not acceptable.
    Also, I've found out that if you don't request some data from the controllers in 5 seconds or more, also the error 66 appears. To solve this, I poll twice a second the controllers but the error 66 still shows up.
    The controllers and the PC are interconnected via an Ethernet switch. The switch works well.
    In brief, I can communicate with the controllers but the communication is not reliable. Sometimes when I start the communication I get an Error 56 and sometimes after the communication starts I get Error 66. It cannot be predicted when this will happen.
    Why does the error 66 appears?
    Has somebody communicated succesfully with this controllers?
    I'd really appreciate your help, I'm running out of time.
    Thanks in advance.
    Robst.
    Robst - CLD
    Using LabVIEW since version 7.0

    Hello:
    Thanks for answering Pedro. I've read the document you told me to, but it refers to problems with VI Server, the application is not using VI server, so I guess the problem comes from somewhere else. I still haven't figured out why this is happening.
    About the Error 56, well, I'll try to slow down the communication, I'm not doing any delays after sending the information. I wasn't aware that I needed to do this.
    Any other ideas?
    Thanks in advance.
    Robst.
    Robst - CLD
    Using LabVIEW since version 7.0

  • Access to Cisco Switch Modbus Register Map? via Modbus TCP or Modbus RTU

    Hello Folks, I have been trying to find out how to access the Modbus Register Map(s) of Cisco switches, of particular interest is that of an IE 3000 as it is din rail mountable (but for models 2960s, 3560s are also of interest).  A google search for: Cisco Switch Modbus TCP results in (if I may) how to configure a Cisco 2520 to do what I am trying to do.  I would be very grateful for any hints anybody might have.  Thanks

    Though I am not familiar with the specific drives in question, I have used Modbus/TCP in LabVIEW a few times recently.
    As the previous posters pointed out, there are a couple of VI libraries available.  LabVIEW 2014 added Modbus VI's with the DSC and LabVIEW Real-Time.  The others you would have to get and add in yourself.
    Another option is to use LabVIEW I/O Servers; as long as you have DSC or Real-Time, you can create Modbus I/O Servers as library items and deploy to a target.  You don't get as much direct control in this way (and may run into difficulties if you need them to be field-configurable and do not have DSC) and use bound network shared variables, but they are very fast and easy to setup and I have yet to have any issues with using them in my applications.
    A tutorial on setting up a Modbus I/O Server: http://www.ni.com/tutorial/13911/en/
    A tidbit on deciding between Modbus VI's and a Modbus I/O Server: http://zone.ni.com/reference/en-XX/help/370622M-01/lvmve/choose_modbus_ioserver_vi/
    As for using an Ethernet switch to connect multiple devices, I have used this approach many times to simultaneously connect and control numerous PC's, real-time controllers, and drives without issue.  I would not expect there to be any problems unless you have extenuating circumstances.  In fact, if you only have one network interface on your device at the moment, I would recommend against adding a second, as this would mean that you / your controller would have to be extra aware of which interface everything is assigned to go through.

  • 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

  • Watlow PM with Modbus TCP

    Hi community,
    I have a watlow pm temperature controller connected to my computer with an ethernet cable. I need to communicate with the device via modbus tcp. I know for sure that the unit is functioning as if I use a modbustcp test program (see the first attachement), then I can read the temperature of the K type thermocouple which is connected to the unit. (the IP is 192.168.10.3, and I read two words from address 360). The temperature on the screenshot is 23.61992C
    I would like to do this from LabVIEW by using an IO server. My problem starts at the beginning. I right click on my computer >> new >> I/O server >> Modbus
    then in the popup window I select "Modbus ethernet" in the top right corner. I have attached this popup window. What is the Address in the communication settings section. The IP need to be entered at the bottom, so I have no clue what is the Address field is referring to.
    Then I try to create bound variables... I see a huge list of registers, but honestly I dont understand how the address 360 I use in the standalone program translates to this list. Which one should I select from the list? Whatever I select gives me either 0 or FALSE if its a boolean. According to the documentation 360 is the relative address and the absolute is 400361. Actually there are a register list from 400001-465535, but if I select 400361-400362 I still read zero.
    Reading only zeros and FALSE values... thats suspicious. Something is wrong.
    Please help out with your thought! 
    Attachments:
    modbustcp_OK.png ‏132 KB
    modbus_config.png ‏56 KB
    modbus_reg_list.png ‏98 KB

    OK, just a quick (and dirty) test. Can you try this VI.
    Kees
    Attachments:
    MB TCP test.vi ‏20 KB

  • 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

  • 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

  • Collecting data from register via MODBUS into array

    Hello there,
    I have trying loads of different approaches to do something as simple as collecting a value(an U16 value) of a register(via modbus) and store it in a simple 1D array indexed in every iteration by means of a for loop.
    THe example that I thought it could fit into my application is attached, but it does not collect anything.
    What do I do wrong??
    In the image attached, please see below, the register contais a 183 value on every interation(two in this example), and nothing is stored in the Array!
    Thanks in advance.
    Solved!
    Go to Solution.

    Hi Rcano,
    please go through beginner courses offered by NI and read the labVIEW help. Learn things like "auto-indexing"!
    You need to index the first value of your "Register" data and wire that value to the FOR loop border. The loop will create an array by AUTO-INDEXING…
    I am trying to use the iteration number of the for loop to index an array and store those two values in it.
    Right now you don't use the iteration number (and you don't need to). You would use it when you have a pre-defined array in a shift register and take the function ReplaceArraySubset to replace values in that array. This is a basic programming technique in LabVIEW that you should have learned in those beginner courses…
    I have been trying all ways I can possible think, and I am not able to do such as simple thing.
    You missed autoindexing as the simplest solution. That is tought in the beginner courses offered by NI.
    Did I mention those beginner courses offered by NI (for free!)?
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Interface of Allen Bradley PLC with LabVIEW using TCP\IP modbus protocol

    Hello.....
    I want to connect a Allen Bradley PLC with LabVIEW using TCP\IP modbus protocol.
    The PLC which I am using is a series of 1766BWA (Allen Bradley) please can you help me for the same or please give me suggestion.
    Also I want to know the resistance values of this PLC.
    Thank you.

    Hello
    I was trying for connection of a Allen Bradley PLC with LabVIEW using TCP\IP modbus protocol.
    Here I am attaching the snapshot of PLC interfacing and communication vi using modbus but it is not working
    For reading we use setting shown in CHANNEL 1-modbus but it gives error regarding modbus addressing
    and for writing it shows error illegal address please help me for the same.
    Thank you.
    Attachments:
    PLC_SCREEN.zip ‏261 KB
    Modbus_(Read-Write).zip ‏14 KB

  • 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

  • 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

  • Nothing happens when I write in a website address! But it works if I go via bookmarks.

    Nothing happens when I write in a website address! But it works if I go via bookmarks.
    I also got problem with e-ID. The connecton with the ssecurity program does not work. I have both the program and ID-certificate.
    I installed Firefox 10 yesterday.
    I am in a hurry - I am going abroad tomorrow morning.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *eID België: https://addons.mozilla.org/firefox/addon/belgium-eid/

  • 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.

  • How to write to a PLC Simatic S7-300 via HMI Adapter from Labview

    Has someone tried to write from Labview 6.0 via a Siemens HMI Adapter to a DB on a Simatic S7-300 CPU.
    I am only able to read. Trying to write comes the message from the OPC server: Protocol error, NO response from PLC

    Greetings!
       Thanks for the post. Please check the following.
       1) Did you try connecting with server explorer and see if you are getting a response from the PLC
       2) Also please refer to the following links which will help you on further programming
        http://digital.ni.com/public.nsf/websearch/3F0B1B7C1E80FC3286256738007EED39?OpenDocument
        http://digital.ni.com/public.nsf/websearch/F92C1F2F7B35105B86256DB200628B24?OpenDocument
        http://digital.ni.com/public.nsf/websearch/9FAE59C3B902458B8625672400651A2E?OpenDocument
       3) Is this the first time you are talking to the PLC , or
    did it just happen and if it did was there something that changed
    Do you have any vi built and testing. The links above have example programs you could use.
    Thanks much and hope this helps.
    Best regards
    Avi Harjani

  • Problems communicating with LK4.5 and Quantum PLC over Modbus TCP/IP

    I am developing an application using LK4.5 communicating to Quantum PLC over Ethernet Modbus. The update is set at 1 sec. There is a periodic delay in getting an response from the PLC. On probing, i have found that the Modbus object update (checked with an led) blinks OK for about 20-30 seconds during which the valid frames are incrementing correctly. However, after that, for a short duration of about 10 secs, the update led stops, and the valid frame count increases quite rapidly. During this time, the date is not being read from the PLC. This process repeats quite regularly. This time during which it reads correctly, and when it gives a problem, remains quite constant for one PLC, though it varie
    s between PLC to PLC. There are 7 PLC's connected to the system. Please suggest any remedial action. Thanks.

    Further development has happened on the Modbus driver to resolve Ethernet issues. There is a Lookout 4.5.1 update on the FTP site to update Modbus driver and Report Object.
    ftp://ftp.ni.com/support/lookout/fixes/4.5.1

Maybe you are looking for

  • Performance Management Template issue in EHP4

    Hi Guru's, I have created a Performance Management template in PHAP_CATALOG and few days before i have delete the template in PHAP_CATALOG. But when i tried to login into portal for any user i am getting this error message " Template 50022735 is not

  • Blue background under finder icon in dock

    Hi guys, i have this problem (as you can see on screen shot - blue background under finder icon in dock), what i need to do to fix it?

  • Hi, can i purchase and email an itunes voucher

    Hi Just wanted to purchase and email an itunes voucher to someone who doesnt have PC access to itunes currently. Can i do this? Thanks in advance. xx

  • Just archived & installed to fix OSX, now what's the best way to restore?

    So recently my OSX stopped working for reasons unknown to me, but an archive and install saved my life, thank god. However, now I have this folder with all my previous files and applications, I'm wondering if there's an easy way to restore my compute

  • Cant 'start' oracle

    Hello I've tried installing Oracle 10g DBA. I got the CD from another country, it appears its not an original :( Regardless, it installed w/o any problems but now I dont know what to do. How do I 'start'? I searched the directory for exe files, came