Modbus Communication with Cube400

Hi
I have problem to communicate with Cube400. It is using modbus protocol and communication is going through rs485. I must connect it to cRIO 9022 serial port so I used converter IC-485SI (converter manual on page: http://www.esis.com.au/Converters/ic485si.pdf ) to change communication from rs485 to rs232.
I tried to used Modbus I/O Server. When I have one variable binded to modbus register I have proper reading. When I add second variable then I lose readings from first one. This solution is in VI called ModbusIO_rs485.
After this I tried to communicate with Cube400 by using VISA blocks. I tried to send specific modbus message. On the begging I get proper response several times but right now I am getting timeout error. This program is in VI called VISA_MBP_ForcePush.
I am attaching project with this VIs
What is wrong here ?
Best Regards
Pawel Dudzik
Attachments:
LABVIEW.zip ‏28 KB

In your program you read 16 bytes immediately after the write.
You should add some time after the write and you should see how many bytes there are available and read that number of bytes.
Look at the COM example shipped with LabVIEW.
And you use the WRONG CRC it should be 0x5679.
Try communication with the loopback command. Sending  0408 0000 8844 866D  (Hex data) should return the same data
Kees

Similar Messages

  • Modbus communication with Modicon premium PLC

    Is it possible to communicate modicon premium plc(P574634M) and Lab view through modbus.
    If possible how?

    First, do a search for Modbus. There are several options available for communicating with Modbus devices from LV.
    Then, if you have a more specific question, you can post it to the LabVIEW board (you posted to the feedback board by accident).
    Try to take over the world!

  • Modbus communication with a load cell

    Hello..!
    I'm a new user of  LV and I try to communicate with a load cell by RS232 modbus.
    After installed NI Modbus Library I created a master VI with labview 8.6 using these library, and I can obtain a communication with load cell  , these value are added into 1 register U32Bit, and it's  okay, if  I press a load cell I can see the values go on.( from 0 to 65535) . Now I want to show  on front panel  the value in KG , as decimal point,, for a right interpretation of value  for my customer, so I added a block array to unbundle than I convert a value with I32Bit ( -32768 to 32768 ) with an indicator, but I can't see any values..
    I suppose I doing something of  wrong ( conversion ), I read some KB, but I can't see a suitable solution..
    Can someone give me  a link or information to show me an example to convert this value..?
    Thanks  in advance for any helps..
    Configuration of  MAster VI:
     Read holding register
    Starting address 2012 ( query for obtain net value from the load cell)
    quantity 1
    Slave address: 1
    RTU
    9600
    Com 3
    parity none 
    Solved!
    Go to Solution.

    Hello Ravens,
    I tried to use your good advices and  finally I can communicate correctly with my trasducers showing  on front panel the right value ( Kg). Has been a  problem of conversion from output of register ( U16Bit  as 0-65535 )  to I16bit ( -32765 to 32765).
    Thanks  very much for  your help, and I hope to chat again for new challenge...
    Have a nice WE
    Julio
    Attachments:
    Comunicazione Modbus load cell.jpg ‏46 KB

  • Modbus communication with an automation direct GS2 AC Drive

    Has anyone written any VI's to communicate with an automation direct GS2-41P0 AC Drive using modbus?  I need to ask the unit a few questions while it is running and possibly start and stop it.  I have started searching around and found the NIModbus VI's.  I just have not figured out how to modify them to suit my needs yet (I just started playing with this today).  So far it looks like Modbus might make my head explode, but I am hoping it is easier than it looks at first.
    Bryan

    Hi Bryan,
    I've never tried using modbus to communicate with that particular device, but if you have any specific questions I'll do my best to answer them.
    Also, you may be interested to know that the AutomationDirect GS2 Drive is supported by our NI-OPC Server, which may be a more attractive alternative to modbus.  I highly recommend you take a look at the LabVIEW Datalogging and Supervisory Control (DSC) module (wihch includes NI-OPC Server) to see if it is something your application would benefit from.
    Supported Device & Driver Plug-in List for NI-OPC Server
    Connect to Any PLC
    LabVIEW Datalogging and Supervisory Control
    Eric V
    National Instruments
    Applications Engineer
    Certified LabVIEW Associate Developer
    "I'm a Ramblin' Wreck from Georgia Tech and a helluva (NI Applications) Engineer!"

  • 485 modbus communication with Watlow PM trouble

    I have a Watlow PM that I can see over MAX now and using the EZ zone code can get manufacture info from.  I also am using (for the first time) the add-on Modbus over serial tool from Saphire to try to write or read anything from it and I always get a "time out" error from the slave.  I tried to do a simple VISA read as I found on some posts and I get the same time out error.  It seems if I try anything from Labview I get this error.  I even tried writing Hex to the thing with the same results.  Can someone throw me a bone?
    Solved!
    Go to Solution.

    There are a couple of free libraries.
    http://sine.ni.com/nips/cds/view/p/lang/en/nid/201711
    https://decibel.ni.com/content/docs/DOC-30140

  • Communication with modbus devices

    Hello All,
    My name Peter, I am currently exploring what LabVIEW has for instrument communication. I have explored a little on NI-Visa and used it for instrument communication through USB and Ethernet. My next task just now is to see how I can communicate with Modbus devices. I have done some background reading on modbus communication protocol and now have some level of understanding of what it is about. I hope to understand more as I continue to read more materials.
    I came across an NI-Tutorial  titled Connect LabVIEW to any PLC with Modbus. It is about communicating with a networked PLC using modbus. I followed all the steps described for creating Modbus master I/O Server, Binding shared variables to Modbus Address through the I/O Server and writing to Modbus Addresses in LabVIEW. On running my VI to deploy the shared variable, the following error occured.
    Can anyone please guide me on what to do because I do not know exactly what is going ON. I engaged in this excercise with the hope of getting to understand more about Modbus communication and then see how I can apply thesame idea to communicate with the Modbus device available in my Laboratory. Please note that I do not yet know much about modbus communication and I am just learning about it now. I do not have any PLC connected to the network. Could that be the reason for the error? If anyone has got any other relevant document to help me get started with modbus communication I will be happy to have them posted here.
    Thanks very much for taking time to read through my post message. Hope to hear a quick response from you.
    Regards
    Peter

    Hi SmithD,
    I would like to say thank you very much for making out time to respond to my queries. I have done as directed but still not getting result. Following the wire mode port setting configuration, I stopped the process and then selected the RS485/wire4 as the wire mode. On running the VI, an error pops up with the information that the Visa resource is Valid but the port cannot be accessed. I noticed that If I undeploy the shared bound variable the error does not pop up anymore. I concluded that maybe I was not supposed to have added the VISA configure Serial port in the first place.
    Kindly tell me what to do.
    My task is to read the holding register from a Modbus device. I have the register map with me, and know the TCP and RTU settings for this device. After the attempts I have made so far I was forced to believe that perhaps the device was not responding. I then resolved to using the QModbusMaster which was previously used to read the holding register. For reasons I don’t not know, It worked well with the TCP communication and returned an error that read " slave threw exception > unknown error". With that, I am now sure that the device is functioning properly, at least with the TCP.
    Having obtained result from the TCP using QModbusMaster application, I want to simply do the same using LabVIEW.
    Some few questions for which I would want to ask for clarification are:
    1.)  When using the Modbus Library, do I need to create both master and slave instance to be able to read the holding register? My attempt was to create a Master instance with the RTU parameters. The starting address and number of registers were specified at the input terminals of the Read Holding Register VI. This VI immediately followed the Create Master Instance VI. I was expecting that that would read the information contained in the specified registers and output it at the register value terminal. One challenge with this attempt was that with RTU it didn't work. I tried selecting TCP as the VISA resource. But the device was not showing on the list. I went to MAX to create a new VISA TCP/IP resource under the network devices but MAX could not detect the presence of the device. I am now thinking maybe the device is not supported by NI-VISA and so it will not be possible to use the Modbus Library with it.
    2.) If the device is actually not compatible with NI-VISA, can DSC I/O server be used to read the information on the holding register?
    3.) Do I need an intermediate device between a Modbus device and the PC to be able to read its holding register?
    Please if anybody has got a good suggestion as to what to do to  get my task achieved, kindly leave me a post.
    Thanks
    PETER

  • How can I configure labview for communication with Modbus I/O?

    i read a article about configureing Labview for communication with modbus I/O in NI developer zone, but it was written for Labview 6, how can I configure it with labview 7. it seems there are some difference. Thanks!

    In both LabVIEW 6 and 7, you connect to modbus using Lookout Protocol Drivers (LPD) and then communicate to LPD using the tag engine of LabVIEW DSC or through DataSocket.

  • Modbus Communication, Adding shared variables, Licenses

    Hello,  I am having trouble communicating with a third party DAQ.  I am receiving data from a thermocouple input module through a modbus library address but I recently purchased a digital I/O module which is giving me trouble.  As soon as I add the shared variables which correspond to the modbus addresses of the digital I/O module channels I am using I get a few different errors.  If I turn off aliasing for one of the thermocouple channels I get Error 1550 "the license for the I/O server type is invalid"....If I turn it back on I get errors for every modbus location saying "invalid value for enable aliasing option"  I am using the student edition and on the opening screen it says the data logging license is expired.  Is that the problem?  I don't think so because I am successfully communicating with the thermocouple module of the same DAQ device.  Is there a simple way to write a new VI that I can try to communicate with just a switch on the digital I/O module and see if it is reading on or off (0 or 1).  Thank you very much for your time

    Hi brade, 
    To clarify where we are at. the behavior you are seeing isn't expected. It is a minor bug that we have seen in R&D but haven't been able to reproduce and fix yet. 
    People have gotten around it by
    1) re-making their projects 
    2) Enabling descriptions, as the engineer in other post.  The problem went away for him on this post: "Aliasing is no longer an error.  (As long as NI Variables (task description) is enabled)."
    We were talking about the aliasing tab you can see on the modbus variables in hte labview project by right-clicking and going to properties; 
    I assume he checked the box on this tab: 
    Can you also post your project? 
    Jesse Dennis
    Design Engineer
    Erdos Miller

  • 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

  • Modbus TCP with Beckhoff (Wago)

    Hi,
    I'm looking for examples/how to/lib/dll to build a communication to a Beckhoff BK9000(similar to Wago 750) which have a Ethernet - Modbus TCP Option.
    I'm able to write via LabVIEW-TCP-Functions but only once after powering on and the result/answer is more confusing.
    For the lookout OPC variant i heared there is still some additional software needed - true? or is it possible to set up the communication with lookout OPC without third party driver?
    Thanks for any help
    Hans

    Hi JAMR,
    There are plenty of examples that setup up the tcp server communications. If you open up the NI Example Finder and double click on the Networking Folder (under the Browse tab). You can then select the TCP & UDP folder and find several examples that use TCP. Also, there is a great knowledge-base article that provides information about network communication with TCP/IP messaging protocol. Essentially, what you are going to want to do is establish basic connectivity between the computer and the device and then assign the device an IP address. Before you do anything with the driver for the device, you might try to ping the device first. Once you can get this working, then you can set up the TCP/IP communication. I hope this helps!
    Carla
    National Instruments
    Applications Engineer

  • Automationdirect P3000 Modbus Communication Lookout 6.5 for +/- 10V Output Module

    Here is an iquiry I sent to Automationdirect tech support last week.
    I have not had a response from them yet so I thought I would throw it up here.
    Hello,
    I am starting a new project with the P3K and I am using Lookout 6.5.
    This is my fourth installation with this combination and I have learned a bit more about the Modbus communication each time.
    I use the Modbus serial object in Lookout to communicate via RS-232.
    With my first project, I learned to set the "Modbus Server Settings" in the P3000 software to map to a single 16 bit Modbus register to get the communications working with Lookout and making sense with the analog registers.
    For a 10V input I would linear scale in the PAC 0 to 65535 = 0 to 10000 then in Lookout I simply divide by 1000 to get the decimal in the right place.
    On the most recent project, I discovered I could map/scale my analog inputs to 32 bit foats, select the "map to two consecutive integers" in the P300 software properties and then in Lookout, I could read the register properly with an "F"
    like "modbus1.F400001".
    Now I have a P3-16DA-2, ±10V output module.
    I can't get the float to work and it crashes the communication repetitively.
    It will communicate properly if I stick to 16 bit Modbus register for the "Analog Output, Integer, 32 bit" on the Modbus server settings.
    However, I have the register swap issue reminiscent of the DL205 bi-polar input. It outputs 0 to 10V from 0 to 32767 and -10 to 0 from 32768 to 65535.
    I remember having to add logic in the DL260 PLC and then in Lookout I would use the numerical IF;
    "(nif(DL3.C102,DL3.V2102*-1,DL3.V2102))*-1"
    What a pain that was.
    Is there an easy solution?
    Thanks in advance.
    John B

    Bipolar setups are a pain, it seems your if() is similar to what we did as well.  Added a rung and set a coil...
    Only have a few and have not used the P3000 myself, 
    Forshock - Consult.Develop.Solve.

  • Communicating with cFP 1808

    How can I communicate from a vi running embaded on cFP 2020 to data chanels from cFP 1808 module. I am using LabVIEW and RT module 7.1 ver.

    Hello dksharma,
    This is Dominic L. from Applications Engineering at National Instruments. How would you like to communicate between the cFP-2020 and cFP-1808 module? Two methods of communication can be used: ethernet or serial. I would recommend using ethernet simply because it is faster. Once deciding to use ethernet, you can choose a protocol: OPC, FieldPoint API/driver, or Modbus. I believe Modbus is the fastest protocol. To help you get started you can search the discussion forum for more information on FieldPoint and Modbus.
    The cFP-1808 module requires FieldPoint 4.1.2 or later. If possible, I would work with FieldPoint 5 because that would allow you to use simple FP-read and FP-write VIs rather than making your 1808 a Modbus slave (with older drivers).
    Compact FieldPoint cFP-1808 Quick Start Guide:
    http://www.ni.com/pdf/manuals/374176a.pdf 
    FieldPoint cFP-20xx Quick Start Guide:
    http://digital.ni.com/manuals.nsf/websearch/EEBF19C2575DDE9E86256CFD007E43EA
    FieldPoint Installation/Configuration:
    http://www.ni.com/support/fieldpoint/fpenet.htm
    Please read through these manuals. If you need further assistance I would be happy to assist you.
    I hope this helps.
    Thanks so much and have a great day!
    Best Regards,
    Dominic L.

  • Modbus Communications address offset

    Is there an option available in the Modicon Object to enable an address shift during communication with Modicon Devices.  When communicating with a Modicon Quantum PLC 400010 will return the value from the device in reg 400010 but when communication with a Modicon M340, Premium and others 400010 will return the value in 400009.

    Nothing a little data member export and import cant fix...
    On the standard Koyo (automationdirect) PLCs we have to convert from Octal to decimal, then add 1.  
    For example:
    PLC: V1200
    Decimal: 640
    MODBUS: 40641
    Forshock - Consult.Develop.Solve.

  • Modbus communication Error

    Hi All,
    I'm trying to communicate LabView(DSC) with an LG PLC which is modbus supported. The hardware setup is like, a RS232 cable is connected to PLC and the other end of the cable is connected to a RS232 to USB converter (Because the Laptop doesn't have RS232 port) which is connected to Laptop USB port. I tested the communication with Modscan32 and with another SCADA and were successful. But, when I tried connecting to LabView I'm getting an error, " error code: -1967353900. The Modbus I/O server failed to allocate a serial port." . I restarted the laptop and tried, but that error persists.
    Yes, I have gone through the link given,  http://zone.ni.com/reference/en-XX/help/371618D-01/lvdschelp/dsc_modbus_trbsht/ , but wasn't helpful...
    Please let me know the steps to follow to overcome this error.
    Thanks,
    Randheer

    hi..
    as a quick thought.. please exit the modscan32 before you communicate through LV because the port will be blocked by the modscan instance..
    and also please make sure with the serial port settings like the baud rate, parity etc with the PLC and the Addresses match.
    LV 8.0, 8.6, 2011,2012,2013 WinXP

  • Could VBAI be use as Slave in ModBus communication ?

    hello,
    I'm working with VBAI 2010, in ModBus comunication I need to use VBAI as Slave.
    I saw on help file that it is not possible but in menu "Tools\Communication device\" I can see "Vision Builder AI ModBus Adress :"
    What does it mean ?
    Is there any solution to use VBAI as slave in ModBus communication ?
    Fabrice

    Yes, Vision Builder AI can actually only be used as a Modbus slave for now (users can implement the master functionality using a Run LabVIEW step).
    To configure Vision Builder AI as a Modbus Slave device, select Tools>>Communication Device Manager.
    Click New Device, to create the Modbus Master Device you want Vision Builder AI to communicate with.
    Give it a name, then select either the Modbus Serial or Modbus TCP as the communication protocol depending on the physical layer used to connect to your device. For serial, you will need to specify the port and Modbus Mode (the most widely implemented is RTU).
    Click OK.
    Click the Start Server button, next to the Modbus Server, to start the background task that will listen for incoming Modbus messages. Note that the Modbus registers will be updated asynchronously from your inspection, whenever a Modbus frame is received.
    The Vision Builder AI Modbus Slave Address is only used to identify the device, when the protocol is Serial, and you use the RS-485 protocol to connect together more than 2 Modbus devices in a multi-device configuration. Ignore this control if you are using Modbus TCP.
    We know this dialog is a little confusing and are working towards improving it in future releases.
    Once the server is running, use the Modbus Slave step to read and write the Modbus registers (that are located on the machine running VBAI, since you configured VBAI as a slave device).
    Make sure that you specify the correct address in your Modbus Master device configuration software for the register you want to access in Vision Builder AI. In most Modbus device configuration software, you must enter a name for the register you want to use. Per Modbus convention, the register address of the slave device is calculated by subtracting 1 from the register name that you specify in the master device configuration software. Vision Builder AI expects register addresses, not register names, so you may have to subtract 1 from the address you defined in the Modbus device configuration software. For example, a register name defined as 2 in your Modbus configuration device translates to register address 1 in the Vision Builder AI Holding Registers table.
    Modbus Device
    Holding Register Name = 2
    Vision Builder AI
    Holding Register Address = 1
    The Modbus data model is based on a series of four tables: Discrete Inputs, Coils, Input Registers, and Holding Registers. These tables do not overlap in Vision Builder AI. Some Modbus devices use the following start addresses for these tables.
    0x00000 for the Coils
    0x10000 for the Discrete Inputs
    0x30000 for the Input Registers
    0x40000 for the Holding Registers
    Because the tables do not overlap in Vision Builder AI, ignore the first digit of the start addresses when entering the addresses in Vision Builder AI. For example, a register name defined as 0x40000 in a Modbus configuration device translates to register address 0 in the Vision Builder AI Holding Registers table.
    Modbus Device
    Holding Register Name = 0x40000
    Vision Builder AI
    Holding Register Address = 0
    Sometimes you need to subtract 1 from the register name that you specify in the master device configuration software and ignore the first digit of the start address to ensure proper register addressing. For example, a register name defined as 0x40008 in a Modbus configuration device translates to register address 7 in the Vision Builder AI Holding Registers table.
    Modbus Device
    Holding Register Name = 0x40008
    Vision Builder AI
    Holding Register Address = 7
    The Modbus Local Registers Terminal accessible from the Tools menu is a useful tool to figure out where you're writing data.
    Hope this will help you configure the communication between VBAI and your device easily.
    Best regards,
    -Christophe

Maybe you are looking for