LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timeout errors with Modbus serial master query.

No. Let me explain you the situation. Look at the picture attached. One of this device needs a proprietary software to setting. But this software was able to detect all device which speak in modbus RTU, too. If all devices were detected I have concluded that the conections are ok, right? Except to the flowmeter, the other devices have the same parameters to setting (address number, baud, parity and stop bit). This flowmeter works with another parameter called bit order. We achieve to change data all device, except the flowmeter (error 6101 timeout). It seems that the flowmeter doesn't understand the master message and so return the timeout error. I suppose that if the slave does not understand the message it modbus telegram is different, Am I right? Any idea to solve this problem?
 

Answering your questions:

1 - The proprietary software works.

2 - If the proprietary software detect all devices so the wiring is ok.

3 - We are using RS-232 to 485 converters

4 - The RS-485 works in 2 wire.

David Fiorillo
0 Kudos
Message 11 of 25
(3,669 Views)

I'm sorry, but I'm still not 100% clear.  Are you saying the proprietary software does or does not work with the flowmeter?

 

I agree that it seems your wiring and converters are all okay since the other devices are working.  So it would come down to the communication settings or protocol with that one device.  Yes, if there is a problem with the message structure, the flowmeter won't return a message and you would get a timeout error.  I assume that the bit order parameter you are talking about is a setting to determine whether the device is big-endian or little-endian (which is actually byte order, not bit order).  Modbus standard is big-endian.  Try changing the settings to see if any of them start working.

 

I would also recommend starting smaller.  Try to get it working just reading a single parameter.  Double check the address, baud rate, parity and stop bit again on that device.  Double check the wiring.  Perhaps on that one device you have the polarity of the two wires reversed.  (Actually, I would check this first since it is probably the easiest to check.)

 

If I may make a few comments about the VI's you posted earlier.

1.  Clean up wiring so that the flow of the wires is left to right.

2.  Try to eliminate the stacked sequence structures.  If a sequence is necessary, the flat sequence is better as it doesn't hide code and will allow the wires to flow left to right.  (By necessity, a stacked sequence forces some wires to go the other way.)

3.  You are using a huge amount of global variables for communication.  I was clicking "Ignore VI" for quite a while when I was trying to load your VI since those globals weren't included.  I would recommend storing all of those values in an array, then you can use the index array function to get the value out for particular variable.  I would also recommend looking up action engines as the means of transferring the data from the reading VI to others.

4.  Converting the array of registers to a cluster which you then unbundle is an extra step.  It would be better to use the index from array function which can be resized downward to get multiple array elements from a single icon.  If you start at 0 and all of your array elements are sequential (as it seems to be with your unbundle cluster function) you won't need to feed any constants into that expanded Index Array function.

5.  In that repeated code, you are taking the integer value converting it to a hexadecimal string, then converting the hexadecimal string to a decimal number.  I don't see any way that conversion would work.  For example, if the result is 1234, it would be converted to the string 04D2.  Converting that to a decimal number the result is 4.

6.  Don't use the True constant wired to the loop's continue terminal.  Set up a boolean button wired to a loop stop terminal so that the user can stop the program nicely.  With the way you have it, the only way they can stop the program is by hitting the Abort VI button.

Message Edited by Ravens Fan on 09-06-2008 09:30 PM
Message 12 of 25
(3,656 Views)
I spoke about this proprietary software to show you that I achieved just to make a "ping" in the device. Only this. The flowmeter doesn't have proprietary software. This proprietary software is the another device but it was used in the same net. The most interesting is that it (proprietary software) just have detected all the device in the net, until de flowmeter. Well, after that I thought that my problems have been solved. But it haven't been. The flowmeter is the only device which I haven't achieved to access it registers.Summarizing:1 - I have used a proprietary software to find all the devices in my net. And it found it (ie, all the devices were found)2 - I set the modbus code, in labview, to access the registers of each the devices.3 - The only device that appeared the message error (6101 timeout) was the flowmeter.Do you understand my case?
David Fiorillo
0 Kudos
Message 13 of 25
(3,630 Views)

I believe I understand a little better your situtation.  Definitely try to use the Modbus libraries with the device only trying to access one of the registers at a time.  I'm wondering if there could be an internal limit in the flowmeter that restricts how many registers you can read at once in multiple register read.  You may even want to temporarily disconnect the other devices from the RS-485 network.

 

You may also want to snoop in on the conversation between the other proprietary software and this device.  I have not used it yet, but others on this forum have talked about a program called Portmon.  If you can capture the data stream back and forth between the software and the flowmeter while the software is discovering the device (and having the other good devices disconnected from the RS-485 serial lines will cut down on extra data traffic), you may be able to see something interesting.

Message 14 of 25
(3,628 Views)

Ravens,

 

I have already made this. I isolated the flowmeter from the others and tried to access one of the registers at a time. But the same message error appeared again. How could I make sure that the modbus telegram exchanged between the master (labview) e slave (flowmeter) are compatible?

 

I will try monitoring the flow of data with the Portmon.

 

Thank you. 

David Fiorillo
0 Kudos
Message 15 of 25
(3,623 Views)

Reavens,

 

I have solved the problem. The Coriolis Promass 83 flowmeter has been working with 2 stop bits. I have just changed the bits from stop bit and worked. The master (labview with the computer) had sent a wrong modbus telegram. So, the error has been created (timeout 6101). The picture shows the place in Init.vi which needs to change.

 

Thanks,

 

David

David Fiorillo
0 Kudos
Message 16 of 25
(3,553 Views)

I'm glad you found it.

 

I have never used that serial init VI before.  I think anytime I am doing serial, I am using the VISA functions to set those parameters.  They really should have turned that constant into a control like all the other serial port settings in that VI.

Message 17 of 25
(3,549 Views)

Hai,

 

I am getting the same error could you please tell me how did you solve it.

I am attaching the vi with this have look and tell me where i am going wrong.

My instrument is CONZERV digital power meter which uses modbus RTU for communication. i checked the settings in the instrument like

baud rate:9600,databits:8,stop bits:1, parity:even.

data type:32-bit float(real)

unit id in the instrument : 1

 

The following trials have been done,

- Specified the instrument id in the programm as 1 but a time out error has come (error code:6101)

- Specified the instrument id in the programm as 0 no errors observed but i am not able to read any data.

 

could you please help me inthis regard.

0 Kudos
Message 18 of 25
(3,332 Views)

In the constant where you have the slave address defined, you have it set to zero which is not valid.  You need to make it a 1 which you said is the unit ID of your instrument.

 

See how that works.  Then drop the 4 from the modbus address register if necessary.  It is likely 3037 or 3036 you want to enter to get register 43037.

 

 

Why did you post into another old thread?Smiley Mad  Had you even tried the tips provided in the first old thread you already posted into?

http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=382366#M382366

 

Please continue there.

Message Edited by Ravens Fan on 02-05-2009 12:43 AM
0 Kudos
Message 19 of 25
(3,330 Views)
Hi seen,

I guess understood your problem. I saw your VI and I found out one error in the Init.vi block. You said that the parametrs instrument works with stop bits equals 1, right? But your VI is not working with right parameters. Give a double-click in Init block, open the block diagram workspace and try to change serial settings: stop bit, e.g. 2.0 to 1.0.

This was only parameter that I realized.

The 6101 error could mean that the parameters between master and slaves are incorrect.
David Fiorillo
0 Kudos
Message 20 of 25
(3,312 Views)