LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus RTU. Error 6101 occurs by reading from PID controller

Hi there 

 

I'm having trouble reading the temperature from a UR3274 PID controller. I have tried all suggested solutions I found online related to this problem but nothing helped. A similar VI for setting the temperature works fine and I have also checked the modbus communication using "simply modbus master 7.1.2" which gives correct values for a read request. 

 

 

I have attached a screenshot of the Block Diagram and both, the functioning "set temperature" VI and the malfunctioning "read temperature" VI.

 

I`m relatively new to Labview and would greatly appreciate any help. 

 

Regards 

Lukas

 

 

Labview 2012 SP1

Windows 7

 

 

0 Kudos
Message 1 of 18
(4,322 Views)

Hello stiefel92,

 

try to delete the flat sequences from your code, they are useless here. 

This error is a timeout error which can be generated by timing of the application, and flat sequences may be one of the possible reason.

Let me know if this solve your problem.

 

Kind regards. 

0 Kudos
Message 2 of 18
(4,313 Views)

Hi Lukas,

 

you seem to initialize the COM port with each call of your VI(s). Do you really need to?

Usually a port is initialized just once!

 

Hints:

- Using the autocleanup tool (Ctrl-U) helps to have straight wires. (Less bends, faster execution! :D)

- Your logic to convert from DBL to U16 could be significantly improved when using proper conversions. Converting from I16 to U16 automatically handles the sign bit…

- Using the error cluster in general helps to avoid sequence structures.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 18
(4,303 Views)

Hi 

Thank you Pep and Gerd for your quick answers. I am grateful for all the hints. Unfortunately they did not solve my problem. I deleted the flat sequence, cleaned the code up, used the error cluster and initialze just once. The dbl to u16 conversion is after the error so shouldn't be the problem, correct? The error occurs at the MB Serial Master Query Sub VI. 

Do you have other suggestions what I could do? 

 

Regards,

Lukas

0 Kudos
Message 4 of 18
(4,246 Views)

Ah you mean the dbl to u16 conversion in the set temperature vi. Sorry I was confused. That VI works fine but I appreciate the hint. It is only the read temperature vi that doesn't work 😞

Thanks 

Lukas 

0 Kudos
Message 5 of 18
(4,233 Views)

Check out this document, maybe it can help you.

http://digital.ni.com/public.nsf/allkb/628A4CF844B2382A862575D700349D99?OpenDocument

 

Kind regards.

0 Kudos
Message 6 of 18
(4,223 Views)

That didn't help either. I really don't know what to do. Start again from scratch?

 

Kind regards

 

0 Kudos
Message 7 of 18
(4,197 Views)

Hi stiefel92,

 

first of all, I suggest you to download the newer Modbus library from this link: http://www.ni.com/example/29756/en/

It is much better than the old one.

Second point, try to take off the function "VISA Set I/O Buffer Size" and run the code. This function needs the vi "VISA Configure Serial Port", even if it should work anyway because you are using the Modbus init function. Try to do this attempt anyway and let me know.

 

Kind regards

0 Kudos
Message 8 of 18
(4,186 Views)

Hi Pep91

 

I tried both, leaving the "Visa Set I/O Buffer size" away and repleacing it with the "VISA Configure Serial Port". I also updated the library and now get in all three cases (as it was, with the function left away, and the replaced function): Error -1073807298 occurred at VISA Read in MB Serial Receive.vi:2 -> MB Serial Master Query.vi:1...

I have found this discussion but it did not help me. (http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/I-Get-quot-VISA-Hex-0xBFFF003E-Could-not-perf...

 

Thanks for your help.

0 Kudos
Message 9 of 18
(4,176 Views)

I found something: http://digital.ni.com/public.nsf/allkb/60DDFED7EFEFE7188625705700750821?OpenDocument

 

I hope it will help you.

 

Kind regards

0 Kudos
Message 10 of 18
(4,158 Views)