01-19-2016 04:57 AM
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
01-19-2016 05:11 AM
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.
01-19-2016 05:34 AM - edited 01-19-2016 05:42 AM
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.
01-19-2016 10:34 AM - edited 01-19-2016 10:36 AM
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
01-19-2016 11:07 AM
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
01-19-2016 11:15 AM
Check out this document, maybe it can help you.
http://digital.ni.com/public.nsf/allkb/628A4CF844B2382A862575D700349D99?OpenDocument
Kind regards.
01-20-2016 03:35 AM
That didn't help either. I really don't know what to do. Start again from scratch?
Kind regards
01-20-2016 03:55 AM
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
01-20-2016 05:06 AM
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.
01-20-2016 07:06 AM
I found something: http://digital.ni.com/public.nsf/allkb/60DDFED7EFEFE7188625705700750821?OpenDocument
I hope it will help you.
Kind regards