LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading Words from Temperature Controller Registers Using Modbus

Solved!
Go to solution

I am working on a project that involves the use of a number of temperature controllers, Omega CN 7823s.  The communication protocol for them is RS485 Modbus, either ASCII or RTU.

 

I've had a bit of trouble getting communications working.  I think that I'm doing everything correctly in terms of setting up the initial communication settings (baud rate, parity, etc.), but have been unable to read values correctly.  I am able to write values to the holding registers, but cannot read them.  When I try to read them (using code 03), the result is simply a multiple of 256 (eg, if I try to read register 1001H, which is 4097 in decimal, I get a result of 256).

 

I am operating in ASCII at a baud rate of 9600, data length of seven bits, even parity, and 1 stop bit.

 

Any help would be much appreciated - I have attached my VI and the instruction manual of the controller.

Download All
0 Kudos
Message 1 of 18
(9,014 Views)

I am currently using the Modbus Library provided by LabVIEW, and, after some work, have determined that when I attempt to read values from the controller, the response I get is precisely the same as the message that I sent - without any of the data.  For example, if I request the data in register 1001 from the device at address 1, the format of the request is 010310010002E9, where the 01 is the address, 03 the function code, 1001 the address of the register, 0002 the number of bytes to read, and I suppose that E9 is the redundancy check.

 

I am not sure if my device is simply bouncing back my commands to me or if I am simply reading what I am writing because I am in half-duplex mode.  I have tried adding a time delay before the Serial Receive, but this has not resulted in success.  I have also attempted to duplicate the structure within the Modbus Serial Receive VI so that it would read the outgoing message and then the incoming message, but this simply resulted in a time-out error.

 

Does anyone know if the Modbus Library is intended for use with full or half duplex RS485, and, if it is meant for full duplex, if there is a way to ignore the signal I send out and only read the incoming signal? 

0 Kudos
Message 2 of 18
(8,986 Views)
Solution
Accepted by topic author Vancouver_TC

In the end it turned out that I had to create a property node for the VISA Instrument and specify that the serial mode was RS485/Wire2-Auto.  This has allowed the computer to read the response from the temperature controllers instead of simply reading the message that was sent out to them.  I wish I had discovered this on day 1, 2, or 3 of working on this problem, instead of day 5.

Message 3 of 18
(8,964 Views)

could you help me? I need to do a VI  to read electrical valus from a multimeter that use a modbus-rtu protocol and I'm using a converter usb to rs-485 to communicate to the computer. When I connect it to the computer it appear as a COM4 port. I know I need to use the modbus-rtu function 4(read input registers). it starts from 0x00 to 0xCD hexadecimal. 

0 Kudos
Message 4 of 18
(8,266 Views)

Hi, 

What is the name of the device you're using?  

Have you been through the modbus shipping examples with LabVIEW? 

 

Dave T. 

National Instruments
FlexRIO & R-Series Product Support Engineer
0 Kudos
Message 5 of 18
(8,259 Views)

Hi the divices' name is multi-k made by kron, it is a brazilian company, I think you don't know the company.

 

Have you been through the modbus shipping examples with LabVIEW?

Yes I have, but the problem is I don't know how I use this exemple. I have the modbus library but I'm not knowing how use the master exemple.

 

How do I build the array of information to send to the slave? Address, function, the informations i want to read, how much register i want read and the crc.

 

I'm sending the document of the multimeter that say about the protocol, but i's in portuguese.

0 Kudos
Message 6 of 18
(8,245 Views)
0 Kudos
Message 7 of 18
(8,242 Views)

Hi, 

 

I have a CN 7523 (OMEGA) controller. I am just begining to learn the Labview, so still trying to figure the basics.

 

Do you think the VI you made will work for my controller. I wish there would be simple VI file which i can further modify to my need.

 

your help will be much appreciated.

 

 

0 Kudos
Message 8 of 18
(8,099 Views)

Hi Ashish,

 

Since this thread has been marked as solved already, please start a new thread asking your new question.  In that new thread, you can link to this thread so that anyone helping can get some more background also.

 

You can see the following article to get familiar with LabVIEW: http://www.ni.com/gettingstarted/

 

 

Regards,

Che T.
Applications Engineer
National Instruments
0 Kudos
Message 9 of 18
(8,078 Views)

I truly need help with labview driver as well for solo 4848 controller…

 

I tried the “Basic Serial Read and Write.VI” but no success. When I use Solo software from Automation direct it works fine and can chart the PV. So it seems that the hardware is OK. When I run the VISA Interactive Control, I see the ASRL4:INSTR (Com port4).  The controller is configured as device 1

 

I loaded the Labview VISA drivers and matched all port configurations and copied some function codes from SOLO software (solo configuration will show write and send function codes) and still could not get any response.

 

Example to read the PV, I used the example codes below on my Labview VI

01031000000180CA   or *IDN?\01\03\10\00\00\02\80\CA\n\r\

still no response, just getting time out error code -1073807339

 

I read most of the posts added the time delay between write and read

can someone help?

Thank you in advance..

0 Kudos
Message 10 of 18
(6,103 Views)