LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I tell if a network is busy?

I have a program that connects to a PLC via modbus through an ethernet connection.  I am trying to read multiple coils(bits) and I get an Error 57, Network Connection is Busy.  Is there a way to prevent this error, such as checking if the network is busy before trying to read.  Thanks for your time.
Ron Deavers, CLD
0 Kudos
Message 1 of 5
(3,301 Views)
0 Kudos
Message 2 of 5
(3,263 Views)
A modbus port should allow many devices to read data from the port at any time. I think it has four Data Slave paths that can be active at a time. Are you using a serial port from the ethernet device to the plc or MODBUS/TCP?? Are you using labview to issue the modbus commands from the block diagram?? If so, you need to close the session when the vi stops or it will hang the port until you exit labview. If someone is logged into the port for programming, it could prevent reading from the plc. If they unplugged the cable from the plc, while programming, it could hang the plc port. What is your ethernet device??
0 Kudos
Message 3 of 5
(3,261 Views)

It's actually a quadruple post but the first to get any responses. There is some useful information from the author here.

<snip>
"I have a labVIEW program that is connected to a PLC through modbus. The PLC that I am using is an AutomationDirect 205 with a 250-1 CPU. The maximum wait time for any input to the PLC is very short. So when the wait time is up, the PLC closes the connection. I am trying to maintain this connection by sending the PLC an arbitrary bit.
My program was working until I put this bit in. Now when it reaches the point to send that bit, I get this error - Error 57 occurred at TCP Read in MB Ethernet Receive.vi->MB Ethernet Master Query.vi->WebbTest.vi"
<snip>

 Dragon,

1. What are you using to communicate using Modbus? (your own LabVIEW/Modbus program? one of the several LabVIEW/Modbus libraries out there? LabVIEW DSC module? A third-party OPC server and Datasocket?)

2. Is this a pt-pt connection (PC to DL205) or a network?

3. Since you've mentioned Ethernet, it's known that you aren't connecting to either of the ports on the DL250 CPU itself. What Ethernet card are you using at the PLC? an H2-ECOM or something else?

4. Although I have DL205's, I've never used Ethernet with them … and I'm confused about:
"So when the wait time is up, the PLC closes the connection. I am trying to maintain this connection by sending the PLC an arbitrary bit. My program was working until I put this bit in. …"
Was the connection being dropped and then the PLC didn't respond to further polls??  It's not quite clear to me what this problematic bit's purpose was.

=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 4 of 5
(3,244 Views)

Thanks for the reply unclebump and Donald.

1.  I am using a LabVIEW program that I created but I am also using the modbus vi's created by NI inside this program.

2.  It is a pt-pt connection over ethernet.

3.  I am using an H2-ECOM100 since the H2-ECOM does not communicate using modbus.

4.  My connection would drop if there was not any activity within a certain period of time.  When I attempted to create activity again, I recieved an error stating that the connection was closed by the peer.  The bit that I was trying to send was just my way of trying to create activity for the connection to close.  I deleted this bit and now use a read bit that reads every loop iteration.

I do believe I solved my problem though because I had multiple read bits.  They were trying to access the PLC at the same time.  I used a sequence structure to sequence these bits and now I do not have this error.  Thank you though for your input.

Ron Deavers, CLD
0 Kudos
Message 5 of 5
(3,234 Views)