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: 

LabVIEW Modbus HELP!

Solved!
Go to solution
Hello,
I am running the MB Serial Master Query.vi that ships with the Modbus libraries from the NI website. Whenever I send a command to write a setpoint to my "West 6100+" controller, everything seems to work fine.
However, when I send the command to read a temperature value from the controller, I get a timeout error. When I try troubleshooting this error by going into the MB Serial Receive VI, the VI does not allow me debug or edit it at all.
I know it will be difficult for you to decipher what is wrong with the communication to my controller, but please could you let me know how I can unlock that VI so that I can edit it. It constantly gives me the attached error message.
Thanks
CL


Message Edited by CaseyLamers on 02-14-2008 04:45 PM
0 Kudos
Message 1 of 22
(6,082 Views)

Hi CL,

I have taken a look at the vi, and it should be available for editing.  A reason that you may not be able to open it right now may be because you are currently running a program that calls it.  Try stopping or closing out of all programs running in the background before trying to edit it.  Also, you may want to try creating a copy of the library for editing purposes.

Regards,

Lauren

Applications Engineering
National Instruments
0 Kudos
Message 2 of 22
(6,054 Views)

Hi,

 

I'm trying to talk to with a bunch of West 6100+ temperature controllers, too. Can you give me a hint, how you converted word parameters to U16 words? For example, if I want to send a new set point (Modbus Par. 2), which is a floating point value, how do I convert this floating point value to words (U16)? I know how to use a typecast in LabVIEW, but what type do I cast from (or to which type do I cast when reading parameters)? SGL, DBL or what? What about all the other possible word parameters? Which datatypes do they use? Do you have a list of the data types?

 

Thanks for any help in advance.

 

Marc

CLD
0 Kudos
Message 3 of 22
(5,801 Views)
You shouldn't need to use a type cast in order to convert one type of numeric to another.  You should  be able to use the conversion VI's located in the Numeric>>Converstion palette.
Ben

National Instruments
Certified LabVIEW Associate Developer
Certified TestStand Developer
0 Kudos
Message 4 of 22
(5,761 Views)

Burban wrote:
You shouldn't need to use a type cast in order to convert one type of numeric to another.  You should  be able to use the conversion VI's located in the Numeric>>Converstion palette.

 

You sure? How do I convert from SGL to U16 and do not loose the decimal place? E.g. converting 12.3 to U16 would result in 12. But I want to set 12.3 as set point, so how do I tell this the West 6100+ controller?

 

Marc

CLD
0 Kudos
Message 5 of 22
(5,746 Views)

Hi Marc,

 

Unsigned integers inherently are unable to represent decimal values, this is by definition. I guess this would imply that you would need to supply a whole number to your device.

 

Regards,

Rasheel Karmacharya

Applications Engineering

Rasheel
0 Kudos
Message 6 of 22
(5,699 Views)
Solution
Accepted by topic author CaseyLamers

You need to look atthe manual and determine how the controller uses it setpoint register.  What I have seen with Watlow for example, is that the register is the setpoint multipled by 10, since the setpoint can have one decimal place.  In your case, you would set the register to 123 to be 12.3.  I have also seen that some values may be represented by two registers, which represent the binary value.  The manual usually describes the format.  You could try reading the register and see if the value makes any sense as well.

0 Kudos
Message 7 of 22
(5,697 Views)
I have not used this exact controller but have used modbus with many eurotherms and watlow temp controllers.  Ususlly you do send the "float" number as an integer without the decimal place and then there is a register which denoted the location of the decimal place.  There should be no typecasting.  Take your floating point number multiply it by the offset in the offset register.
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 8 of 22
(5,682 Views)

Hi,

 

thanks to all of you. I will try out your advices as soon as I have my hands on the controller again.

 

Regards,

Marc

CLD
0 Kudos
Message 9 of 22
(5,652 Views)

Hi,

 

for some reason I could not manage to communicate with the West controller. I use a PCI-8431/2 (2 port RS 485 card) with 2-wire automatic mode. For connecting the card to the controller I used the "NI Serial Quick Reference Guide". The guide describes the pins of the DB-9 Male connector of the card. I connected pin 8 (TXD+) and pin 9 (TXD-) to the controller. I also added a 120 ohm resistor. Result: No answer. I switched the connections on the controller, no answer. I used ASCII communication instead of Modbus, no answer. I looked with an oscilloscope at the 2 pins and I saw a signal which looked like a RS-485 signal (levels switching between 0 and 5 V). The controller tells me, that I have a RS-485 communications module plugged in.

 

Right now I can think only of two possible errors:

1.) Wrong pins connected from my PCI card to the controller.

2.) Some hardware error in the RS-485 plug-in module of the controller.

 

Any ideas?

 

Thanks for any input in advance.

Marc

CLD
0 Kudos
Message 10 of 22
(5,560 Views)