LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Connection Lost and Timeout

 

actually can you tell me if there is any diode on the coil of the relays, if not put some (

referring on that paragraph.

also the twisted pair shilded is very good and I agree with the last post, resistor and rs485 converter may not have tha same components than the previous you where using.

  

4- There are some powerful relays near slave nodes. When I test the program with relays disconnected, EVERYTHING IS OK, but when the relays are powered up to perform the final test, I get either of the aforementioned errors after several switchings of relays. It may seem that some EMC considerations has brought up this problem, but the hardware setting is the last thing to tackle.

0 Kudos
Message 11 of 31
(2,883 Views)

some advises : do not run with thoses powerfull relays(or motors)because  the noise or peek in current can cause 

damages to IC's like comm drivers..... 

0 Kudos
Message 12 of 31
(2,882 Views)

gsussman wrote:

One thing that has not been mentioned is both the terminating resistors and bus biasing resistors.

 

RS-485 in an electrically noisy environment should have these in place to ensure that you get enough current flow to get clean communication. Without the resistors your comm bus is more susceptible to electrical interference.

 

Here is a good reference for setting up RS-485 busses (http://www.bb-elec.com/bb-elec/literature/tech/485appnote.pdf)

 

Also, just because the previous microcrontroller worked in this application instance does not mean that your current controller has exactally the same electrical specs and will work. If you were on the fringe edge of the operating envelope a different transeiver may not operate quite as well.

 

As a minimum, I would implement the terminating resistors. For most applications they are all that is needed unless you are communicating over long distances. 


 

Yes the termination resistors is a very good suggestion and goes hand-in-hand with checking the quaility fo the cable.

 

RS-485 uses differential transmision line to avoid the issues of a noisy enviroment. THe resistors help to ensure the signals are transimitted correctly but do check the ground. If the gorund is bad the signals could drift outside the CMR range of the trancievers.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 13 of 31
(2,878 Views)

Thank you all. I have just downloaded the rs485appnote.pdf.

 

I will try NI spy, check the quality of ground, and see if I can add terminating resistors, but I can not avoid using relays! because this is not a green-field project.

 

I will ask the electrician guy, if they'd used doides with relays. I am not sure now.

 

 

0 Kudos
Message 14 of 31
(2,876 Views)

you can replace the relay(based on your application specifications)

by some solid state relay(opto isolated)

http://solid-state-relay.crouzet-usa.com/kb/ssr_kb_transient.shtml 

0 Kudos
Message 15 of 31
(2,867 Views)

Ben wrote:

 

"Since you are running 2-wire mode and the issue is in transmision, it sounds like your rs-485 adapter is haveing trouble acquiring control of the bus." I changed my program so that the master never sends any command to slaves which make them to answer. In this way, the slaves are just listening and never take control of the bus. Therefore, it is expected that there won't be any problem for the master acquiring control of the bus, but the "Write Timeout" error still happens.

 

I also tried NI spy. It showed that the problem is exactly at the "VISA write" function and "VISA read" is doing well. No news! but it was interesting to see that when NISpy was used, the write timeout error even ocurred much sooner. I guess NIspy slows down visa actions. (NISpy version was 2.6, included in VISA 4.4.1).

 

Actually, I believe that talking about timeout error makes sense when reading the port, but I can not understand what it really means: WRITE TIMEOUT! (specially in this case, when the master always has the control of the bus). Can anyone kindly explain it to me?

 

Regarding the ground quality: The slaves are opto-isolated powered. they use 24VDC. this voltage is provided by a +12VDC and -12VDC with regard to a power supply ground. This ground is not connected to slaves. Therefore, I think that the ground of RS485 is defined by the ground of the master node, which is RS485/USB adapter and it is only connected to the main computer, not any equipments in the field. Ben! Is it enough? or shall I do more investigations about grounding?

 

Regarding Terminating Resistors, as is mentioned in the Application note (introduced by gsussman), there are some Pros and Cons for using them and the length of the cable network is an important parameter. The length of this network is between 10 and 15m from the last node to the first one and all three slaves are in a same panel. Therefore I think the idea of using terminating resistors should be reexamined. Do you agree? If it is still the a good solution, how shall I do it? The application note says not to install them on the nodes and put them in them ends of the line. One end of the line is master node and the other end is one of the slaves. It may seem a rudimentary question, but I do not know where to insert them.

 

and finally, regarding relays, there is no way to change hardware settings at this moment. The available alternatives are very expensive for such a project.

 

Thank you for your support and contribution.

0 Kudos
Message 16 of 31
(2,836 Views)

With a potential of 15m between the master and slave nodes I would absoloutely use the terminating resistors. As a guideline, anytime I am going over a couple of meters (~2) or if I am working around any large electrical fields I put the terminating resistors in.

 

As far as where to put them, while the app note does recomend that you put them at the end of the cable (beyond the last node), in my experience, unless you are going a really long distance putting the resistor on the last node is usually sufficent.

 

One queston regarding your problem with the VISA Write operations. Does the Write operation that fails always perform some action on the relays in queston, or is the previous operation a relay state change operation? Possibly the Write timeout issue is more of a coincedence based on how your program is commanding the relays than a problem with the actual communication protocol.

 

If you suspend the operation of the relays and just send a bunch of benign commands (NoOp or status querries) to the slave devices, do you still see the timeout problems? 

Greg Sussman
Sr Business Manager A/D/G BU
0 Kudos
Message 17 of 31
(2,831 Views)

Soroush wrote:

Ben wrote:

 

...

Regarding the ground quality: The slaves are opto-isolated powered. they use 24VDC. this voltage is provided by a +12VDC and -12VDC with regard to a power supply ground. This ground is not connected to slaves. Therefore, I think that the ground of RS485 is defined by the ground of the master node, which is RS485/USB adapter and it is only connected to the main computer, not any equipments in the field. Ben! Is it enough? or shall I do more investigations about grounding?

 

...


I think not.

 

I saw an isue with a Tower PC being able to talk fine to a widget but it would flat-out fail from a laptop. Bottom line, the Tower found a ground through another path but the laptop was issolated.

 

I still feel you should investigate the hardware specs for both interafces (the old and the new) to check on the termination.

 

If I was there with you I'd be mumbling "check the ground"

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 18 of 31
(2,826 Views)

Then I will try the resistors right on the last node.

 

The relays drive 14 DC motors, that are used for position control in a PWM manner. The frequency of the PWM is less than 1Hz, but the minimum pulse duration should be minimized to achieve the highest possible accuracy. (Please note that I am not involved in deciding this method for position control) Therefore there are very short pulses sent to the relays.

 

I've placed a 50ms delay between writing two strings. The first strings actuates some relays and respective motors that need position modification. the second string deactuates them. Moreover, each string is written byte-by-byte. because I have a 9-bit framing at slave sides. the ninth bit defines whether the byte contains DATA or COMMAND. I have to change parity settings when facing a command byte after a data byte and vice versa.

 

It may be interesting that the first byte of each string is always a command and the second one is data. and I always face write timeout at the second byte of each string. (I am not completely sure, but when I used NISpy today, I detected such a pattern.) Thanks for making this point come to my mind!

0 Kudos
Message 19 of 31
(2,824 Views)

Ben,

 

I WILL. I PROMISE.

 

Actually, I did something with an O-scope. Frankly, I am not sure if what I was doing was checking the ground!

 

Shall I try to catch an impulse when the relays are being switched? If you mean transient behavior, could you kindly give me more details on how to check the transient signals of the ground? but if it is important to look for steady voltage differences, I did something and the result is as below:

 

There is no voltage difference higher than 100mv between the ground of power supply of slaves and the ground of RS485 network when the old system is in use. but when involving the new system, I see a sine voltage that is about 25V peek-to-peek with no DC value and freq. of 50 Hz (equal to the regular AC freq. here).

 

What does it mean? 

 

PS: the old system is a tower PC like new system, but it supports ISA slot. The old master is an ISA board equipped with micro 8051.

 

 

 

 

 

 

 

 

Message Edited by Soroush on 09-10-2008 01:58 PM
0 Kudos
Message 20 of 31
(2,818 Views)