From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Industrial Communications

cancel
Showing results for 
Search instead for 
Did you mean: 

I can perform a tag read, but not a tag write

Solved!
Go to solution

Hi there,

 

I'm fairly new to Labview.  I recently purchased the EthernetIP library for Labview 2014 and am trying to establish back and forth communication with a Contrologix 5561 with an ENBT ethernet module.  I've done some barebones programs so far, namely, a few Tag Read blocks to read in bools, ints, dints, and reals.  That works just fine.  I change the tag on the plc side, and the change reflects at my Labview VI.  I'm now on the tag writing portion and am not having the same success.  My current VI just consists of one EthernetIP write tag (INT), the ip address (as well as backplane and slot position) for the network path, an existing tag name, and a constant (tried a control earlier) at the data port.  It's pretty much an identical setup to my tag reads, except I have an input instead of an output.  

 

I realize I'm doing nothing to establish a proper connection, but since tag reads were working well enough, I haven't focused on that.  Perhaps I'm lacking there.  

 

Anyone have any advice on what I can do to rectify this problem?  

 

Thanks,

 Nick 

0 Kudos
Message 1 of 3
(4,945 Views)
Solution
Accepted by topic author Nick1978

Hi Nick,

 

Welcome to the forums and congratulations on being a new LabVIEW user!

 

I've checked the attached vi. And I found the data you provided to the Tag Write.vi needs to be rectified. The data is 1D array of U16; you only specified the index of the element which is 12 and you did not enter any value of it. You can see the value feild is still grey which mean you haven't provided any value you want to write to PLC. So I expect you will not see any value at PLC side.

 

It is also recommended you put such read/write function within a loop that it will be done continuously at a reading or writing rate.

Actually all National Instruments products come with example VIs to help customer's get started with their applications needs. If you open LabVIEW, you can go into the Help » Find Examples.  This will open up the NI Example Finder.  Here you will be able to find examples on many best practices with NI LabVIEW as well as our hardware. In NI Example Finder, open Hardware Input and Output »NI-Industrial Communications »EtherNet/IP »EtherNetIP Adapter.lvproj. You can refer to Write And Read Tag.vi for the function you need.

 

Hope this helps you out! 

 

Wendy

Message 2 of 3
(4,896 Views)

Hi Wendy,

 

You hit the nail on the head.  I was only editing the array size.  Ints, Dints, Bools, and Reals all work fine.  Thank you!

0 Kudos
Message 3 of 3
(4,879 Views)