From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading temp from a Calex PhyroMiniUSB sensor

Hi,

 

I would like to seek help on how to read the "average temperature" from a PhyroMiniUSB

sensor. I am attaching a datasheet from the said sensor. Hoping somebody can help me with this one. By the way, I am using Labview 2014.

 

calex.JPG

0 Kudos
Message 1 of 6
(2,208 Views)

It is Modbus.

 

Use one of the NI Modbus libraries.

0 Kudos
Message 2 of 6
(2,198 Views)

Thanks for the advice.

I tried downloading modbus library then made initial communication vi.

I am getting error initialize state. I am attaching the vi.

 

library.png

0 Kudos
Message 3 of 6
(2,175 Views)

@drolyag wrote:

 

I am getting error initialize state.

 


So what error are you getting?  I don't want to have to guess which of the thousands of possibilities it could be!

 

One problem with that manual is that it just says is uses "Modbus over serial".  But it doesn't say whether it is using RTU or ASCII.  I find RTU to be far more commonly used in industry, but you have yours configured for ASCII.  You'll have to try both.

 

I actually never use the Init subVI from that library because I found it hardcoded a serial port setting that doesn't apply to some of my devices.  I just use a regular Serial Configure to set up the serial port.

0 Kudos
Message 4 of 6
(2,164 Views)

1.JPG

Left side of the image shows a sample modbus command, right side is the vi I am using from the downloaded library. I modified the "Mode" part and include "Hex" which has a value of 16. Still having error, maybe problem on "Data" or other input parameters. Also I may have a wrong CRC computation.

0 Kudos
Message 5 of 6
(2,107 Views)

You can't modify that enum!

 

A value of 16 means nothing to the subVI's later in the VI that use that enum value.  It is either RTU, which sets case structures in the subVI's to format it as pure binary data, or ASCII, which sets the case structures to be strings using the ASCII characters 0..9,A-F.  What is 16 even supposed to mean?

 

Also, you set the mode for the MB Serial Init to be ASCII, but later proceed to use this mysterious "16" for your Modbus Read.  (I pointed that out in my previous message.)

 

Are you sure your device's slave address is set to 11?

 

Also, as I said in my previous message, I prefer not to use that Modbus Init from that library.  I just use the regular VISA Serial Init and set my own baud rate, stop bits, parity and all of that.  The MB Serial Init makes assumptions on settings that don't always agree with the device you are communicating with.

 

 

 

 

0 Kudos
Message 6 of 6
(2,091 Views)