Modbus controls

Hi guys, I'm fairly new to Modbus and I'm having an issue with turning a device off an on over a modbus tcp connection over ethernet. This is a very simple code, so I'm not sure where the problem is or why it is behaving the way that it is behaving. I wrote a similar program to read the values from a nearby address and it is working perfectly. The "0" address is the control word address. 1150 is the stop/get ready command, while 1151 is the start command. Upon executing the code once, the vfd's start up just as they should and they are set to the appropriate hertz value, as they should. However, after changing the hz value and running the code once more, the vfd's turn off. Then, if i run the code again, they will turn back on and change to the hertz that I have set. In other words, on every odd run of the code, they are on and functioning, while on every even execution of the code, they will turn off. I understand that the issue is probably with the 1150 and 1151 write commands, but I can't wrap my mind around why this is. Any help at all would be greatly appreciated. Thank you! 
Attachments:
multiple write not working.vi ‏29 KB

BoKnows wrote:
If I'm understanding your original post correctly, everything executes as you expect if you only try to work with one vfd.  Is that correct?
If so, have you tried testing with each of the vfd's individually to make sure they're all responding?  If all four pass, I'd have a hard time suggesting the device is the issue.  That would show each device responds to the commands.  It would also show the modbus library is performing as expected.
The next piece would be to debug the code to determine why we are seeing the odd/even behavior we are now.
Since yesterday, I have tried controlling all four vfd's and all four are functional. I was able to split up the labview code into two different true/false cases which is essentially just an on/off switch between the 1150 and 1151 commands and everything works perfectly. However, my problem now is that I need to be reading the speed from one address constantly and then writing the speed to a different address whenever I choose to. In order to do this, I would need to be able to run it in a while loop, but I think that this causes a problem. I'm not sure if modbus reading and writing has a problem with being run continuously since I am very new to it, but I can't imagine that it wouldn't be able to do this. I will post my code so you can see what I'm talking about. Anyways, my read code works flawlessly on its own. When I try to run my write code, however, they both work fine for a few seconds, maybe up to ten at the very most. After this, I get a labview error code 60 that says
"Error 60 occured at TCP Open Connection in TCP Master.lvclass:Initialize Master.vi->Modbus Master.lvclass:Initialize.vi->API Main.lvlib:Create TCP Master.vi->true false write.vi
Possible reason(s):
Labview: The specified port or network address is currently in use. Select an available port or network address."
Now, I figured that this would maybe be due to running two different labview codes at the same time which were trying to access the same device at the same time via ethernet, so I only ran my write code without having the read code running and I got the exact same problem, so I know that the problem lies in the write code. I am completely stuck and don't really know what to do, so any help from anybody would be greatly appreciated.

Similar Messages

  • Controlling hardware automatically via modbus control

    Hey guys, Im in a bit of a bind. Im looking to switch in my power supply via modbus control. I am using an ADAM-4068, so for instance if i switch the first relay the dc power supply will be on with a voltage level of say 230V, il the second relay switches i want to switch off the dc power and switch in ac power. The ADAM-4068 has 8 relays where i want each relay to control  a piece of hardware. The voltage level is controlled by parameters in the database. I am using the modbus vi library serial master query write multiple coils, But my question is(i am quite new to labview) how can i automatically control the modbus to switch the particular coils to switch in the power supplies. I am lso looking to use the ADAM for communication to a PLC.
    Please any advice helpful.
    Damien

    I would start with Chapter 4 in the manual and use NI-MAX to see if you can send commands/receive responses from there succsessfully.  Learn also how to do basic serial port communications in LabVIEW.  Lots of good stuff in this forum as well as in the LabVIEW examples.  Then you should be good to go. 
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Question: What makes of projectors can be connected to MacBook

    Question: What makes of projectors can be connected to MacBook, also what kind of cable do I need?

    Hi,
    Modbus is restricted to addressing 247 devices on one data link, which limits the number of field devices that may be connected to a master station.
    However, if you want to increase the number of slaves, you may use MODBUS/TCP.
    Here is a link that might help you:
    http://modbus.control.com/thread/1026247380.
    The Schneider electric 174CEV30010 Modbus to Ethernet bridge is capable of addressing Modbus slaves from 1 to 247.
    The actual number of devices which can be physically connected depends on the medium used and not on the fact it is Modbus.
    Some examples:
    RS232 is a 2 device point to point connection when using copper, however when using fiber (or other modems) it is possible to connect up to the maximum of 247 devices.
    RS485 is multi-drop and supports 32 devices on a single network. When a repeater is used, on copper wire, the number of devices can usually be increased to 64.
    Hope this helps.
    Regards,
    Rohan Sood
    Applications Engineer
    National Instruments

  • GE FANUC PROTOCOL PLC ADDRESS

    I have a CMM with dual ports, acting on RS-232, I am unable to complete the project as i cannot get the correct communications to go. I have setup one port as SNP, correct speeds and settings, in lookout as well, but when it comes to the PLC address do i use the CPUs SNP ID? or the port id?
    Second reference, the next thing to try is the ModBus control, the GE uses RTU, how would i correctly connect to the ge with the modbus control from lookout?
    Mike Crabtree - Lead Developer
    Destek of Nevada, Inc. / Digital Telemetry Systems, Inc.
    (866) 964-6948 / (760) 247-9512

    The lookout GE_Series90 object only supports SNPX (via serial), and is pretty specific about selecting either a 90-30 or 90-70 series. I'm not familiar with a CMM, but it may not communicate with the GE object in lookout. But if it does, the PLC address would be the SNP address configured for the port you are connected to on the PLC (each port can have a different address).
    As for using Modbus RTU protocol, that should work great in place of the SNP protocol (works quite well for me). Here is a link that will help with the difference in register numbering.
    http://www.gefanuc.com/support/plc/faq00005.htm
    You will notice that not all registers are accessible using the RTU Protocol (%M is one example), but you do get the additional diagnostic tools to moni
    tor communication with the Modbus object.

  • Repeat frames

    I've been working with the same footage now for a while and I've discovered that when I have a text layer (and some times when I dont), there are repeat frames... The video will stutter back 3 frames and then continue. the audio and video link is not noticably affected...
    I'm working with a sequence of Apple Intermediate codec--- formerly HDV video... I'll explain more, but somehow I dont think thats the issue...
    please help!
    Mac G5   Mac OS X (10.4.8)   FCP 5.4.1

    At first my code was very robust. After each week I would get  new requirents. Addind new tests or asking to make major changes. I am current using frames to set up test enviroments and then executing the tests. This is a very frustrating experience for any programmer but very common. I have the the frames passing the test step. pressures PID control and modbus control. It has become a  very "kludging" software program. I do not like the VI at all.
    I wrote two other programs using a 2d Array that is very robust. With the 2D array I can read the idex of an array and repeat that test by changing the index by -1. This seems to be the logical way to reat a test, continue or fail.
    Thanks
    Philip

  • 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

  • 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

  • I am using the MODBUS library and can't receive data, however I can send it just fine?

    Hi,
    I am using the Modbus Library to communicate with a VFD to control a fan. I am using the master write and read vi. I can write data to the VFD and get the fan to do what I want. The VFD is supposed to send a confirmation packet after I tell it to do something and I can also read its registers. When I debug the VI it shows the problem is the buffer always reads zero and the VI timesout. If I watch the lights of the USB to RS 485 adapter I am using to interface with the VFD, I see that the RX light flashs right after I send a message. So I should have something in the buffer. Does anyone have any suggestions?
    Aaron
    Solved!
    Go to Solution.

    Ok, heres what happened for anyone who has this problem. In the MB Serial Receive.vi The Bytes at Port property node was reading 0 even though there was something in the buffer. The program execution was then stuck in a loop till it timed out and never went on to read anything from the serial port buffer. I didn't spend too much time wondering why that VI didn't work and created my own. With an appropriate delay after writing to the serial port,  I used the same Bytes at Port property node and was able to get the right number of bytes to then feed the read VISA vi the number of bytes to read. I got the right response message and everything seemed good. But of course NOT! I then experimented with writing different speeds to the VFD to get the fan to run at different speeds. I found a small range of speeds where I would get no response from the VFD, either by it functioning or sending me a response packet. After quite some time, I found there is an error in the LRC-8 code in the MODBUS NI library. It does not mandate the LRC be a two character value. So if your LRC turns out to be a single character value such as F (which should be 0F)  you get an incomplete MODBUS message. This was easily fixed in the LRC8 vi by telling the 'number to hexidecimal string' vi to produce an output with a minimum width of two. Then everything worked great. Moral of the story is the MODBUS library is clunky.

  • Passing values to sub VI and writing data to controls

    As part of a control interface for a VFD i am interfacing with using Modbus TCP I wanted to try and compartmentalise some of my code into a subVi
    However in doing so I am having a lot of trouble understanding how I can read the current drive settings for the Ramp up and Down values and update those values into the main faceplate of my control.
    The sub Vi is tested and works exactly how I want. Selecting Read (latch on pressed) reads the registers from the drive and outputs it to the controls and the indicators. The indicators were incorporated because I did not know how to pass the data out of the sub vi without them. Updating works to write the current value in the controls to the VFD registers.
    However when I incorporate this VI into my larger project the values are always displayed as zeros if I have the switch set to latch. However i do see a momentary flash of the correct values soon after pressing the read button or if i change it from latched operation to switched, however i would prefer it to opperate in a latched mode so as to reduce communication overheads to the drive. 
    Solved!
    Go to Solution.
    Attachments:
    Modbus sub vi.pdf ‏943 KB

    Hi,
    A number of suggestions:
    1. Use references and property nodes to set FP indicators from a subVI (you can learn more here and here)
    2. Don't put output indicators inside Cases. When the case is not Read, the VI outputs default values to the outputs and gives you the zero values. 
    Good luck,
    Danielle
    "Wisdom comes from experience. Experience is often a result of lack of wisdom.”
    ― Terry Pratchett

  • How do I use NI-Motion tools to directly control a P70360?

    I can currently control a P70360 via modbus commands. I am interested in using NI-Motion routines to do this, if possible. But all the examples and VIs seem to assume there is an intermediary controller card, between the AC Drive and my labview app. I don't need a controller card, I have labview... so, does NI-Motion support direct communication with a P70360?

    Well, never mind. I spoke with NI this morning, and NI-Motion only supports calls to their 73x0 motion controler cards. Silly me for thinking there might have been a ModBus instrument driver deleveloped for the P70360. I'll get back to Dannaher (manufacturer of the AC Drive), and work to tweak my ModBus routines. The problem we're having is it gets out of synch, without sending an error due to stall detection.

  • Binded variables change value of modbus PLC variable when application starts

    Hello,
    I have a front panel with controls binded to some shared variables that use a modbus server to control a PLC. There is no logic behind that front panel, all I want to do is to be able to read/write some variables on the PLC.
    I binded the control with datasocket. The reason I did not use PSP is that I would like to bind the controls programmatically so if the client change the server (that holds the library and the citadel BD) the only thing he would have to do is to change the name of the server in the configuration file. It's seems that there is a bug in the Data Bindingath Property and it always return me an error when I try to bind dynamically (Which is not the case with the DataSocket:URL Property) .
    Now the PROBLEM: 
    Lets say a certains variable on the PLC holds the value 10. When I open my panel, I can see that value (10) a very short moment (milliseconds) and the value shifts to '0'. That undesirable '0' is indded written on the shared variable on the server and on the PLC. After that I can change the same value back and everything works properly. Its seems to me that the problem occurs only at the first connection. Same thing apend with booleans controls.
    I would like to be able to open my application, see the '10' in my control, update it if I want, close the application and get the last value when I re-open it.
    I'm running an executable with the DSC run-time.
    Thanks in advance for your help!
    Vincent

    Hello Vincent,
    This was reported to R&D (#161821) for further investigation.  I noticed that this only happens for controls in subVIs.  Perhaps you could restructure your program so that it no longer needs to view the front panel of its subVIs.  I will let you know if I find any other workarounds.  Thanks for the feedback!
    Regards,
    Burt S

  • Floating point number using Modbus RTU DSC LV 8.2

    I'm reading temperature from a Modbus conrolled device. I need to convert a temperature value (17053) read as a double type Shared Variable (SV) and convert it to ieee 754 type to show temp of 79 deg F as shown on the control front panel.
    I'm using DSC module LV 8.2. I'm wondering if the conversion is already done in DSC LV 8.5???

    seem to find my own answers after putting the post....
    I use a typecast to single but I had to change the double to 16 bit integer for the type cast to convert correctly.... see attached png
    Attachments:
    ModbusSVFloat.PNG ‏28 KB

  • Polling variables using Modbus IP and labview 8.2.0 shared variables

    I'm using shared variable in order to read/write register on a Watlow PM controller over Modbus IP standard. Once I make a change to FP control, the shared variable polling starts and I no longer get update of any controls or indicators on the FP.
    Just wondering if this is an LV 8.2.0 issue and if any of this is addressed in LV 8.5?
    Thx ahead of time
    richjoh

    Hi richjoh,
    If I understand correctly, there are two issues to address: the status of the UpdateNow shared variable and the fact that your controls and indicators are not updating. 
    When you right-click on UpdateNow in your project and select Properties, what is the data type listed there?  Is it bound to one of the other shared variables that has a value in Variable Manager?
    After changing a control on the front panel, do you continue to see the values changing in Variable Manager even though the controls and indicators do not update on the front panel?  Do you see the same behavior regardless of which control you change? 
    Thanks for the additional information. 
    Jennifer R.
    National Instruments
    Applications Engineer

  • 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

  • Problems with Modbus OMNI driver

    Lookout version 5.1 (build 8)
    I am using the Modbus OMNI driver to communicate with 6 OMNI 6000 flow computers at 56K (Hardwired) with a poll rate of every 20 seconds, receive gap 270 bytes and a failure of 1000mS.
    The problem I have is that when scanning the OMNI, not only are they slow to respond hence the long delays between scans, but I am also finding that the OMNI data for handling digital outputs is being corrupted causing?? them to fire faster than the period I have set in the OMNI. i.e. if I set a pulse output to occur when 1m3 of fluid has past I should get one pulse from the digital output. What is happening is that the outputs slowly start firing much quicker than this until we lose control of the signal and have to reconfigure the flow computer.
    Is there a possibility that Lookout is corrupting some of the memory areas within the OMNI and causing this.
    I see from other users that they are having problem with slow responses from this driver.
    Any advice you have on this matter would be useful
    Derek

    Lookout version 5.1 (build 8)
    I am using the Modbus OMNI driver to communicate with 6 OMNI 6000 flow computers at 56K (Hardwired) with a poll rate of every 20 seconds, receive gap 270 bytes and a failure of 1000mS.
    The problem I have is that when scanning the OMNI, not only are they slow to respond hence the long delays between scans, but I am also finding that the OMNI data for handling digital outputs is being corrupted causing?? them to fire faster than the period I have set in the OMNI. i.e. if I set a pulse output to occur when 1m3 of fluid has past I should get one pulse from the digital output. What is happening is that the outputs slowly start firing much quicker than this until we lose control of the signal and have to reconfigure the flow computer.
    Is there a possibility that Lookout is corrupting some of the memory areas within the OMNI and causing this.
    I see from other users that they are having problem with slow responses from this driver.
    Any advice you have on this matter would be useful
    Derek

Maybe you are looking for

  • T43 Hard Drive Upgrade Woes...

    I recently purchased a Fujitsu MHV2120AT 120GB HDD to replace the Toshiba 40GB HDD in my T43. From the looks of things, this drive should be supported with a firmware update, avoiding the dreaded 2010 error at startup. "MHV2xxxAT" is listed as "suppo

  • Managing File Sharing via WGM

    I can't see a way to do this, but I thought I might as well ask... Is it possible to manage Sharing preferences from WGM? I want to ensure that users cannot turn on personal file sharing, but they have a need to be able to access the preference pane

  • Inserting into MS Access Database - Wierd resultset!!

    I'm developing an application that takes in values from t1 in the database, performs operations on them and inserts them into t2. For this I have to check all records in t2 every time I'm about to make an insertion.. Strangely enough, rs1.beforeFirst

  • Library iPhoto to Aperture

    Hi, I have now imported my iphoto Library to Aperture, to save space and speed is it recommended that I delete the library in iphoto? Thanks

  • Pixel bender -- plug in

    Hi ! I am using photoshop CS4 with an Apple computer OSX 10.8.2 ........ I downloaded a free " plug in " ......which is .... pixel bender.... I need instructions and help to install it Many thanks