07-23-2018 03:37 PM - edited 07-23-2018 03:46 PM
Hi all,
For reading out the values from a heat meter with M-Bus I'm using a USB converter which is connected to a PC. I am able to confirm it is properly configured and functional with M-Bus sheet software. However, for datalogging purposes I want to integrate this in LabVIEW, but have been unsuccessful so far. I'm using the example Simple Serial.vi to test simple commands (configuration settings are checked to be correct). For troubleshooting I have already consulted a similar topic on the forum: https://forums.ni.com/t5/LabVIEW/Problem-with-M-Bus-communication/td-p/2993583
I have implemented a string control on the 'VISA Write' object and made sure to select 'Hex display' on the front panel. Then I tried to send SND_NKE: 10 40 06 46 16 (n.b. in the string control this is automatically converted to 1040 0646 16). However, I don't get any response whatsoever. Normally, it should return 'E5'. Also, no error is thrown from the serial configuration, write, read or anywhere else. Upon hanging an indicator on the 'Return count' of the 'VISA Write' I do retrieve the value 5.
My experience with programming this, datatypes etc. is quite limited. Hopefully someone can help me figure out what is going wrong.
Solved! Go to Solution.
07-24-2018 01:54 AM
07-24-2018 03:49 AM
Hi,
Thanks for your response. Communication with the M-Bus Sheet software works fine. There should be no physical wiring problems. I have included the .vi file that I use simply to test if I can get any sort of response when I send the SND_NKE. No errors, no responses.
07-24-2018 04:53 AM - edited 07-24-2018 04:59 AM
Hi allovichi,
Thank you for posting your VI, that makes helping so much easier! Your VI looks okay. There is a possible issue in it, however with more information about the M-BUS protocol (or testing from your side) it's impossible to change it right now: does the protocol uses a general stop character (apart from the 0x16 that is used in some datagrams) like LF or CR? This would allow to remove the "bytes at port" functionality, which often causes a lot of trouble.
Which is the sensor you use? I think I found several devices from the company that made the software you posted. I took the manual of "Sensor THI" to get information on the protocol. Maybe you have a better source.
Do you know if the primary address is correct, and how to calculate the checksum? I could not verify them.
And, 2nd-most important: I found that the standard baud rate (of the device whose manual I was looking at) is 2400. This might apply to your device as well.
Most important: I found a forum thread "Problem with M-Bus communication" where an issue similar to yours was solved by: "Parity in VISA configuration should be "Even"." MAybe you want to give this a try as well?
Edit: When troubleshooting similar sensors back at university, I used a Serial Port Monitor software on the PC they were attached to (using an RS232-USB converter, too). This helped me understanding a protocol that did not have proper documentation. I used a open source, free software for this.
07-24-2018 02:08 PM
07-25-2018 04:28 AM
07-04-2019 09:26 AM
Hello,
Thanks for the example program, it was very handy. I have expanded the program further. and made it suitable for a USB Relay M-bus interface and a kamstrup multical 403. (see program).
hopefully it will help someone.