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.

Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I write to A-B PLC through 1761-NET-DNI?

Thanks, Emilie, for your previous response.  I guessed that was the case, but as I'm new to DeviceNet, I was unsure.
 
I am still having problems communicating with the Allen-Bradley PLC, and am not sure whether the problem is with my LabVIEW code or configuring my DNI.  I have attached a sample of the program I'm using to send a message to my PLC.  Do I have the correct idea regarding how to send messages to the DNI network through my NI-DNET card?  I set up the DNI so that the I/O page is in the Bit register file, and have programmed the PLC to turn an output light on if a certain bit in that section of the register file is logic-1.  I use my LabVIEW program to send a message to that bit, but the light does not go on.  Are there any obvious problems with my LabVIEW code?  Thanks.
 
Mark Leusink
0 Kudos
Message 1 of 3
(4,168 Views)
0 Kudos
Message 2 of 3
(4,167 Views)
Hi Mark,

I took a look at your code, and for the most part, it looks very good.  There are only two things that I can see that may be causing some issues.  The first and most obvious is that you are not using your error inputs and outputs at all.  If you take a look at any example program, the pink error cluster is wired through all the VIs.  This is always good practice, because the error message returned from these VIs usually can point us in the right direction of getting the error solved.  If you do not wire this through, the error may be lost completely.  There may even be an error message occurring in this program that we are not seeing that could help us figure out why your device is not responding.

The other point of interest that I saw was in the inputs to the Convert for DeviceNet Write.vi.  The DNetDataIn input is left blank, which is fine, except that you also have a byte offset of 1 as an input.  DNet Data is in an array format, and this VI will take other data and convert it into DNet data, placing it in the data array wherever you specify in the byte offset.  Since you have nothing wired into the DNetDataIn, then it starts with an array of all 0's.  The byte offset is 1, so it skips over the first byte (at index 0) and then places your data starting at byte index 1.  This may be the way your device is expecting the data, but if you want that data to be at the front of the data array, then you need to wire a 0 into the byte offset.  Otherwise, the data being sent out starts with 0's.

Hope this helps!

john m
Applications Engineer
0 Kudos
Message 3 of 3
(4,159 Views)