‎12-05-2018 06:33 AM
Hello, I need some help for a project. I have various equipment for an experiment that was put togehter to work without a computer, just using some separate displays installed on a plastic box. Now I need to make them work using a computer with Labview (2017 Home and Student edition), which I know is not going to be easy. Any help is greatly appreciated, as I am relatively new to LabView.
I have a radiation detector, a Dual Area Monitor 375 by Ludlum Measurements Inc., which can be connected to a computer via ethernet connection. It is supposed to work with a specidic software sold separately, but I would like to read and record data from it with LabView. I have been told by customer support that it is technically possible to do it, so I just have to figure out how 🙂
The device itself communicates (read only) by sending a data message every 2 seconds in XML format, as explained in the manual. Here is the structure of the data example they provide:
<?xml version="1.0" encoding="us-ascii" ?>
<area_monitor rev ="1.0" serial="12345">
<status>
<rate>9999.9</rate>
<raw>9999999</raw>
<units_code>99</units_code>
<audio>1</audio>
<alarm1>1</alarm1>
<alarm2>1</alarm2>
<over_range>1</over_range>
<monitor>1</monitor>
<error_code>9</error_code>
</status>
</area_monitor>
Which functions should I use to acquire these files in real time and take the numbers that I need, so I can print them on a graph or store them in a file for later use?
Thank you very much for any help!
‎12-05-2018 08:06 AM
First use TCP functions to read in the xml strings over Ethernet
Then use XML Parsing function to parse the data.
‎12-05-2018 08:56 AM
The XML stuff can be tricky advise reading up on it.
Especially XPaths
www.w3schools.com/xml/xpath_intro.asp
For LabVIEW this should get you started
‎12-05-2018 09:11 AM
Thank you for your fast and clear reply!
I found the functions you mentioned, will have a look at it and let you know
‎12-10-2018 10:23 AM
Hi, I was looking at the functions and wanted to do things step by step, to be sure I'm getting it right.
So first i was trying to run a simple program with the purpose of getting this XML file "as is", and check if it matches the layout shown in the manual. (See picture)
Unfortunately it looks like there is no signal coming, the whole thing just stops at the first block (TCP Listen), waiting for connection and then returning Error 56 after the 10 sec waiting time that I set, which seems strange to me. The device is on and connected via ethernet cable, the connection on PC has been set properly and verified with the "ping" command in the Command Prompt. You are not supposed to do anything else, the detector just has the on/off switch, once it's turned on it should start to send data.
I was wondering if I'm using the wrong functions in LabView. I don't see any input for the IP address for example, I was just able to type the port, which I got from the network settings of the device (see figure).
Any idea of what I'm doing wrong?
Thank you for your help
‎12-10-2018 11:02 AM
The TCP Listen is for servers to wait for something to connect to it. In this case, you are the client. So use the TCP Open Connection instead.
‎12-10-2018 11:03 AM - edited ‎12-10-2018 11:05 AM
Is your remote device trying to establish a connection on port 50000? Your remote device needs to make a connection to your server. In addition, once you do get a connection you are reading 0 bytes, so you will not get any data. The device must have some protocol for sending the data stream. You need to understand that protocol so you know how much data to receive. I realize that you said it will be sending XML, but generally there is something in the protocol to let the server know how many bytes of data are being sent. A common practice is to send 4 bytes which indicate the number of data bytes to follow. There your server would read 4 bytes first and convert this to a number. It would use that number in the next TCP Read to indicate how many bytes should be read. This process is repeated so that you can read all of the data.
However, we would need the specific details of the protocol the device is using.
I just noticed that your device is the server so your code will need to use TCP Open to establish a connection with the device.
‎12-10-2018 11:47 AM
Thank you, I tried the Open Connection as first, but I was getting (and am still getting) Error 63 ("The network connection was refused by the server"), so I thought I was using the wrong function. I just put the same port and added the IP address (which doesn't change anything, I tried also without)
‎12-10-2018 11:49 AM
Are there any firewalls enabled between you and your device? This can cause problems connecting.
‎12-10-2018 12:06 PM
There is Windows Defender firewall on, plus another antivirus. But if I am able to get an answer with the ping command, shouldn't the connection be working?