

Jörg suggested I look at ActiveMQ from, which supports the MQTT protocol (among others). I didn’t find much in the way of debugging tools to know what the broker was doing (“what values does it see?”, “who is connected?”), so I started looking for other options. (The broker is at the center of the communications, and it’s the piece that makes sure that data gets from a publisher to all of the subscribers.)įrançois supplies his own native LabVIEW broker which works very well. I should also mention that I tried three different brokers. I have taken or plan to take a similar approach with the other data there’s no reason for it to be chatty about anything but watchdog counters. Instead of constantly sending everything, I now only communicate setpoints when they are set, and only send results when they are generated. To solve this, I split up my loops–one for publishing and one for subscribing, and everything started working again.Īs an aside, I also decided to make the application less chatty–something I could have done with DataSocket, too. Once the three components were up and running, there was enough chatty communication coming from the HMI that the headless DAQ systems never timed out, so they never published any data. While this initially worked in my testing with two MQTT clients, I soon realized that I’d made a silly mistake by doing it this way. I put the Publish calls in the Timeout case with a 250ms timeout. My first attempt at replacing this with MQTT was a straight replacement of DataSocket Write with MQTT Publish, and DataSocket Read with events in the event structure. Each has VIs that constantly (about once every quarter second) read and write the values of about 40 scalar global variables. It consists of three components (an HMI and two headless DAQ systems) which share state information, setpoints, measurement results, watchdog counters, and error information through DataSocket. The application I am replacing tends to be very chatty. In between, I can call VIs to publish data and/or wait for incoming data from my subscriptions with an event structure.
