06-18-2025 08:24 AM
Hi, please has anyone here ever used Labview to read data from multiple counters on the same serial COM port through an M-BUS? I want to read data from 3 counters. I have already managed to build a program to read 2 counters but when I try to read all 3 I either don't get data for some counters or the data is not accurate.
Solved! Go to Solution.
06-18-2025 09:01 AM
Hi
In my opinion the internal while loops are unecessary, as they run only once.
I'm assuming by sending the proper command, the Serial device interprets what counter you are reading.
You can just send the serial commands one after the other.
One solution would be :
1 create a subvi that sends serial commands and reads the response.
2 implement a for loop sending for each counter at a time.
3 You will receive an array of responses corresponding to each counter.
* Make sure that there is enough time between each counter to respond properly.
06-18-2025 10:50 AM
@Boris.BA wrote:
Hi, please has anyone here ever used Labview to read data from multiple counters on the same serial COM port through an M-BUS? I want to read data from 3 counters. I have already managed to build a program to read 2 counters but when I try to read all 3 I either don't get data for some counters or the data is not accurate.
The simpler solution (if redesign is an option) might be to have three explicit COM ports. If it's a desktop, there are cards that have anywhere from 1 to 16 or more COM ports. If it's a laptop, maybe three USB to RS-232 serial adapters?
07-07-2025 03:50 AM
Yes, you are right. The internal While loops only execute once. I now use a first For loop with 3 iterations and an internal Case structure for each counter. The Loop Iteration gives the Case Selector. So for each Loop Iteration, a counter will be read.
Thank you for your solution idea.