LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Modbus using LV8

Well, I think I still am just as good sticking with MB Ethernet Master Query vi.  But that is my problem, where do I link the config file to that step even you mentioned?  The data array portion of the Modbus Command connection?
0 Kudos
Message 21 of 31
(1,980 Views)


scott_7723 wrote:
Thanks.  Well, for some reason I thought I had to stick with only vi's that had ethernet in the name.  I was just assuming that all the serial ones dealt with a serial cable...guess not.  Thank you for your input.  Yeah, the config files were the other half of my problem, but I'll keep looking on the forums for more on that.  Thanks.


I'm sorry.  I missed the point that you were using Modbus over ethernet.  All of my experience has been with Serial VI's.  You may need to use the MB Ethernet Master Query.vi.  I believe the only differences betweent the serial and ethernet versions is some of the header type information where the Modbus message is wrapped up with address codes and how LabVIEW accesses the communications medium.  As far as ModBUS is concerned, I think the register addressing and command codes are the same between the two.  It looks like the Modbus ethernet version as the Read Holding Registers and Write Multiple Registers built in as well.
 

Well, I think I still am just as good sticking with MB Ethernet Master Query vi.  But that is my problem, where do I link the config file to that step even you mentioned?  The data array portion of the Modbus Command connection?

Yes, you would just have the file I/O VI's work on the data array that would come out or go into the MB Ethernet Query.  If you need to, you could also store the starting register, # of registers,  device address parameters into the file as well.  But that would probably not be necessary assuming you are always using the same chunk of Modbus registers everytime you would either need to read from or write to the file.

 



Message Edited by Ravens Fan on 03-26-2008 11:59 AM
0 Kudos
Message 22 of 31
(1,979 Views)

Could you elaborate how to set START ADDRESS (in serial example vi's).

Intuitively I failed...

 

Thanks

0 Kudos
Message 23 of 31
(1,869 Views)
We really need to know what kind of a device your are trying to get data from. The start address does not need the starting digit (4 for holding registers, 0 for output coils, 1 for inputs, 3 for input registers). It is usually just the last four digits of the first data value to read. Sometimes you need to subtract one if the device uses zero based addressing.
0 Kudos
Message 24 of 31
(1,856 Views)

If you're so kind...

I was trying (first) to "simulate" the device (Affinity chiller) by using master/slave examples...

Here is a memory map of the "real" thing...

 

36720 - CWA-075L-NP18OAD5        Modbus RTU addresses: 9600:8:N:1Note: Set delay between polls as short as possible to prevent contact chattering upon startup and shutdown.  < 10ms is recommended.    Modbus Address 400052Temperature Set Value As Seen on Display: SVData Size: 1 Word = 16 bitsThis register is the process set point value for control in degrees C. It may be changed locally by an operator on the display or remote over Modbus to this register address.  Modbus Address 400051Process Temperature Value (Read Only)As Seen on Display: PVData Size: 1 Word = 16 bitsThis register is the present process value for the RTD in the process water line in degrees C. This value controls to the set point. This value can be read locally and in remote over Modbus.   Modbus Address 400026Touch Screen “Run” Push ButtonAs Seen on Display: Run Data Size: 1 Word = 16 bitsThis register is the chiller start/stop push button. This can be changed locally or when in remote, over Modbus.  The controller will automatically return this value to 0 and start or stop the chiller when it is changed to 1. Modbus Address 400038-0Run Status IndicatorAs Seen on Display: Off/On    Data Size: 1 Word = 16 bitsThis register is the status of the chiller start/stop. When the Run Push Button 400026 is pressed this indicator changes state. This can be read locally or when in remote, over Modbus.  0 = Start1= Stop Modbus Address 400029-0Local/Remote Status IndicatorDisplay: Loc/Rem    Decimal: 1 WordThis register is the status of the chiller Local or Remote. When the RmLoc push button is pressed on the chiller display this indicator changes state and control point of view back and forth.   0 = Local1= Remote      Modbus Address 400061Low Alarm Temperature Display: Low Temperature Setpoint Variable valueDecimal 1 WordThis register is the process set point value for the Low Temperature control value in degrees C. It may be changed locally by an operator on the display or remote over Modbus to this register address.  Modbus Address 400062 High Alarm Temperature Display: High Temperature Setpoint Variable valueDecimal 1 WordThis register is the process set point value for the High Temperature control value in degrees C. It may be changed locally by an operator on the display or remote over Modbus to this register address. 

 

thanks

0 Kudos
Message 25 of 31
(1,842 Views)

you will need to use read or write holding register commands. Addresses will be 52, 51, 26, 38, 29, 61, 62. Since the addresses are not consecutive, the command read/write multiple holding registers won't work in your setup. You also  need to know the address of the device (1-255) itself.

 

You will need to define your hardware setup for this simulation before we can help with the master/slave examples.

0 Kudos
Message 26 of 31
(1,830 Views)

command read/write multiple holding registers won't work?

 

Pardon me, what if I try to read 100 registers into an array and disregard the ones which are of no interest?

0 Kudos
Message 27 of 31
(1,823 Views)
I would recommend that for a read command only. I would not use that method for a write command.
0 Kudos
Message 28 of 31
(1,820 Views)

This thread got resurrected at a good time. I have an application where I need to communicate with a Love Temp controller. The TC controller uses Modbus and I guess is the slave. My PC would be the master? I am familiar with standard serial communication but the Modbus has me a little confused on terminology. The manual has this listed...

 

1. Supporting transmission speed: 2400, 4800, 9600, 19200, 38400 bps.
2. Non-supported formats: 7, N, 1 or 8, O, 2 or 8, E, 2.
3. Communication protocol: Modus (ASCII or RTU).
4. Function code: 03H to read the contents of register (Max. 8 words). 06H to
write 1 (one) word into register. 02H to read the bits data (Max. 16 bits). 05H to
write 1 (one) bit into register.
5. Address and Content of Data Register:

 

1000H Process value (PV)

1001H Set point (SV)

1002H Upper-limit of temperature range

1003H Lower-limit of temperature range

 

and so on.

 

Using the Modbus library VIs, how do do I query the process value?

Doug Ferguson
0 Kudos
Message 29 of 31
(1,819 Views)

Any chance the Love controller is the same as the Omega controller?

 

I just recently replied into this thread  http://forums.ni.com/ni/board/message?board.id=170&message.id=369217.  The commands you list sound the same as that user had.

 

I would recommend taking a look at that thread and see if that poster's VIs will help get you started.

0 Kudos
Message 30 of 31
(1,815 Views)