07-28-2025 08:06 AM - edited 07-28-2025 08:07 AM
I'm trying to incorporate a temperature measurement into a fairly complex code provided by "AALBORG LabVIEW Integration for XFM instruments," and I don't know how to approach it. In the default event structure, I added a simple temperature reading using DAQmx blocks, but I don't know how to connect it to the rest of the code. The temperature reading is an analog signal, while the rest of the code is serial. Any small help is appreciated.
07-28-2025 09:54 AM
Hi Jousepa,
@Jousepa wrote:
I'm trying to incorporate a temperature measurement into a fairly complex code provided by "AALBORG LabVIEW Integration for XFM instruments," and I don't know how to approach it. In the default event structure, I added a simple temperature reading using DAQmx blocks, but I don't know how to connect it to the rest of the code.
That example isn't "complex", but it is "crowded and coded in a bad way"…
@Jousepa wrote:
The temperature reading is an analog signal, while the rest of the code is serial.
The code is not "serial"…
The readings of that XFM device seems to be stored/managed by all those cluster, which contain mostly string elements. (Unfortunately you didn't attach all those subVIs so we cannot examine them!)
I recommend to hold the "data of interest" in your own data structure, all measurement data should be DBL and no string!
I also recommend to use that device driver only as an example and to build your own VI that does exactly what YOU need and not what the device manufacturer made as a bad example…
07-28-2025 10:35 AM
The answers to your questions are simple — because I'm a beginner haha. I thought that if I was using VISA drivers, it was because the communication is serial, so I receive data in the form of strings (ASCII). The thing is, the code works perfectly for what I need, I just wanted to add other parameters. Thanks for the quick reply.
07-28-2025 10:42 AM
Hi
The code you shared is complex, and to be honest, this code should be redone, to decouple the event structure with the Data aquisition.
But considering that the code is running, you did right in adding the read daq on Case 5 of the Timeout Event Structure.
You wrote you don't know how to connect it to the rest of the code.
What are you trying to accomplish and where are you stuck ?
For example, If you want to save the temp data into the same file, you can wire the array outtput into a vi that converts the array of numbers into string before it is saved on the file.
07-28-2025 11:46 AM
The subVIs are in the zip file — I'm not sure if you can already view them like that. I'm stuck when trying to combine that data into the same file (like a Notepad file), so I don't end up with two separate ones. First I tried to convert it into a string. I tried connecting it in several places, but I kept getting errors with the number of elements in the clusters, etc.
07-28-2025 02:20 PM - edited 07-28-2025 02:23 PM
Hi Jousepa,
@Jousepa wrote:
The subVIs are in the zip file — I'm not sure if you can already view them like that.
Thanks for posting them.
They are in the same bad shape as your main VI…
I hope you already use a LabVIEW project file to organize your LabVIEW project!?
@Jousepa wrote:
I'm stuck when trying to combine that data into the same file (like a Notepad file), so I don't end up with two separate ones.
You already know how to write (string) data into a text file.
You know how to convert numeric data to string and vice versa.
Why not combine your knowledge to add one more subVI to write your temperature data into the same text file?
08-01-2025 04:49 AM
This is what I’ve done, but I haven’t been able to test it in practice, so I have no idea if it will work.
How do you recommend I test without real hardware using instrumentation that is not from NI?
Regards.