Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

MODBUS-RTU and VISA Communication

Hello Everyone,

 

I am attempting to use a Watlow F4 controller with labview. All I really want to do is read the current temp and humidity inside my chamber.  I have tried the WLF4 plug and play drivers on the NI website, they do not work. I have been at this for about two weeks talking with techs at the company that supplied my chamber, Watlow and NI.  I am really hoping you guys can help me figure it out.

 

I have a post at http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Monitoring-a-Watlow-F4-Controller/td-p/141129... that details what I have done previously.

 

Attached is a VI that I found on the forums that supposedly works (ReadWrite[2]) and one of my own (VISA Test.vi).   Any help you guys can give would be very much appreciated!

 

Regards,

PChemist

Download All
0 Kudos
Message 1 of 10
(10,779 Views)

The data you are sending is not correct for RTU. You need to send hex and you are sending ASCII. Where did you get the data strings that you have? Can you attach your manual?

 

p.s. to send hex, right click in the constants and select 'Hex Display'.

0 Kudos
Message 2 of 10
(10,771 Views)

Hi Dennis,

 

Thanks for the tip, I have converted them to Hex and am FINALLY getting something back from the controller that makes sense.  Now I am just having trouble interpreting the string I get. I know what the values translate to.

 

I am getting the string values from COMM7, I told it to show me the hex code and am using those. I can look at it in both ASCII and Hex that way.

 

Here are the strings.

Command from Comm7 in Decimal

1 3 0 1 132 10       (ContollerAddress ModbusCommand Register NumRegisterstoRead CRCbits(?) Stopbit)

 

Controller Response in Decimal

1 3 2 5270 55 42      (ContollerAddress ModbusCommand ExceptionCode RegisterData CRCLowbyte(?) CRCHighbyte(?))

 

5270 is the model number that I am attempting to read, so result makes sense

 

Command from Comm7 in Hex

01 03 0000 0001 840A  (Same breakout as above)

 

Controller Response in Hex

01 03 02 1496 372A

 

After sending the above Command Hex string in my VI I get back the following string into my Read Buffer Indicator

0103 0214 9637 2A

 

It looks like I am getting the appropriate string back and need to take 1496 out as a subset and convert it into the ASCII 5270.

Do you have any insight into this?  Once I can get this working I will need switch to reading the Temp and Humidity registers and convert those numbers to single precision values.

 

 

I have attached my modified VI, with my default values saved, and the manual for the F4 (which is not much help).

 

Regards,

PChemist

Download All
0 Kudos
Message 3 of 10
(10,750 Views)

Hello,

 

It looks like you have successful communication, so if you need to get that part out of your string you should be able to parse it. I am not familiar with how the Watlow device works, so it might be best to contact the manufacturer.

 

Best Regards,

 

Adam G 

National Instruments
Applications Engineer
0 Kudos
Message 4 of 10
(10,719 Views)

Hello,

 

Yes I have been able to parse out the part of the string that is important. I am still having trouble converting it to a meaningful number.

 

I have attached my VI and a conversion VI, from someone else, below.  I can't figure out what type of string I am getting back from the controller. I believe it is binary string, since I see the correct value displayed when I set the display filed to show Hex.  I need to be able to take my sub string and convert it to a decimal value, which shold give me back 5270.

 

 

In the conversion VI with the input field showing Hex, the decimal value I get out (5270) is correct.

 

Anyone have any ideas?

I will gladly be posting my finished code as soon as this is working.

 

 

Regards,

Jake

Download All
0 Kudos
Message 5 of 10
(10,710 Views)

UPDATE:  The display field in the conversions.vi is set to Normal. When 1496 is typed into it and the conversion run it converts it to a decimal number of 5270 as it should be.

0 Kudos
Message 6 of 10
(10,693 Views)

Hello, I am currently working on a project with a Watlow controller. I am attempting to monitor the temp and relative humidity values and log them. I am using a really old version of Labview 8.2. I am unable to open your vi and would very much appreciate if you could take a screenshot. I keep getting timeout errors. I believe all my port settings are correct, I just hit a bit of a wall. Thanks!

0 Kudos
Message 7 of 10
(9,216 Views)

So, I figured out what I was doing wrong. I am now able to get a value from a desired register. the new problem is the format of the value, I know trivial. I am using array to cluster and my input values are 301 instead of 30.1 Should I be using some other array function to convert or do I need to parse/format the cluster into the correct format?

 

Help is always appreciated

 

Thanks!

0 Kudos
Message 8 of 10
(9,206 Views)

Sorry for not getting back to you faster.

 

Once you have the value from the registers you're reading you are correct. You need to parse the string into substrings to get your values, for instance 301. Then you need to take that value and format it. Luckily the values are pretty consistent and should be able to be formatted easily. It has been a while but I believe I just divided the number by 10 to move the decimal place a single point. The values that were being reported only had a single decimal precision so this was the easiest way to do it.

Message 9 of 10
(9,202 Views)

No problem, that's the route I took. Thanks!

0 Kudos
Message 10 of 10
(9,198 Views)